重构同步库项目
commit
1eb8e514e8
@ -0,0 +1,33 @@
|
||||
api-common/HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.6.7</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<groupId>com.glxp</groupId>
|
||||
<artifactId>udidl</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<mybatis-plus.version>3.5.1</mybatis-plus.version>
|
||||
<p6spy.version>3.9.1</p6spy.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--Json 操作-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.51</version>
|
||||
</dependency>
|
||||
|
||||
<!--common-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>2.0.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--AOP拦截-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--校验-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--让配置文件有提示-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<!-- sql性能分析插件 -->
|
||||
<dependency>
|
||||
<groupId>p6spy</groupId>
|
||||
<artifactId>p6spy</artifactId>
|
||||
<version>${p6spy.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--pagehelper分页插件-->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--热部署插件-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!--mysql驱动-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!--fastjson-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>2.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--JWT-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>0.9.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.5.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,18 @@
|
||||
package com.glxp.udidl.admin;
|
||||
|
||||
import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||
|
||||
@EnableTransactionManagement
|
||||
@EnableSwagger2WebMvc
|
||||
@SpringBootApplication(exclude = PageHelperAutoConfiguration.class)
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.udidl.admin.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 后台登录授权/权限验证的注解
|
||||
*/
|
||||
//此注解只能修饰方法
|
||||
@Target(ElementType.METHOD)
|
||||
//当前注解如何去保持
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface AuthRuleAnnotation {
|
||||
String value();
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.glxp.udidl.admin.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dao.sys.SysUserMapper;
|
||||
import com.glxp.udidl.admin.exception.JsonException;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
public class AuthAspect {
|
||||
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Resource
|
||||
private GlobalConfig globalConfig;
|
||||
|
||||
@Pointcut("@annotation(com.glxp.udidl.admin.annotation.AuthRuleAnnotation)")
|
||||
private void authMethod() {
|
||||
}
|
||||
|
||||
@Before(value = "authMethod()")
|
||||
public void before(JoinPoint joinPoint) {
|
||||
if (globalConfig.isOpenAuth() == false)
|
||||
return;
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
|
||||
if (attributes == null) {
|
||||
throw new JsonException(-1, "attributes = null");
|
||||
}
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
|
||||
String admin_id = request.getHeader("ADMIN_ID");
|
||||
if (StrUtil.isNotBlank(admin_id) && "1".equals(admin_id)) {
|
||||
//管理员
|
||||
return;
|
||||
}
|
||||
|
||||
String appId = request.getHeader("appId");
|
||||
String appSecret = request.getHeader("appSecret");
|
||||
if (StrUtil.isBlank(appId)) {
|
||||
throw new JsonException(401, "appId不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(appSecret)) {
|
||||
throw new JsonException(401, "appSecret不能为空");
|
||||
}
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
AuthRuleAnnotation action = method.getAnnotation(AuthRuleAnnotation.class);
|
||||
String perms = action.value();
|
||||
Integer res = sysUserMapper.hasAuthPerms(appId, appSecret, perms);
|
||||
if (res == 0)
|
||||
throw new JsonException(402, "无权限!");
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.udidl.admin.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 跨域配置
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "cors")
|
||||
public class CorsConfig {
|
||||
|
||||
// 允许的域
|
||||
private String allowedOrigins;
|
||||
// 允许的方法
|
||||
private String allowedMethods;
|
||||
// 允许的头信息
|
||||
private String allowedHeaders;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.udidl.admin.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Data
|
||||
public class GlobalConfig {
|
||||
|
||||
@Value("${config.downloadPath}")
|
||||
private String downloadPath;
|
||||
|
||||
/**
|
||||
* 是否开启权限验证
|
||||
*/
|
||||
@Value("${config.openAuth}")
|
||||
private boolean openAuth;
|
||||
|
||||
/**
|
||||
* 阳光采购平台地址
|
||||
*/
|
||||
@Value("${udplat.host}")
|
||||
private String udplat_host;
|
||||
@Value("${udplat.appId}")
|
||||
private String udplat_appId;
|
||||
@Value("${udplat.secretKey}")
|
||||
private String udplat_secretKey;
|
||||
@Value("${udplat.userName}")
|
||||
private String udplat_userName;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.glxp.udidl.admin.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 公共文件的配置
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "public-file")
|
||||
public class PublicFileUrlConfig {
|
||||
|
||||
/**
|
||||
* 上传的地址
|
||||
*/
|
||||
private static String uploadUrl;
|
||||
|
||||
public void setUploadUrl(String uploadUrl) {
|
||||
PublicFileUrlConfig.uploadUrl = uploadUrl;
|
||||
}
|
||||
|
||||
public static String getUploadUrl() {
|
||||
return uploadUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源的域名
|
||||
*/
|
||||
private static String domain;
|
||||
|
||||
public void setDomain(String domain) {
|
||||
PublicFileUrlConfig.domain = domain;
|
||||
}
|
||||
|
||||
public static String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.glxp.udidl.admin.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean(value = "defaultApi2")
|
||||
public Docket defaultApi2() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(new ApiInfoBuilder()
|
||||
.title("第三方服务")
|
||||
.description("接口文档")
|
||||
.version("1.0")
|
||||
.build())
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(RequestHandlerSelectors.basePackage("com.glxp.udidl.admin.controller"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.udidl.admin.config;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
//设置允许跨域的路径
|
||||
registry.addMapping("/**")
|
||||
//设置允许跨域请求的域名
|
||||
.allowedOriginPatterns("*")
|
||||
//是否允许证书 不再默认开启
|
||||
.allowCredentials(true)
|
||||
//设置允许的方法
|
||||
.allowedMethods("*")
|
||||
//跨域允许时间
|
||||
.maxAge(3600);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.glxp.udidl.admin.constant;
|
||||
|
||||
/**
|
||||
* redis 常量
|
||||
*/
|
||||
public interface CacheConstant {
|
||||
|
||||
String ADMIN_AUTH_RULES = "admin_auth_rules:%s"; // 管理员的权限
|
||||
|
||||
}
|
@ -0,0 +1,242 @@
|
||||
package com.glxp.udidl.admin.controller.auth;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthAdmin;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthRole;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthRoleAdmin;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.req.auth.AuthAdminQueryRequest;
|
||||
import com.glxp.udidl.admin.req.auth.AuthAdminSaveRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.PageSimpleResponse;
|
||||
import com.glxp.udidl.admin.res.auth.AuthAdminResponse;
|
||||
import com.glxp.udidl.admin.res.auth.AuthAdminRoleResponse;
|
||||
import com.glxp.udidl.admin.service.auth.AuthAdminService;
|
||||
import com.glxp.udidl.admin.service.auth.AuthRoleAdminService;
|
||||
import com.glxp.udidl.admin.service.auth.AuthRoleService;
|
||||
import com.glxp.udidl.admin.util.PasswordUtils;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 管理员相关
|
||||
*/
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class AuthAdminController {
|
||||
|
||||
@Resource
|
||||
private AuthAdminService authAdminService;
|
||||
|
||||
@Resource
|
||||
private AuthRoleService authRoleService;
|
||||
|
||||
@Resource
|
||||
private AuthRoleAdminService authRoleAdminService;
|
||||
|
||||
/**
|
||||
* 获取管理员列表
|
||||
*/
|
||||
@ApiOperation(value = "获取管理员列表")
|
||||
@AuthRuleAnnotation("admin/auth/admin/index")
|
||||
@GetMapping("/admin/auth/admin/index")
|
||||
public BaseResponse index(@Valid AuthAdminQueryRequest authAdminQueryRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
if (authAdminQueryRequest.getRoleId() != null) {
|
||||
List<AuthRoleAdmin> authRoleAdmins = authRoleAdminService.listByRoleId(authAdminQueryRequest.getRoleId());
|
||||
List<Long> ids = new ArrayList<>();
|
||||
if (authRoleAdmins != null && !authRoleAdmins.isEmpty()) {
|
||||
ids = authRoleAdmins.stream().map(AuthRoleAdmin::getAdmin_id).collect(Collectors.toList());
|
||||
}
|
||||
authAdminQueryRequest.setIds(ids);
|
||||
}
|
||||
List<AuthAdmin> authAdmins = authAdminService.listAdminPage(authAdminQueryRequest);
|
||||
List<AuthAdmin> authAdminList = new ArrayList<>();
|
||||
for (AuthAdmin authAdmin : authAdmins) {
|
||||
if (!authAdmin.getUserName().equals("admin")) {
|
||||
authAdminList.add(authAdmin);
|
||||
}
|
||||
}
|
||||
// 查询所有的权限
|
||||
List<Long> adminIds = authAdminList.stream().map(AuthAdmin::getId).collect(Collectors.toList());
|
||||
List<AuthRoleAdmin> authRoleAdminList = authRoleAdminService.listByAdminIdIn(adminIds);
|
||||
|
||||
// 视图列表
|
||||
List<AuthAdminResponse> authAdminResponseList = authAdminList.stream().map(item -> {
|
||||
AuthAdminResponse authAdminResponse = new AuthAdminResponse();
|
||||
BeanUtils.copyProperties(item, authAdminResponse);
|
||||
List<Long> roles = authRoleAdminList.stream()
|
||||
.filter(authRoleAdmin -> authAdminResponse.getId().equals(authRoleAdmin.getAdmin_id()))
|
||||
.map(AuthRoleAdmin::getRole_id)
|
||||
.collect(Collectors.toList());
|
||||
authAdminResponse.setRoles(roles);
|
||||
return authAdminResponse;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
PageInfo<AuthAdmin> authAdminPageInfo = new PageInfo<>(authAdminList);
|
||||
PageSimpleResponse<AuthAdminResponse> authAdminPageSimpleResponse = new PageSimpleResponse<>();
|
||||
authAdminPageSimpleResponse.setTotal(authAdminPageInfo.getTotal());
|
||||
authAdminPageSimpleResponse.setList(authAdminResponseList);
|
||||
|
||||
return ResultVOUtils.success(authAdminPageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色列表
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/admin/roleList")
|
||||
@GetMapping("/admin/auth/admin/roleList")
|
||||
public BaseResponse roleList(@RequestParam(value = "page", defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "limit", defaultValue = "100") Integer limit) {
|
||||
List<AuthRole> authRoleList = authRoleService.listAuthAdminRolePage(page, limit, null);
|
||||
PageInfo<AuthRole> pageInfo = new PageInfo<>(authRoleList);
|
||||
PageSimpleResponse<AuthAdminRoleResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
List<AuthAdminRoleResponse> authAdminRoleResponses = authRoleList.stream().map(e -> {
|
||||
AuthAdminRoleResponse authAdminRoleResponse = new AuthAdminRoleResponse();
|
||||
BeanUtils.copyProperties(e, authAdminRoleResponse);
|
||||
return authAdminRoleResponse;
|
||||
}).collect(Collectors.toList());
|
||||
pageSimpleResponse.setList(authAdminRoleResponses);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/admin/save")
|
||||
@PostMapping("/admin/auth/admin/save")
|
||||
public BaseResponse save(@RequestBody @Valid AuthAdminSaveRequest authAdminSaveRequest,
|
||||
BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
// 检查是否存在相同名称的管理员
|
||||
AuthAdmin byUserName = authAdminService.findByUserName(authAdminSaveRequest.getUserName());
|
||||
if (byUserName != null) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "当前管理员已存在");
|
||||
}
|
||||
|
||||
AuthAdmin authAdmin = new AuthAdmin();
|
||||
BeanUtils.copyProperties(authAdminSaveRequest, authAdmin);
|
||||
|
||||
if (authAdmin.getPassWord() != null) {
|
||||
authAdmin.setPassWord(PasswordUtils.authAdminPwd(authAdmin.getPassWord()));
|
||||
}
|
||||
|
||||
boolean b = authAdminService.insertAuthAdmin(authAdmin);
|
||||
authAdmin = authAdminService.findByUserName(authAdmin.getUserName());
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
// 插入角色
|
||||
if (authAdminSaveRequest.getRoles() != null) {
|
||||
authRoleAdminService.insertRolesAdminIdAll(authAdminSaveRequest.getRoles(), authAdmin.getId());
|
||||
}
|
||||
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
res.put("id", authAdmin.getId());
|
||||
return ResultVOUtils.success(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/admin/edit")
|
||||
@PostMapping("/admin/auth/admin/edit")
|
||||
public BaseResponse edit(@RequestBody @Valid AuthAdminSaveRequest authAdminSaveRequest,
|
||||
BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
if (authAdminSaveRequest.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数错误!");
|
||||
}
|
||||
|
||||
// 检查是否存在除了当前管理员的其它名称的管理员
|
||||
AuthAdmin byUserName = authAdminService.findByUserName(authAdminSaveRequest.getUserName());
|
||||
if (byUserName != null && !authAdminSaveRequest.getId().equals(byUserName.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "当前管理员已存在");
|
||||
}
|
||||
|
||||
AuthAdmin authAdmin = new AuthAdmin();
|
||||
BeanUtils.copyProperties(authAdminSaveRequest, authAdmin);
|
||||
if (authAdmin.getPassWord() != null) {
|
||||
authAdmin.setPassWord(PasswordUtils.authAdminPwd(authAdmin.getPassWord()));
|
||||
}
|
||||
|
||||
boolean b = authAdminService.updateAuthAdmin(authAdmin);
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
// 修改角色
|
||||
if (authAdminSaveRequest.getRoles() != null) {
|
||||
// 先删除之前的
|
||||
authRoleAdminService.deleteByAdminId(authAdmin.getId());
|
||||
authRoleAdminService.insertRolesAdminIdAll(authAdminSaveRequest.getRoles(), authAdmin.getId());
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/admin/delete")
|
||||
@PostMapping("/admin/auth/admin/delete")
|
||||
public BaseResponse delete(@RequestBody AuthAdminSaveRequest authAdminSaveRequest) {
|
||||
|
||||
if (authAdminSaveRequest.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数错误!");
|
||||
}
|
||||
|
||||
boolean b = authAdminService.deleteById(authAdminSaveRequest.getId());
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
// 先删除之前的角色
|
||||
authRoleAdminService.deleteByAdminId(authAdminSaveRequest.getId());
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医院用户列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/admin/auth/admin/hospitalUserList")
|
||||
public BaseResponse getHospitalUserList() {
|
||||
return ResultVOUtils.success(authAdminService.getHospitalUserList());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
package com.glxp.udidl.admin.controller.auth;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthPermissionRule;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.req.auth.AuthPermissionRuleSaveRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.auth.AuthPermissionRuleMergeResponse;
|
||||
import com.glxp.udidl.admin.service.auth.AuthPermissionRuleService;
|
||||
import com.glxp.udidl.admin.util.PermissionRuleTreeUtils;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 权限规则相关
|
||||
*/
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class AuthPermissionRuleController {
|
||||
|
||||
@Resource
|
||||
private AuthPermissionRuleService authPermissionRuleService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/permission_rule/index")
|
||||
@GetMapping("/admin/auth/permission_rule/index")
|
||||
public BaseResponse index() {
|
||||
List<AuthPermissionRule> authPermissionRuleList = authPermissionRuleService.listAll();
|
||||
List<AuthPermissionRuleMergeResponse> merge = PermissionRuleTreeUtils.merge(authPermissionRuleList, 0L);
|
||||
Map<String, Object> restMap = new HashMap<>();
|
||||
restMap.put("list", merge);
|
||||
return ResultVOUtils.success(restMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param authPermissionRuleSaveRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/permission_rule/save")
|
||||
@PostMapping("/admin/auth/permission_rule/save")
|
||||
public BaseResponse save(@RequestBody @Valid AuthPermissionRuleSaveRequest authPermissionRuleSaveRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
if (authPermissionRuleSaveRequest.getPid() == null) {
|
||||
authPermissionRuleSaveRequest.setPid(0L); // 默认设置
|
||||
}
|
||||
AuthPermissionRule authPermissionRule = new AuthPermissionRule();
|
||||
BeanUtils.copyProperties(authPermissionRuleSaveRequest, authPermissionRule);
|
||||
|
||||
boolean b = authPermissionRuleService.insertAuthPermissionRule(authPermissionRule);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
res.put("id", authPermissionRule.getId());
|
||||
return ResultVOUtils.success(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param authPermissionRuleSaveRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/permission_rule/edit")
|
||||
@PostMapping("/admin/auth/permission_rule/edit")
|
||||
public BaseResponse edit(@RequestBody @Valid AuthPermissionRuleSaveRequest authPermissionRuleSaveRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
if (authPermissionRuleSaveRequest.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
|
||||
authPermissionRuleSaveRequest.setPid(null); // 不能修改父级 pid
|
||||
|
||||
AuthPermissionRule authPermissionRule = new AuthPermissionRule();
|
||||
BeanUtils.copyProperties(authPermissionRuleSaveRequest, authPermissionRule);
|
||||
|
||||
boolean b = authPermissionRuleService.updateAuthPermissionRule(authPermissionRule);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param authPermissionRuleSaveRequest
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/permission_rule/delete")
|
||||
@PostMapping("/admin/auth/permission_rule/delete")
|
||||
public BaseResponse delete(@RequestBody AuthPermissionRuleSaveRequest authPermissionRuleSaveRequest) {
|
||||
|
||||
if (authPermissionRuleSaveRequest.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
|
||||
boolean b = authPermissionRuleService.deleteById(authPermissionRuleSaveRequest.getId());
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,224 @@
|
||||
package com.glxp.udidl.admin.controller.auth;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthPermission;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthPermissionRule;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthRole;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.req.auth.AuthRoleAuthRequest;
|
||||
import com.glxp.udidl.admin.req.auth.AuthRoleQueryRequest;
|
||||
import com.glxp.udidl.admin.req.auth.AuthRoleSaveRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.PageSimpleResponse;
|
||||
import com.glxp.udidl.admin.res.auth.AuthPermissionRuleMergeResponse;
|
||||
import com.glxp.udidl.admin.res.auth.AuthRoleResponse;
|
||||
import com.glxp.udidl.admin.service.auth.AuthPermissionRuleService;
|
||||
import com.glxp.udidl.admin.service.auth.AuthPermissionService;
|
||||
import com.glxp.udidl.admin.service.auth.AuthRoleService;
|
||||
import com.glxp.udidl.admin.util.PermissionRuleTreeUtils;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 角色相关
|
||||
*/
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class AuthRoleController {
|
||||
|
||||
@Resource
|
||||
private AuthRoleService authRoleService;
|
||||
|
||||
@Resource
|
||||
private AuthPermissionRuleService authPermissionRuleService;
|
||||
|
||||
@Resource
|
||||
private AuthPermissionService authPermissionService;
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/role/index")
|
||||
@GetMapping("/admin/auth/role/index")
|
||||
public BaseResponse index(@Valid AuthRoleQueryRequest authRoleQueryRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
List<AuthRole> authRoleList = authRoleService.listAdminPage(authRoleQueryRequest);
|
||||
List<AuthRoleResponse> authRoleResponseList = authRoleList.stream().map(item -> {
|
||||
AuthRoleResponse authRoleResponse = new AuthRoleResponse();
|
||||
BeanUtils.copyProperties(item, authRoleResponse);
|
||||
return authRoleResponse;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
PageInfo<AuthRole> pageInfo = new PageInfo<>(authRoleList);
|
||||
PageSimpleResponse<AuthRoleResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(authRoleResponseList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取授权列表
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/role/authList")
|
||||
@GetMapping("/admin/auth/role/authList")
|
||||
public BaseResponse authList(@RequestParam("id") Long id) {
|
||||
|
||||
// 查询当前角色拥有的权限id
|
||||
List<AuthPermission> authPermissionList = authPermissionService.listByRoleId(id);
|
||||
List<Long> checkedKeys = authPermissionList.stream()
|
||||
.map(AuthPermission::getPermissionRuleId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 查询所有权限规则
|
||||
List<AuthPermissionRule> authPermissionRuleList = authPermissionRuleService.listAll();
|
||||
List<AuthPermissionRuleMergeResponse> merge = PermissionRuleTreeUtils.merge(authPermissionRuleList, 0L);
|
||||
|
||||
Map<String, Object> restMap = new HashMap<>();
|
||||
restMap.put("list", merge);
|
||||
restMap.put("checkedKeys", checkedKeys);
|
||||
return ResultVOUtils.success(restMap);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("admin/auth/role/auth")
|
||||
@PostMapping("/admin/auth/role/auth")
|
||||
public BaseResponse auth(@RequestBody @Valid AuthRoleAuthRequest authRoleAuthRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
// 先删除之前的授权
|
||||
authPermissionService.deleteByRoleId(authRoleAuthRequest.getRole_id());
|
||||
|
||||
List<AuthPermission> authPermissionList = authRoleAuthRequest.getAuth_rules().stream()
|
||||
.map(aLong -> {
|
||||
AuthPermission authPermission = new AuthPermission();
|
||||
authPermission.setRoleId(authRoleAuthRequest.getRole_id());
|
||||
authPermission.setPermissionRuleId(aLong);
|
||||
authPermission.setType("admin");
|
||||
return authPermission;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
int i = authPermissionService.insertAuthPermissionAll(authPermissionList);
|
||||
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param authRoleSaveRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/role/save")
|
||||
@PostMapping("/admin/auth/role/save")
|
||||
public BaseResponse save(@RequestBody @Valid AuthRoleSaveRequest authRoleSaveRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
AuthRole byName = authRoleService.findByName(authRoleSaveRequest.getName());
|
||||
if (byName != null) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "当前角色已存在");
|
||||
}
|
||||
|
||||
AuthRole authRole = new AuthRole();
|
||||
BeanUtils.copyProperties(authRoleSaveRequest, authRole);
|
||||
|
||||
boolean b = authRoleService.insertAuthRole(authRole);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
res.put("id", authRole.getId());
|
||||
return ResultVOUtils.success(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param authRoleSaveRequest
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/role/edit")
|
||||
@PostMapping("/admin/auth/role/edit")
|
||||
public BaseResponse edit(@RequestBody @Valid AuthRoleSaveRequest authRoleSaveRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
if (authRoleSaveRequest.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
|
||||
// 检查是否存在当前角色
|
||||
AuthRole byName = authRoleService.findByName(authRoleSaveRequest.getName());
|
||||
if (byName != null && !authRoleSaveRequest.getId().equals(byName.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "当前角色已存在");
|
||||
}
|
||||
|
||||
AuthRole authRole = new AuthRole();
|
||||
BeanUtils.copyProperties(authRoleSaveRequest, authRole);
|
||||
|
||||
boolean b = authRoleService.updateAuthRole(authRole);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param authRoleSaveRequest
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("admin/auth/role/delete")
|
||||
@PostMapping("/admin/auth/role/delete")
|
||||
public BaseResponse delete(@RequestBody AuthRoleSaveRequest authRoleSaveRequest) {
|
||||
|
||||
if (authRoleSaveRequest.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
|
||||
boolean b = authRoleService.deleteById(authRoleSaveRequest.getId());
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
// 再删除之前的授权
|
||||
authPermissionService.deleteByRoleId(authRoleSaveRequest.getId());
|
||||
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,208 @@
|
||||
package com.glxp.udidl.admin.controller.auth;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthAdmin;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.exception.JsonException;
|
||||
import com.glxp.udidl.admin.req.auth.LoginRequest;
|
||||
import com.glxp.udidl.admin.req.auth.PCLoginRequest;
|
||||
import com.glxp.udidl.admin.req.auth.UpdatePasswordRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.auth.LoginUserInfoResponse;
|
||||
import com.glxp.udidl.admin.service.auth.AuthAdminService;
|
||||
import com.glxp.udidl.admin.service.auth.AuthLoginService;
|
||||
import com.glxp.udidl.admin.util.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 登录相关
|
||||
*/
|
||||
@Slf4j
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private AuthLoginService authLoginService;
|
||||
|
||||
@Autowired
|
||||
private AuthAdminService authAdminService;
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/login")
|
||||
public BaseResponse index(@RequestBody @Valid LoginRequest loginRequest,
|
||||
BindingResult bindingResult,
|
||||
HttpServletRequest request) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
AuthAdmin authAdmin = authAdminService.findByUserName(loginRequest.getUsername());
|
||||
if (authAdmin == null) {
|
||||
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
|
||||
}
|
||||
|
||||
if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(authAdmin.getPassWord())) {
|
||||
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
|
||||
}
|
||||
if (authAdmin.getUserFlag() == 0) {
|
||||
throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!");
|
||||
}
|
||||
|
||||
// 更新登录状态
|
||||
AuthAdmin authAdminUp = new AuthAdmin();
|
||||
authAdminUp.setId(authAdmin.getId());
|
||||
authAdminUp.setLastLoginTime(new Date());
|
||||
authAdminUp.setLastLoginIp(IpUtils.getIpAddr(request));
|
||||
authAdminService.updateAuthAdmin(authAdminUp);
|
||||
|
||||
// 登录成功后获取权限,这里面会设置到缓存
|
||||
authLoginService.listRuleByAdminId(authAdmin.getId());
|
||||
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put("admin_id", authAdmin.getId());
|
||||
String token = JwtUtils.createToken(claims, 86400L); // 一天后过期
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", authAdmin.getId());
|
||||
map.put("token", token);
|
||||
map.put("time", DateUtil.getDateTime());
|
||||
|
||||
return ResultVOUtils.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/pc/login")
|
||||
public BaseResponse pcLogin(@RequestBody @Valid PCLoginRequest loginRequest,
|
||||
BindingResult bindingResult,
|
||||
HttpServletRequest request) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
AuthAdmin authAdmin = authAdminService.findByUserName(loginRequest.getUsername());
|
||||
if (authAdmin == null) {
|
||||
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
|
||||
}
|
||||
|
||||
if (!PasswordUtils.authAdminPwd(loginRequest.getPassword()).equals(authAdmin.getPassWord())) {
|
||||
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
|
||||
}
|
||||
|
||||
// 更新登录状态
|
||||
AuthAdmin authAdminUp = new AuthAdmin();
|
||||
authAdminUp.setId(authAdmin.getId());
|
||||
authAdminUp.setLastLoginTime(new Date());
|
||||
authAdminUp.setLastLoginIp(IpUtils.getIpAddr(request));
|
||||
authAdminService.updateAuthAdmin(authAdminUp);
|
||||
|
||||
// 登录成功后获取权限,这里面会设置到缓存
|
||||
authLoginService.listRuleByAdminId(authAdmin.getId());
|
||||
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put("admin_id", authAdmin.getId());
|
||||
String token = JwtUtils.createToken(claims, 86400L); // 一天后过期
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", authAdmin.getId());
|
||||
map.put("token", token);
|
||||
map.put("time", DateUtil.getDateTime());
|
||||
|
||||
return ResultVOUtils.success(map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取登录用户信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/admin/auth/login/userInfo")
|
||||
public BaseResponse userInfo(HttpServletRequest request) {
|
||||
String adminId = request.getHeader("ADMIN_ID");
|
||||
Long id = Long.valueOf(adminId);
|
||||
|
||||
AuthAdmin authAdmin = authAdminService.findById(id);
|
||||
|
||||
List<String> authRules = authLoginService.listRuleByAdminId(authAdmin.getId());
|
||||
|
||||
LoginUserInfoResponse loginUserInfoResponse = new LoginUserInfoResponse();
|
||||
BeanUtils.copyProperties(authAdmin, loginUserInfoResponse);
|
||||
loginUserInfoResponse.setAuthRules(authRules);
|
||||
|
||||
return ResultVOUtils.success(loginUserInfoResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/admin/auth/login/out")
|
||||
public BaseResponse out() {
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("") // 需要登录验证,但是不需要权限验证时,value 值填空字符串
|
||||
@PostMapping("/admin/auth/login/password")
|
||||
public BaseResponse password(@RequestBody @Valid UpdatePasswordRequest updatePasswordRequest,
|
||||
BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL.getCode(),
|
||||
bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
AuthAdmin authAdmin = authAdminService.findById(updatePasswordRequest.getAdminId());
|
||||
if (authAdmin == null) {
|
||||
throw new JsonException(ResultEnum.DATA_NOT);
|
||||
}
|
||||
String oldPwd = PasswordUtils.authAdminPwd(updatePasswordRequest.getOldPassword());
|
||||
// 旧密码不对
|
||||
if (authAdmin.getPassWord() != null
|
||||
&& !authAdmin.getPassWord().equals(oldPwd)) {
|
||||
throw new JsonException(ResultEnum.DATA_NOT, "旧密码匹配失败");
|
||||
}
|
||||
|
||||
AuthAdmin authAdminUp = new AuthAdmin();
|
||||
authAdminUp.setId(authAdmin.getId());
|
||||
String newPwd = PasswordUtils.authAdminPwd(updatePasswordRequest.getNewPassword());
|
||||
authAdminUp.setPassWord(newPwd);
|
||||
|
||||
boolean b = authAdminService.updateAuthAdmin(authAdminUp);
|
||||
if (b) {
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
return ResultVOUtils.error(ResultEnum.DATA_CHANGE);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.udid.Contactlist;
|
||||
import com.glxp.udidl.admin.entity.udid.Device;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.req.DlConnactRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.DLConnactResponse;
|
||||
import com.glxp.udidl.admin.service.inout.DeviceService;
|
||||
import com.glxp.udidl.admin.service.inout.DlConnactService;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 医疗器械电话联系人
|
||||
*/
|
||||
@Api(tags = "医疗器械电话联系人接口")
|
||||
@RestController
|
||||
public class ContactController {
|
||||
|
||||
@Resource
|
||||
private DlConnactService dlConnactService;
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
|
||||
@ApiOperation(value = "下载医疗器械联系人信息", response = DLConnactResponse.class)
|
||||
@AuthRuleAnnotation("udidl/device/dlconnact")
|
||||
@GetMapping("udidl/device/dlconnact")
|
||||
public BaseResponse dlconnacts(@Valid DlConnactRequest dlConnactRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<Contactlist> contactlistList = dlConnactService.dlConnacts(dlConnactRequest);
|
||||
List<DLConnactResponse> dlConnactResponses = new ArrayList<>();
|
||||
if (contactlistList != null && contactlistList.size() > 0) {
|
||||
for (Contactlist contactlist : contactlistList) {
|
||||
Device device = deviceService.searchByDeviceRecordKey(contactlist.getDevicerecordkey());
|
||||
DLConnactResponse dlConnactResponse = new DLConnactResponse();
|
||||
dlConnactResponse.setDeviceRecordKey(contactlist.getDevicerecordkey());
|
||||
dlConnactResponse.setQylxrcz(contactlist.getQylxrcz());
|
||||
dlConnactResponse.setQylxrdh(contactlist.getQylxrdh());
|
||||
dlConnactResponse.setQylxryx(contactlist.getQylxryx());
|
||||
dlConnactResponse.setCpmctymc(device.getCpmctymc());
|
||||
dlConnactResponse.setYlqxzcrbarmc(device.getYlqxzcrbarmc());
|
||||
dlConnactResponses.add(dlConnactResponse);
|
||||
}
|
||||
}
|
||||
return ResultVOUtils.success(dlConnactResponses);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,324 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dao.udid.DevicedownloadMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.*;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.req.udid.*;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.PageSimpleResponse;
|
||||
import com.glxp.udidl.admin.res.udid.ProgressResponse;
|
||||
import com.glxp.udidl.admin.service.info.CompanyService;
|
||||
import com.glxp.udidl.admin.service.inout.DeviceService;
|
||||
import com.glxp.udidl.admin.service.inout.ProductInfoService;
|
||||
import com.glxp.udidl.admin.service.udi.UdiCompanyService;
|
||||
import com.glxp.udidl.admin.util.FilterUdiUtils;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 未转换国家库查询与下载
|
||||
*/
|
||||
@Api(tags = "未转换国家库查询与下载接口")
|
||||
@RestController
|
||||
public class DeviceController {
|
||||
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
@Resource
|
||||
private DevicedownloadMapper devicedownloadMapper;
|
||||
@Resource
|
||||
CompanyService companyService;
|
||||
@Resource
|
||||
ProductInfoService productInfoService;
|
||||
@Resource
|
||||
UdiCompanyService udiCompanyService;
|
||||
|
||||
@ApiOperation(value = "查询医疗器械信息", response = DeviceEntity.class)
|
||||
@AuthRuleAnnotation("warehouse/device/list")
|
||||
@GetMapping("warehouse/device/list")
|
||||
public BaseResponse listDevices(@Valid DeviceListRequest deviceListRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
String key = deviceListRequest.getKey();
|
||||
boolean isScan = false;
|
||||
if (key != null) {
|
||||
key = FilterUdiUtils.getDiStr(key);
|
||||
deviceListRequest.setKey(key);
|
||||
isScan = true;
|
||||
}
|
||||
List<DeviceEntity> medicalResonseList = deviceService.listDevices(deviceListRequest);
|
||||
long total = 0;
|
||||
PageInfo<DeviceEntity> pageInfo = new PageInfo<>(medicalResonseList);
|
||||
PageSimpleResponse<DeviceEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
List<Devicedownload> devicedownloads = devicedownloadMapper.selectByExample(new DevicedownloadExample());
|
||||
Devicedownload devicedownload;
|
||||
if (devicedownloads != null && devicedownloads.size() > 0) {
|
||||
devicedownload = devicedownloads.get(0);
|
||||
total = devicedownload.getAlltotal() - devicedownload.getAllindex();
|
||||
}
|
||||
if (isScan) {
|
||||
total = 20;
|
||||
pageSimpleResponse.setTotal(total);
|
||||
} else
|
||||
pageSimpleResponse.setTotal(total * 10);
|
||||
pageSimpleResponse.setList(medicalResonseList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据关键字查询医疗器械信息", response = DeviceEntity.class)
|
||||
@AuthRuleAnnotation("warehouse/device/search")
|
||||
@GetMapping("warehouse/device/search")
|
||||
public BaseResponse searchByKey(@Valid DeviceListRequest deviceListRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
String key = deviceListRequest.getKey();
|
||||
boolean isScan = false;
|
||||
if (key != null) {
|
||||
key = FilterUdiUtils.getDiStr(key);
|
||||
deviceListRequest.setKey(key);
|
||||
isScan = true;
|
||||
} else {
|
||||
|
||||
}
|
||||
DeviceSearchRequest deviceSearchRequest = new DeviceSearchRequest();
|
||||
deviceSearchRequest.setZxxsdycpbs(key);
|
||||
deviceSearchRequest.setPage(1);
|
||||
deviceSearchRequest.setLimit(50);
|
||||
List<DeviceEntity> devices = deviceService.search(deviceSearchRequest);
|
||||
if (key == null || key.equals("") || devices == null || devices.size() == 0) {
|
||||
devices = new ArrayList<>();
|
||||
devices.add(new DeviceEntity());
|
||||
}
|
||||
long total = 1;
|
||||
PageSimpleResponse<DeviceEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(total);
|
||||
List<DeviceEntity> deviceEntityList = new ArrayList<>();
|
||||
deviceEntityList.add(devices.get(devices.size() - 1));
|
||||
pageSimpleResponse.setList(deviceEntityList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据DI查询医疗器械信息", response = DeviceEntity.class)
|
||||
@AuthRuleAnnotation("warehouse/device/searchbydi")
|
||||
@GetMapping("warehouse/device/searchbydi")
|
||||
public BaseResponse searchByDi(@Valid DeviceListRequest deviceListRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
String key = deviceListRequest.getKey();
|
||||
Device device = deviceService.searchByZxxscpbs(key);
|
||||
long total = 1;
|
||||
DeviceEntity deviceEntity = new DeviceEntity();
|
||||
if (device != null)
|
||||
BeanUtils.copyProperties(device, deviceEntity);
|
||||
PageSimpleResponse<DeviceEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(total);
|
||||
List<DeviceEntity> deviceEntityList = new ArrayList<>();
|
||||
deviceEntityList.add(deviceEntity);
|
||||
pageSimpleResponse.setList(deviceEntityList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "",hidden = true)
|
||||
@GetMapping("warehouse/device/unionSearch")
|
||||
public BaseResponse search(@Valid DeviceSearchRequest deviceSearchRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
List<DeviceEntity> medicalResonseList = deviceService.search(deviceSearchRequest);
|
||||
long total = deviceService.seatchTotal(deviceSearchRequest);
|
||||
PageSimpleResponse<DeviceEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(total);
|
||||
pageSimpleResponse.setList(medicalResonseList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "",hidden = true)
|
||||
@GetMapping("warehouse/device/combineSearch")
|
||||
public BaseResponse combineSearch(@Valid DeviceSearchRequest deviceSearchRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
List<DeviceEntity> medicalResonseList = deviceService.search(deviceSearchRequest);
|
||||
|
||||
long total = 0;
|
||||
PageSimpleResponse<DeviceEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
List<Devicedownload> devicedownloads = devicedownloadMapper.selectByExample(new DevicedownloadExample());
|
||||
Devicedownload devicedownload;
|
||||
if (devicedownloads != null && devicedownloads.size() > 0) {
|
||||
devicedownload = devicedownloads.get(0);
|
||||
total = devicedownload.getAlltotal() - devicedownload.getAllindex();
|
||||
}
|
||||
|
||||
|
||||
pageSimpleResponse.setTotal(total * 10);
|
||||
pageSimpleResponse.setList(medicalResonseList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "",hidden = true)
|
||||
@PostMapping("warehouse/device/loadsingle")
|
||||
public BaseResponse downLoadDiii(@RequestBody DeviceDiRequest deviceRequest) {
|
||||
DownloadDeviceHelper downloadDeviceHelper = new DownloadDeviceHelper(companyService, udiCompanyService);
|
||||
if (deviceRequest.getPrimaryDeviceId() == null) {
|
||||
return ResultVOUtils.error(999, "最小销售单元标识不能为空");
|
||||
}
|
||||
new Thread(() -> {
|
||||
|
||||
TokenEntity token = downloadDeviceHelper.getToken();
|
||||
DownloadDiRequest downloadDiRequest1 = new DownloadDiRequest();
|
||||
downloadDiRequest1.setAccessToken(token.getAccessToken());
|
||||
downloadDiRequest1.setPrimaryDeviceId(deviceRequest.getPrimaryDeviceId());
|
||||
int result = downloadDeviceHelper.downloadBydi(downloadDiRequest1, deviceService, productInfoService);
|
||||
if (result == -1) {
|
||||
return;// ResultVOUtils.error(505, "下载出错");
|
||||
}
|
||||
|
||||
}).start();
|
||||
return ResultVOUtils.success("开始下载");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "",hidden = true)
|
||||
@PostMapping("warehouse/device/downLoadHisory")
|
||||
public BaseResponse downLoadHisory(@RequestBody DeviceDiRequest deviceRequest) {
|
||||
DownloadDeviceHelper downloadDeviceHelper = new DownloadDeviceHelper(companyService, udiCompanyService);
|
||||
if (deviceRequest.getPrimaryDeviceId() == null) {
|
||||
return ResultVOUtils.error(999, "最小销售单元标识不能为空");
|
||||
}
|
||||
new Thread(() -> {
|
||||
String deviceRecordKey = deviceService.selectKey(deviceRequest.getPrimaryDeviceId());
|
||||
TokenEntity token = downloadDeviceHelper.getToken();
|
||||
DownloadHistoryRequest deviceHistoryRequest = new DownloadHistoryRequest();
|
||||
deviceHistoryRequest.setAccessToken(token.getAccessToken());
|
||||
deviceHistoryRequest.setCurrentPageNumber("1");
|
||||
List<DownloadHistoryRequest.DataSetBean> dataSetBeans = new ArrayList<>();
|
||||
DownloadHistoryRequest.DataSetBean keys = new DownloadHistoryRequest.DataSetBean();
|
||||
keys.setDeviceRecordKey(deviceRecordKey);
|
||||
dataSetBeans.add(keys);
|
||||
deviceHistoryRequest.setDataSet(dataSetBeans);
|
||||
int result = downloadDeviceHelper.downloadHistory(productInfoService, deviceHistoryRequest, deviceService);
|
||||
if (result == -1) {
|
||||
return;// ResultVOUtils.error(505, "下载出错");
|
||||
}
|
||||
|
||||
}).start();
|
||||
return ResultVOUtils.success("开始下载");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "",hidden = true)
|
||||
@PostMapping("warehouse/device/loadudid")
|
||||
public BaseResponse downLoadAll(DownloadDeviceRequest downloadDeviceRequest, BindingResult bindingResult) {
|
||||
DownloadDeviceHelper downloadDeviceHelper = new DownloadDeviceHelper(companyService, udiCompanyService);
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
new Thread(() -> {
|
||||
|
||||
TokenEntity token = downloadDeviceHelper.getToken();
|
||||
int total = downloadDeviceHelper.getTotal(token.getAccessToken());
|
||||
int curpage = total;
|
||||
Devicedownload devicedownload = devicedownloadMapper.selectByPrimaryKey("udid");
|
||||
if (devicedownload != null) {
|
||||
int offset = devicedownload.getAlltotal() - devicedownload.getAllindex();
|
||||
curpage = total - offset;
|
||||
} else {
|
||||
devicedownload = new Devicedownload();
|
||||
devicedownload.setId("udid");
|
||||
devicedownload.setAlltotal(100);
|
||||
devicedownload.setAllindex(99);
|
||||
devicedownloadMapper.insert(devicedownload);
|
||||
}
|
||||
devicedownload.setIsdownload(1);
|
||||
long startTime = System.currentTimeMillis();
|
||||
devicedownload.setStarttime(startTime + "");
|
||||
devicedownloadMapper.updateByPrimaryKey(devicedownload);
|
||||
Devicedownload stop = devicedownloadMapper.selectByPrimaryKey("udid");
|
||||
|
||||
while (curpage > 0 && stop.getIsdownload() == 1 && stop.getStarttime().equals(startTime + "")) {
|
||||
|
||||
DeviceRequest deviceRequest = new DeviceRequest();
|
||||
deviceRequest.setAccessToken(token.getAccessToken());
|
||||
deviceRequest.setRequestType(3 + "");
|
||||
deviceRequest.setCurrentPageNumber(curpage + "");
|
||||
int result = downloadDeviceHelper.downloadDevices(productInfoService, deviceService, deviceRequest);
|
||||
if (result == -1) {
|
||||
return;// ResultVOUtils.error(505, "下载出错");
|
||||
}
|
||||
curpage--;
|
||||
Devicedownload devicedownload1 = new Devicedownload();
|
||||
devicedownload1.setAlltotal(total);
|
||||
devicedownload1.setAllindex(curpage);
|
||||
devicedownload1.setId("udid");
|
||||
devicedownloadMapper.updateProgress(devicedownload1);
|
||||
stop = devicedownloadMapper.selectByPrimaryKey("udid");
|
||||
}
|
||||
}).start();
|
||||
return ResultVOUtils.success("开始下载");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "",hidden = true)
|
||||
@GetMapping("warehouse/device/stop")
|
||||
public BaseResponse stopDown() {
|
||||
Devicedownload devicedownload = devicedownloadMapper.selectByPrimaryKey("udid");
|
||||
devicedownload.setIsdownload(2);
|
||||
devicedownloadMapper.updateByPrimaryKey(devicedownload);
|
||||
return ResultVOUtils.success("停止成功");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "",hidden = true)
|
||||
@GetMapping("warehouse/device/progress")
|
||||
public BaseResponse getProgress() {
|
||||
Devicedownload devicedownload = devicedownloadMapper.selectByPrimaryKey("udid");
|
||||
ProgressResponse response = new ProgressResponse();
|
||||
if (devicedownload != null) {
|
||||
double index = devicedownload.getAlltotal() - devicedownload.getAllindex();
|
||||
double total = devicedownload.getAlltotal();
|
||||
double progress = 0;
|
||||
if (total > 0) {
|
||||
progress = index / total;
|
||||
}
|
||||
response.setTotal(total * 10);
|
||||
response.setIndex(index * 10);
|
||||
response.setProgress(progress * 100);
|
||||
} else {
|
||||
response.setTotal(100);
|
||||
response.setIndex(1);
|
||||
response.setProgress(1);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success(response);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.info.FileInfoEntity;
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.dataSync.ProductInfoDlService;
|
||||
import com.glxp.udidl.admin.service.info.FileInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
|
||||
@Api(tags = "国家同步库文件信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/file")
|
||||
public class FileInfoController {
|
||||
|
||||
@Autowired
|
||||
FileInfoService fileInfoService;
|
||||
@Autowired
|
||||
ProductInfoDlService productInfoDlService;
|
||||
|
||||
@ApiOperation(value = "查询国家同步库同步文件列表", response = FileInfoEntity.class)
|
||||
@AuthRuleAnnotation("file/getlist")
|
||||
@PostMapping("/getlist")
|
||||
public BaseResponse getList(@RequestBody ListPageRequest param) {
|
||||
return fileInfoService.getList(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载国家同步库数据")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "startDate", value = "开始时间"), @ApiImplicitParam(name = "endDate", value = "结束时间")})
|
||||
@AuthRuleAnnotation("file/exportToFile")
|
||||
@PostMapping("/exportToFile")
|
||||
public BaseResponse exportToFile(@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
||||
return productInfoDlService.ExportToFile(startDate, endDate, "manual");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载文件")
|
||||
@ApiImplicitParam(name = "fileName", value = "文件名")
|
||||
@AuthRuleAnnotation("file/getFile")
|
||||
@GetMapping("/getFile")
|
||||
public void getFile(HttpServletResponse response, String fileName) {
|
||||
fileInfoService.getFile(response, fileName);
|
||||
}
|
||||
}
|
@ -0,0 +1,238 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.PageSimpleResponse;
|
||||
import com.glxp.udidl.admin.res.PosTaggerResponse;
|
||||
import com.glxp.udidl.admin.service.inout.ProductInfoService;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 赋码系统API
|
||||
*/
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class PosTaggerController {
|
||||
|
||||
@Resource
|
||||
ProductInfoService productInfoService;
|
||||
|
||||
@AuthRuleAnnotation("udi/company/findByCreditNo")
|
||||
@GetMapping("udi/company/findByCreditNo")
|
||||
public BaseResponse findByCreditNo(ProductInfoFilterRequest productInfoFilterRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (productInfoFilterRequest.getTyshxydm() == null) {
|
||||
return ResultVOUtils.error(510, "通用社会信用代码不能为空");
|
||||
}
|
||||
List<ProductInfoEntity> productInfoEntities = productInfoService.filterUdiByCreditNo(productInfoFilterRequest);
|
||||
|
||||
PageInfo<ProductInfoEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(productInfoEntities);
|
||||
PageSimpleResponse<ProductInfoEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(productInfoEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("udi/company/findCoName")
|
||||
@GetMapping("udi/company/findCoName")
|
||||
public BaseResponse findCoName(ProductInfoFilterRequest productInfoFilterRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (productInfoFilterRequest.getTyshxydm() == null) {
|
||||
return ResultVOUtils.error(510, "通用社会信用代码不能为空");
|
||||
}
|
||||
List<String> names = new ArrayList<>();
|
||||
List<ProductInfoEntity> productInfoEntities = productInfoService.filterCpmctymc(productInfoFilterRequest);
|
||||
if (productInfoEntities != null && productInfoEntities.size() > 0) {
|
||||
|
||||
for (ProductInfoEntity productInfoEntity : productInfoEntities) {
|
||||
names.add(productInfoEntity.getCpmctymc());
|
||||
}
|
||||
}
|
||||
PageInfo<String> pageInfo;
|
||||
pageInfo = new PageInfo<>(names);
|
||||
PageSimpleResponse<String> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(names);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("udi/company/findTreeData")
|
||||
@GetMapping("udi/company/findTreeData")
|
||||
public BaseResponse findTreeData(ProductInfoFilterRequest productInfoFilterRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (productInfoFilterRequest.getTyshxydm() == null || productInfoFilterRequest.getCpmctymc() == null) {
|
||||
return ResultVOUtils.error(510, "通用社会信用代码与产品用于名称不能为空");
|
||||
}
|
||||
List<ProductInfoEntity> productInfoEntities = productInfoService.findAllByUuid(productInfoFilterRequest);
|
||||
List<PosTaggerResponse> posTaggerResponses = new ArrayList<>();
|
||||
if (productInfoEntities != null && productInfoEntities.size() > 0) {
|
||||
posTaggerResponses = transferTreeData(productInfoEntities);
|
||||
}
|
||||
PageInfo<PosTaggerResponse> pageInfo;
|
||||
pageInfo = new PageInfo<>(posTaggerResponses);
|
||||
PageSimpleResponse<PosTaggerResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(posTaggerResponses);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
public List<PosTaggerResponse> transferTreeData(List<ProductInfoEntity> productInfoEntities) {
|
||||
List<PosTaggerResponse> posTaggerResponses = new ArrayList<>();
|
||||
//产品名称按UUID分组
|
||||
Map<String, List<ProductInfoEntity>> cpmcMaps = productInfoEntities.stream().collect(Collectors.groupingBy(ProductInfoEntity::getUuid));
|
||||
for (List<ProductInfoEntity> uuidList : cpmcMaps.values()) {
|
||||
PosTaggerResponse ggxhBean = new PosTaggerResponse();
|
||||
List<ProductInfoEntity> ratioList = getPackRatio(uuidList);
|
||||
List<PosTaggerResponse.UdiInfoBean> udiInfoBeans = new ArrayList<>();
|
||||
for (ProductInfoEntity uuidEntity : ratioList) {
|
||||
ggxhBean.setCphhhbh(uuidEntity.getCphhhbh());
|
||||
ggxhBean.setCplb(uuidEntity.getCplb());
|
||||
ggxhBean.setCpms(uuidEntity.getCpms());
|
||||
ggxhBean.setFlbm(uuidEntity.getFlbm());
|
||||
ggxhBean.setGgxh(uuidEntity.getGgxh());
|
||||
ggxhBean.setQxlb(uuidEntity.getQxlb());
|
||||
ggxhBean.setScbssfbhph(uuidEntity.getScbssfbhph());
|
||||
ggxhBean.setScbssfbhscrq(uuidEntity.getScbssfbhscrq());
|
||||
ggxhBean.setScbssfbhsxrq(uuidEntity.getScbssfbhsxrq());
|
||||
ggxhBean.setScbssfbhxlh(uuidEntity.getScbssfbhxlh());
|
||||
ggxhBean.setSpmc(uuidEntity.getSpmc());
|
||||
ggxhBean.setYbbm(uuidEntity.getYbbm());
|
||||
ggxhBean.setYlqxzcrbarmc(uuidEntity.getYlqxzcrbarmc());
|
||||
ggxhBean.setYlqxzcrbarywmc(uuidEntity.getYlqxzcrbarywmc());
|
||||
ggxhBean.setZczbhhzbapzbh(uuidEntity.getZczbhhzbapzbh());
|
||||
ggxhBean.setVersionNumber(uuidEntity.getVersionNumber());
|
||||
|
||||
PosTaggerResponse.UdiInfoBean udiInfoBean = new PosTaggerResponse.UdiInfoBean();
|
||||
udiInfoBean.setBhxjcpbm(uuidEntity.getBhxjcpbm());
|
||||
udiInfoBean.setBhxjsl(uuidEntity.getBhxjsl());
|
||||
udiInfoBean.setBhzxxsbzsl(uuidEntity.getBhzxxsbzsl());
|
||||
if (uuidEntity.getDiType() == 1) {
|
||||
udiInfoBean.setBzcj("主标识");
|
||||
} else if (uuidEntity.getDiType() == 2 || uuidEntity.getDiType() == 3) {
|
||||
udiInfoBean.setBzcj("虚标识");
|
||||
} else {
|
||||
udiInfoBean.setBzcj(uuidEntity.getBzcj());
|
||||
}
|
||||
|
||||
udiInfoBean.setDiType(uuidEntity.getDiType());
|
||||
udiInfoBean.setNameCode(uuidEntity.getNameCode());
|
||||
udiInfoBean.setPackLevel(uuidEntity.getPackLevel());
|
||||
udiInfoBean.setPackRatio(uuidEntity.getPackRatio());
|
||||
udiInfoBean.setSjcpbm(uuidEntity.getSjcpbm());
|
||||
udiInfoBean.setZxxsbzbhsydysl(uuidEntity.getZxxsbzbhsydysl());
|
||||
udiInfoBeans.add(udiInfoBean);
|
||||
}
|
||||
ggxhBean.setUdiInfoBeans(udiInfoBeans);
|
||||
posTaggerResponses.add(ggxhBean);
|
||||
}
|
||||
return posTaggerResponses;
|
||||
}
|
||||
|
||||
|
||||
//包装比例
|
||||
public List<ProductInfoEntity> getPackRatio(List<ProductInfoEntity> uuidList) {
|
||||
if (uuidList != null && uuidList.size() > 0) {
|
||||
List<ProductInfoEntity> tops = getTop(uuidList);
|
||||
List<ProductInfoEntity> resultEntitys = new ArrayList<>();
|
||||
for (int i = 0; i < tops.size(); i++) {
|
||||
List<ProductInfoEntity> countEntitys = new ArrayList<>();
|
||||
ProductInfoEntity topEntity = tops.get(i);
|
||||
countEntitys.add(topEntity);
|
||||
List<Integer> nextArray = new ArrayList<>();
|
||||
nextArray.add(1);
|
||||
while (true) {
|
||||
ProductInfoEntity nextEntity = getNext(topEntity, uuidList);
|
||||
if (nextEntity != null) {
|
||||
int currentCount = 1;
|
||||
for (Integer count : nextArray) {
|
||||
currentCount = currentCount * count;
|
||||
}
|
||||
currentCount = currentCount * topEntity.getBhxjsl();
|
||||
nextArray.add(currentCount);
|
||||
topEntity = nextEntity;
|
||||
countEntitys.add(nextEntity);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
String packRatio = "";
|
||||
for (Integer ratio : nextArray) {
|
||||
packRatio = packRatio + ":" + ratio;
|
||||
}
|
||||
packRatio = packRatio.substring(1);
|
||||
for (ProductInfoEntity countEntity : countEntitys) {
|
||||
countEntity.setPackRatio(packRatio);
|
||||
}
|
||||
resultEntitys.addAll(countEntitys);
|
||||
}
|
||||
return resultEntitys;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
public ProductInfoEntity getNext(ProductInfoEntity current, List<ProductInfoEntity> uuidList) {
|
||||
for (int i = 0; i < uuidList.size(); i++) {
|
||||
ProductInfoEntity productInfoEntity = uuidList.get(i);
|
||||
ProductInfoEntity clone = new ProductInfoEntity();
|
||||
if (current.getBhxjcpbm().equals(productInfoEntity.getNameCode())) {
|
||||
BeanUtils.copyProperties(productInfoEntity, clone);
|
||||
return clone;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<ProductInfoEntity> getTop(List<ProductInfoEntity> uuidList) {
|
||||
List<ProductInfoEntity> tops = new ArrayList<>();
|
||||
if (uuidList != null && uuidList.size() > 0) {
|
||||
for (int i = 0; i < uuidList.size(); i++) {
|
||||
ProductInfoEntity productInfoEntity = uuidList.get(i);
|
||||
if (productInfoEntity.getSjcpbm() == null || productInfoEntity.getSjcpbm().equals("")) {
|
||||
tops.add(productInfoEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tops;
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("udi/company/findByUuid")
|
||||
@GetMapping("udi/company/findByUuid")
|
||||
public BaseResponse findByDi(ProductInfoFilterRequest productInfoFilterRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (productInfoFilterRequest.getUuid() != null || productInfoFilterRequest.getNameCode() != null) {
|
||||
List<ProductInfoEntity> productInfoEntities = productInfoService.filterUdiByCreditNo(productInfoFilterRequest);
|
||||
PageInfo<ProductInfoEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(productInfoEntities);
|
||||
PageSimpleResponse<ProductInfoEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(productInfoEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
} else
|
||||
return ResultVOUtils.error(510, "最小销售产品标识不能为空");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.glxp.udidl.admin.thread.UdiCompanyTask;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
//udi更新
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class TestCompanyUdiController {
|
||||
|
||||
@Resource
|
||||
private UdiCompanyTask udiCompanyService;
|
||||
|
||||
@GetMapping("udidl/udi/transferAll")
|
||||
public void transferAll() {
|
||||
udiCompanyService.transAll();
|
||||
}
|
||||
|
||||
|
||||
//新增版本记录 转换
|
||||
@GetMapping("udidl/udi/isNewest")
|
||||
public void transferIsNewest() {
|
||||
udiCompanyService.transNewest();
|
||||
}
|
||||
|
||||
@GetMapping("udidl/udi/isNewesttyshxyh")
|
||||
public void transferIsNewesttyshxyh(String tyshxyh) {
|
||||
udiCompanyService.transNewestByTyshxy(tyshxyh);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.glxp.udidl.admin.dao.udi.ProductInfoMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.Device;
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.dataSync.DeviceSyncService;
|
||||
import com.glxp.udidl.admin.service.dataSync.UdplatDownloadService;
|
||||
import com.glxp.udidl.admin.service.dataSync.UdplatSyncService;
|
||||
import com.glxp.udidl.admin.service.inout.DeviceService;
|
||||
import com.glxp.udidl.admin.service.inout.ProductInfoService;
|
||||
import com.glxp.udidl.admin.service.udi.UdiCompanyService;
|
||||
import com.glxp.udidl.admin.thread.AsyncDownloadTask;
|
||||
import com.glxp.udidl.admin.thread.UdiTransferUtils;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class TestController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TestController.class);
|
||||
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
@Resource
|
||||
private ProductInfoService productInfoService;
|
||||
@Resource
|
||||
AsyncDownloadTask asyncDownloadTask;
|
||||
@Resource
|
||||
ProductInfoMapper productInfoDao;
|
||||
@Resource
|
||||
UdiCompanyService udiCompanyService;
|
||||
@Autowired
|
||||
DeviceSyncService deviceSyncService;
|
||||
@Autowired
|
||||
UdplatDownloadService udplatDownloadService;
|
||||
@Autowired
|
||||
UdplatSyncService udplatSyncService;
|
||||
|
||||
@GetMapping("udidl/device/transfer")
|
||||
public void transfer() {
|
||||
List<String> keys = deviceService.findAllByZxxscpbs();
|
||||
for (String key : keys) {
|
||||
new UdiTransferUtils().transUdi(deviceService, productInfoService, key, udiCompanyService);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("udidl/device/updateProduct")
|
||||
public BaseResponse updateProduct(ListPageRequest listPageRequest) {
|
||||
List<String> keys = productInfoDao.findAllUuids(listPageRequest);
|
||||
int index = listPageRequest.getPage();
|
||||
for (String key : keys) {
|
||||
index++;
|
||||
new UdiTransferUtils().updateUdi(deviceService, productInfoService, key);
|
||||
logger.info(listPageRequest.getPage() + "---" + listPageRequest.getLimit() + "----" + index);
|
||||
}
|
||||
return ResultVOUtils.success("总数=" + keys.size() + "\n");
|
||||
}
|
||||
|
||||
@GetMapping("udidl/device/transferByPage")
|
||||
public BaseResponse transferByPage(ListPageRequest listPageRequest) {
|
||||
List<String> keys = deviceService.findAllByZxxscpbsPage(listPageRequest);
|
||||
for (String key : keys) {
|
||||
new UdiTransferUtils().transUdi(deviceService, productInfoService, key, udiCompanyService);
|
||||
}
|
||||
return ResultVOUtils.success("总数=" + keys.size() + "\n");
|
||||
}
|
||||
|
||||
@GetMapping("udidl/device/transferByDi")
|
||||
public void transferByDi(@RequestParam List<String> keys) {
|
||||
if (keys != null) {
|
||||
for (String key : keys) {
|
||||
Device device = deviceService.searchByZxxscpbs(key);
|
||||
if (device != null)
|
||||
new UdiTransferUtils().transUdi(deviceService, productInfoService, device.getUuid(), udiCompanyService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//https://www.udims.com/UDI_DL_Server/udidl/device/dlBymonth?month=2021-10&page=1
|
||||
@GetMapping("udidl/device/dlBymonth")
|
||||
public void dlBymonth(String month, int page) {
|
||||
logger.info(month + "---按月开启下载");
|
||||
asyncDownloadTask.downloadByMonth(month, page);
|
||||
}
|
||||
|
||||
@GetMapping("/test/getDistributor")
|
||||
public String udplatTest() {
|
||||
return udplatDownloadService.getDistributor();
|
||||
}
|
||||
|
||||
@GetMapping("/test/getManufactures")
|
||||
public BaseResponse getManufactures() {
|
||||
return udplatDownloadService.getAllManufactures();
|
||||
}
|
||||
|
||||
@GetMapping("/test/udplat")
|
||||
public BaseResponse udplatSync() {
|
||||
udplatSyncService.downloadAndSave("manual", "");
|
||||
return ResultVOUtils.success("后台已开始下载!");
|
||||
}
|
||||
|
||||
@GetMapping("/test/udplatGoods")
|
||||
public ResponseEntity<String> getGoods() {
|
||||
return udplatDownloadService.getUdplatGoods(1, 100);
|
||||
}
|
||||
|
||||
@GetMapping("/test/getPurchaseOrders")
|
||||
public ResponseEntity<String> getPurchaseOrders(String orderCode) {
|
||||
return udplatDownloadService.getPurchaseOrders(orderCode);
|
||||
}
|
||||
|
||||
@GetMapping("/test/getPurchaseOrderDetals")
|
||||
public ResponseEntity<String> getPurchaseOrderDetals(Long orderId) {
|
||||
return udplatDownloadService.getPurchaseOrderDetals(orderId);
|
||||
}
|
||||
|
||||
@GetMapping("/test/getDistributeOrderDetails")
|
||||
public JSONObject getDistributeOrderDetails(Long orderId) {
|
||||
return udplatDownloadService.getDistributeOrderDetails(orderId);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
|
||||
import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.inout.ProductInfoService;
|
||||
import com.glxp.udidl.admin.thread.AsyncDownloadTask;
|
||||
import com.glxp.udidl.admin.util.FilterUdiUtils;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
//协调平台API
|
||||
@Api(tags = "协调平台接口")
|
||||
@RestController
|
||||
public class UdiCooperController {
|
||||
|
||||
@Resource
|
||||
ProductInfoService productInfoService;
|
||||
|
||||
@Resource
|
||||
AsyncDownloadTask asyncDownloadTask;
|
||||
|
||||
@ApiOperation(value = "根据DI查询产品信息", response = ProductInfoEntity.class)
|
||||
@AuthRuleAnnotation("udidl/cooper/findBydi")
|
||||
@GetMapping("udidl/cooper/findBydi")
|
||||
public BaseResponse findProductInfo(ProductInfoFilterRequest productInfoFilterRequest) {
|
||||
|
||||
String key = productInfoFilterRequest.getNameCode();
|
||||
if (key != null) {
|
||||
key = FilterUdiUtils.getDiStr(key);
|
||||
productInfoFilterRequest.setNameCode(key);
|
||||
} else {
|
||||
return ResultVOUtils.error(500, "产品条码不能为空!");
|
||||
}
|
||||
List<ProductInfoEntity> productInfoEntityList = productInfoService.findAll(productInfoFilterRequest);
|
||||
if (productInfoEntityList != null && productInfoEntityList.size() > 0) {
|
||||
ProductInfoEntity productInfoEntity = productInfoEntityList.get(productInfoEntityList.size() - 1);
|
||||
return ResultVOUtils.success(productInfoEntity);
|
||||
} else {
|
||||
asyncDownloadTask.downloadByDi(key); //后台自动下载
|
||||
return ResultVOUtils.error(500, "未找到产品信息,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.udid.*;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.req.DownloadUdiRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.inout.UdiDownloadService;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
//外网全量下载api
|
||||
@Api(tags = "外网全量下载医疗器械信息接口")
|
||||
@RestController
|
||||
public class UdiDownloadController {
|
||||
|
||||
@Resource
|
||||
private UdiDownloadService udiDownloadService;
|
||||
|
||||
@ApiOperation(value = "下载医疗器械信息", response = Device.class)
|
||||
@AuthRuleAnnotation("udi/download/device")
|
||||
@GetMapping("udi/download/device")
|
||||
public BaseResponse downloadDevice(@Valid DownloadUdiRequest downloadUdiRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<Device> deviceList = udiDownloadService.downloadDevice(downloadUdiRequest);
|
||||
return ResultVOUtils.success(deviceList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载医疗器械联系人信息", response = Contactlist.class)
|
||||
@AuthRuleAnnotation("udi/download/contactlist")
|
||||
@GetMapping("udi/download/contactlist")
|
||||
public BaseResponse downloadContactlist(@Valid DownloadUdiRequest downloadUdiRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<Contactlist> deviceList = udiDownloadService.downloadContactlist(downloadUdiRequest);
|
||||
return ResultVOUtils.success(deviceList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载临床器械信息", response = Deviceclinical.class)
|
||||
@AuthRuleAnnotation("udi/download/deviceclinical")
|
||||
@GetMapping("udi/download/deviceclinical")
|
||||
public BaseResponse downloadDeviceclinical(@Valid DownloadUdiRequest downloadUdiRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<Deviceclinical> deviceList = udiDownloadService.downloadDeviceclinical(downloadUdiRequest);
|
||||
return ResultVOUtils.success(deviceList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载医疗器械包装信息", response = Devicepackage.class)
|
||||
@AuthRuleAnnotation("udidl_udiDownload_all")
|
||||
@GetMapping("udi/download/devicepackage")
|
||||
public BaseResponse downloadDevicepackage(@Valid DownloadUdiRequest downloadUdiRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<Devicepackage> deviceList = udiDownloadService.downloadDevicepackage(downloadUdiRequest);
|
||||
return ResultVOUtils.success(deviceList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载医疗器械存储信息", response = Devicestorage.class)
|
||||
@AuthRuleAnnotation("udi/download/devicestorage")
|
||||
@GetMapping("udi/download/devicestorage")
|
||||
public BaseResponse downloadDevicestorage(@Valid DownloadUdiRequest downloadUdiRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<Devicestorage> deviceList = udiDownloadService.downloadDevicestorage(downloadUdiRequest);
|
||||
return ResultVOUtils.success(deviceList);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.glxp.udidl.admin.controller.device;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.udid.DeviceEntity;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.udid.DataSetSingleHistoryResult;
|
||||
import com.glxp.udidl.admin.service.dataSync.DeviceSyncService;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Api(tags = "下载医疗器械信息接口")
|
||||
@RestController
|
||||
public class UdidlDeviceController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UdidlDeviceController.class);
|
||||
|
||||
@Autowired
|
||||
DeviceSyncService deviceSyncService;
|
||||
|
||||
@ApiOperation(value = "按日期段下载医疗器械信息")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "startDate", value = "开始时间", required = true, dataType = "Date"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", required = true, dataType = "Date")})
|
||||
@AuthRuleAnnotation("udidl/device/dlByDays")
|
||||
@GetMapping("udidl/device/dlByDays")
|
||||
public BaseResponse dlByDays(@DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
|
||||
logger.info("---按日期段下载");
|
||||
deviceSyncService.downloadUdi(startDate, endDate);
|
||||
return ResultVOUtils.success("后台已开始下载!");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "按天下载医疗器械信息")
|
||||
@ApiImplicitParam(name = "day", value = "指定日期", required = true, dataType = "String")
|
||||
@AuthRuleAnnotation("udidl/device/dlByDay")
|
||||
@GetMapping("udidl/device/dlByDay")
|
||||
public BaseResponse dlByDay(String day) {
|
||||
logger.info(day + "---按天开启下载");
|
||||
deviceSyncService.downloadUdi(day, "manual");
|
||||
return ResultVOUtils.success("后台已开始下载!");
|
||||
}
|
||||
|
||||
//todo 补全返回参数说明
|
||||
@ApiOperation(value = "下载指定标识的设备信息", response = DataSetSingleHistoryResult.class)
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataType = "String")
|
||||
@AuthRuleAnnotation("udidl/device/dlByDi")
|
||||
@PostMapping("udidl/device/dlByDi")
|
||||
public BaseResponse downloadByDi(String deviceId) {
|
||||
return deviceSyncService.downloadByDi(deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品标识详情
|
||||
*
|
||||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "下载单个产品详情", response = DeviceEntity.class)
|
||||
@ApiImplicitParam(name = "deviceId", value = "医疗器械设备ID", required = true, dataType = "String")
|
||||
@AuthRuleAnnotation("udidl/device/downloadSingle")
|
||||
@PostMapping("udidl/device/downloadSingle")
|
||||
public BaseResponse downloadSingle(String deviceId) {
|
||||
return deviceSyncService.downloadSingle(deviceId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载产品历史信息", response = DeviceEntity.class)
|
||||
@ApiImplicitParam(name = "key", value = "关键字")
|
||||
@AuthRuleAnnotation("udidl/device/downloadHistory")
|
||||
@PostMapping("udidl/device/downloadHistory")
|
||||
public BaseResponse downloadHistory(String key) {
|
||||
return deviceSyncService.downloadHistory(key);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.udidl.admin.controller.info;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.udid.JobLog;
|
||||
import com.glxp.udidl.admin.req.udid.JobLogFilterRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.udi.JobLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "任务日志接口")
|
||||
@RestController
|
||||
@RequestMapping("/jobLog")
|
||||
public class JobLogController {
|
||||
|
||||
@Autowired
|
||||
JobLogService jobLogService;
|
||||
|
||||
@ApiOperation(value = "UDI日志信息", response = JobLog.class)
|
||||
@AuthRuleAnnotation("jobLog/list")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody JobLogFilterRequest jobLogFilterRequest) {
|
||||
return jobLogService.getList(jobLogFilterRequest);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.glxp.udidl.admin.controller.sys;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.sys.SysMenuModel;
|
||||
import com.glxp.udidl.admin.req.sys.SysMenuRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.sys.SysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
@RequestMapping("sys/menu")
|
||||
public class SysMenuController {
|
||||
|
||||
@Autowired
|
||||
SysMenuService sysMenuService;
|
||||
|
||||
@AuthRuleAnnotation("sys_menu_all")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody SysMenuRequest sysMenuRequest) {
|
||||
return sysMenuService.getList(sysMenuRequest);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_menu_all")
|
||||
@PostMapping("/insert")
|
||||
public BaseResponse insert(@RequestBody SysMenuModel model) {
|
||||
return sysMenuService.insert(model);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_menu_all")
|
||||
@PostMapping("update")
|
||||
public BaseResponse update(@RequestBody SysMenuModel model) {
|
||||
return sysMenuService.update(model);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_menu_all")
|
||||
@PostMapping("/detail")
|
||||
public BaseResponse detail(Integer id) {
|
||||
return sysMenuService.detail(id);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_menu_all")
|
||||
@PostMapping("/delete")
|
||||
public BaseResponse delete(Integer id) {
|
||||
return sysMenuService.delete(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.glxp.udidl.admin.controller.sys;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.sys.SysRoleMenuModel;
|
||||
import com.glxp.udidl.admin.dto.sys.SysRoleModel;
|
||||
import com.glxp.udidl.admin.dto.sys.SysRoleParam;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.sys.SysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
@RequestMapping("sys/role")
|
||||
public class SysRoleController {
|
||||
|
||||
@Autowired
|
||||
SysRoleService sysRoleService;
|
||||
|
||||
@AuthRuleAnnotation("sys_role_all")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody SysRoleParam param) {
|
||||
return sysRoleService.list(param);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_role_all")
|
||||
@PostMapping("/insert")
|
||||
public BaseResponse insert(@RequestBody SysRoleModel model) {
|
||||
return sysRoleService.insert(model);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_role_all")
|
||||
@PostMapping("update")
|
||||
public BaseResponse update(@RequestBody SysRoleModel model) {
|
||||
return sysRoleService.update(model);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_role_all")
|
||||
@PostMapping("/detail")
|
||||
public BaseResponse detail(Integer id) {
|
||||
return sysRoleService.detail(id);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_role_all")
|
||||
@PostMapping("/delete")
|
||||
public BaseResponse delete(Integer id) {
|
||||
return sysRoleService.delete(id);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_role_all")
|
||||
@PostMapping("/getRoleMenu")
|
||||
public BaseResponse getRoleMenu(Integer roleId) {
|
||||
return sysRoleService.getRoleMenu(roleId);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_role_all")
|
||||
@PostMapping("/saveRoleMenu")
|
||||
public BaseResponse saveRoleMenu(@RequestBody SysRoleMenuModel model) {
|
||||
return sysRoleService.saveRoleMenu(model);
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.glxp.udidl.admin.controller.sys;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.sys.SysUserModel;
|
||||
import com.glxp.udidl.admin.dto.sys.SysUserParam;
|
||||
import com.glxp.udidl.admin.enums.ResultEnum;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.sys.SysUserService;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
@RequestMapping("sys/user")
|
||||
public class SysUserController {
|
||||
|
||||
@Autowired
|
||||
SysUserService sysUserService;
|
||||
|
||||
@AuthRuleAnnotation("sys_user_all")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody SysUserParam param) {
|
||||
return sysUserService.list(param);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_user_all")
|
||||
@PostMapping("/insert")
|
||||
public BaseResponse insert(@RequestBody SysUserModel model) {
|
||||
if (StrUtil.isBlank(model.getAppId()) || StrUtil.isBlank(model.getAppSecret())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return sysUserService.insert(model);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_user_all")
|
||||
@PostMapping("update")
|
||||
public BaseResponse update(@RequestBody SysUserModel model) {
|
||||
return sysUserService.update(model);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_user_all")
|
||||
@PostMapping("/detail")
|
||||
public BaseResponse detail(Integer id) {
|
||||
return sysUserService.detail(id);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("sys_user_all")
|
||||
@PostMapping("/delete")
|
||||
public BaseResponse delete(Integer id) {
|
||||
return sysUserService.delete(id);
|
||||
}
|
||||
|
||||
@GetMapping("/generateSecret")
|
||||
public BaseResponse generateSecret() {
|
||||
return ResultVOUtils.success(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.glxp.udidl.admin.controller.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.udplat.ProductParam;
|
||||
import com.glxp.udidl.admin.dto.udplat.UnitsListModel;
|
||||
import com.glxp.udidl.admin.dto.udplat.UnitsParam;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.res.PageSimpleResponse;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatDistributorService;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatGoodsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "第三方接口")
|
||||
@RestController
|
||||
public class ThirdApiController {
|
||||
|
||||
@Autowired
|
||||
UdplatDistributorService udplatDistributorService;
|
||||
@Autowired
|
||||
UdplatGoodsService udplatGoodsService;
|
||||
|
||||
@ApiOperation("获取往来单位信息")
|
||||
@AuthRuleAnnotation("udiwms/erp/getUnits")
|
||||
@PostMapping("/udiwms/erp/getUnits")
|
||||
public BaseResponse<PageSimpleResponse<UnitsListModel>> getUnitsList(@RequestBody UnitsParam param) {
|
||||
return udplatDistributorService.getUnitsList(param);
|
||||
}
|
||||
|
||||
@ApiOperation("获取产品信息")
|
||||
@AuthRuleAnnotation("udiwms/erp/getProducts")
|
||||
@PostMapping("/udiwms/erp/getProducts")
|
||||
public BaseResponse getProducts(@RequestBody ProductParam param) {
|
||||
return udplatGoodsService.getProducts(param);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.glxp.udidl.admin.controller.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.udplat.BaseParam;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatDistributorModel;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatDistributor;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatDistributorService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配送企业
|
||||
*/
|
||||
@Api(tags = "阳光采购平台配送企业信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/udplat/distributor")
|
||||
public class UdplatDistributorController {
|
||||
|
||||
@Autowired
|
||||
private UdplatDistributorService udplatDistributorService;
|
||||
|
||||
@ApiOperation(value = "查询配送企业信息", response = UdplatDistributor.class)
|
||||
@AuthRuleAnnotation("udplat/distributor/list")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody BaseParam param) {
|
||||
return udplatDistributorService.getList(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入配送企业信息")
|
||||
@AuthRuleAnnotation("udplat/distributor/import")
|
||||
@PostMapping("/import")
|
||||
public BaseResponse imports(@RequestBody List<UdplatDistributorModel> models) {
|
||||
return udplatDistributorService.save(models, "import");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出配送企业信息")
|
||||
@AuthRuleAnnotation("udplat/distributor/export")
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response) {
|
||||
udplatDistributorService.exportToFile(response);
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.glxp.udidl.admin.controller.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.udplat.DeliveryGoods;
|
||||
import com.glxp.udidl.admin.dto.udplat.HospitalGoods;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsParam;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatGoods;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatGoodsService;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 目录清单
|
||||
*/
|
||||
@Api(tags = "阳光采购平台产品信息接口")
|
||||
@RestController
|
||||
@RequestMapping("udplat/goods")
|
||||
public class UdplatGoodsController {
|
||||
|
||||
@Autowired
|
||||
private UdplatGoodsService udplatGoodsService;
|
||||
|
||||
@ApiOperation(value = "查询产品信息", response = UdplatGoods.class)
|
||||
@AuthRuleAnnotation("udplat/goods/list")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody UdplatGoodsParam param) {
|
||||
return udplatGoodsService.getList(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "Excel文件批量导入")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "file", value = "excel文件"), @ApiImplicitParam(name = "type", value = "类型")})
|
||||
@AuthRuleAnnotation("udplat/goods/import")
|
||||
@PostMapping("/import")
|
||||
public BaseResponse importExcel(MultipartFile file, int type) {
|
||||
try {
|
||||
return udplatGoodsService.importExcel(file.getInputStream(), type);
|
||||
} catch (Exception e) {
|
||||
return ResultVOUtils.error(-1, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入产品信息")
|
||||
@AuthRuleAnnotation("udplat/goods/inportHospitalGoods")
|
||||
@PostMapping("/inportHospitalGoods")
|
||||
public BaseResponse importHospitalGoods(@RequestBody List<HospitalGoods> list) {
|
||||
return udplatGoodsService.importHospitalGoods(list);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("udplat/goods/importDeliveryGoods")
|
||||
@PostMapping("/importDeliveryGoods")
|
||||
public BaseResponse importDeliveryGoods(@RequestBody List<DeliveryGoods> list) {
|
||||
return udplatGoodsService.importDeliveryGoods(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出产品信息")
|
||||
@AuthRuleAnnotation("udplat/goods/export")
|
||||
@PostMapping("/export")
|
||||
public BaseResponse exportToFile(@RequestBody UdplatGoodsParam param) {
|
||||
return udplatGoodsService.exportToFile(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询单个产品信息", response = UdplatGoods.class)
|
||||
@ApiImplicitParam(name = "id", value = "产品id", required = true, dataType = "Integer")
|
||||
@AuthRuleAnnotation("udplat/goods/detail")
|
||||
@PostMapping("/detail")
|
||||
public BaseResponse detail(Integer id) {
|
||||
return udplatGoodsService.selectById(id);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.glxp.udidl.admin.controller.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.device.ProductDetailModel;
|
||||
import com.glxp.udidl.admin.dto.device.ProductGoodsMatchModel;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchListModel;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchModel;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchParam;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.udi.UdiCompanyService;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatGoodsMatchService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "阳光采购平台产品对照接口")
|
||||
@RestController
|
||||
@RequestMapping("/udplat/goodsMatch")
|
||||
public class UdplatGoodsMatchController {
|
||||
|
||||
@Autowired
|
||||
private UdplatGoodsMatchService udplatGoodsMatchService;
|
||||
@Autowired
|
||||
private UdiCompanyService udiCompanyService;
|
||||
|
||||
@ApiOperation(value = "保存对照信息")
|
||||
@AuthRuleAnnotation("udplat/goodsMatch/save")
|
||||
@PostMapping("/save")
|
||||
public BaseResponse save(@RequestBody UdplatGoodsMatchModel model) {
|
||||
return udplatGoodsMatchService.save(model);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询产品对照信息", response = UdplatGoodsMatchListModel.class)
|
||||
@AuthRuleAnnotation("udplat/goodsMatch/list")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody UdplatGoodsMatchParam param) {
|
||||
return udplatGoodsMatchService.getList(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "对照产品详细信息", response = ProductDetailModel.class)
|
||||
@ApiImplicitParam(name = "key", value = "关键字", required = true)
|
||||
@AuthRuleAnnotation("udplat/goodsMatch/productlist")
|
||||
@PostMapping("/productlist")
|
||||
public BaseResponse getProductList(String key) {
|
||||
return udplatGoodsMatchService.getProductList(key);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询产品详细信息", response = ProductGoodsMatchModel.class)
|
||||
@AuthRuleAnnotation("udplat/goodsMatch/productDetail")
|
||||
@PostMapping("/productDetail")
|
||||
public BaseResponse getProductInfoByUuid(String uuid) {
|
||||
return udplatGoodsMatchService.getProductInfoByUuid(uuid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询医疗器械注册人名称")
|
||||
@ApiImplicitParam(name = "name", value = "医疗器械注册人名称,支持模糊查询", required = true, dataType = "String")
|
||||
@AuthRuleAnnotation("udplat/goodsMatch/searchByName")
|
||||
@PostMapping("/searchByName")
|
||||
public BaseResponse searchByName(String name) {
|
||||
return udiCompanyService.searchByName(name);
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.glxp.udidl.admin.controller.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.udplat.BaseParam;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatHospitalModel;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatHospital;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatHospitalService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "医疗机构信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/udplat/hospital")
|
||||
public class UdplatHospitalController {
|
||||
|
||||
@Autowired
|
||||
private UdplatHospitalService udplatHospitalService;
|
||||
|
||||
@ApiOperation(value = "查询医疗机构信息", response = UdplatHospital.class)
|
||||
@ApiResponse(code = 20000, message = "success")
|
||||
@AuthRuleAnnotation("udplat/hospital/list")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody BaseParam param) {
|
||||
return udplatHospitalService.getList(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入医疗机构信息")
|
||||
@AuthRuleAnnotation("udplat/hospital/import")
|
||||
@PostMapping("/import")
|
||||
public BaseResponse imports(@RequestBody List<UdplatHospitalModel> models) {
|
||||
return udplatHospitalService.save(models, "import");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出医疗机构信息")
|
||||
@AuthRuleAnnotation("udplat/hospital/export")
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response) {
|
||||
udplatHospitalService.exportToFile(response);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.glxp.udidl.admin.controller.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatLog;
|
||||
import com.glxp.udidl.admin.req.udid.JobLogFilterRequest;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.dataSync.UdplatSyncService;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatLogService;
|
||||
import com.glxp.udidl.admin.util.ResultVOUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "阳光采购平台日志接口")
|
||||
@RestController
|
||||
@RequestMapping("/udplat/log")
|
||||
public class UdplatLogController {
|
||||
|
||||
@Autowired
|
||||
UdplatLogService udplatLogService;
|
||||
@Autowired
|
||||
UdplatSyncService udplatSyncService;
|
||||
|
||||
@ApiOperation(value = "查询日志信息", response = UdplatLog.class)
|
||||
@AuthRuleAnnotation("udplat/log/list")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody JobLogFilterRequest param) {
|
||||
return udplatLogService.getList(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "重新下载阳光采购平台数据")
|
||||
@AuthRuleAnnotation("udplat/log/udplatSync")
|
||||
@PostMapping("/udplatSync")
|
||||
public BaseResponse udplatSync(String tbName) {
|
||||
udplatSyncService.downloadAndSave("manual", tbName);
|
||||
return ResultVOUtils.success("后台已开始下载!");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.glxp.udidl.admin.controller.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.udidl.admin.dto.udplat.BaseParam;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatManufactureModel;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatManufacture;
|
||||
import com.glxp.udidl.admin.res.BaseResponse;
|
||||
import com.glxp.udidl.admin.service.udplat.UdplatManufactureService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "生产企业信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/udplat/manufacture")
|
||||
public class UdplatManufactureController {
|
||||
|
||||
@Autowired
|
||||
private UdplatManufactureService udplatManufactureService;
|
||||
|
||||
@ApiOperation(value = "查询生产企业信息",response = UdplatManufacture.class)
|
||||
@AuthRuleAnnotation("udplat/manufacture/list")
|
||||
@PostMapping("/list")
|
||||
public BaseResponse getList(@RequestBody BaseParam param) {
|
||||
return udplatManufactureService.getList(param);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入生产企业信息")
|
||||
@AuthRuleAnnotation("udplat/manufacture/import")
|
||||
@PostMapping("/import")
|
||||
public BaseResponse imports(@RequestBody List<UdplatManufactureModel> models) {
|
||||
return udplatManufactureService.save(models, "import");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出生产企业信息")
|
||||
@AuthRuleAnnotation("udplat/manufacture/export")
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response) {
|
||||
udplatManufactureService.exportToFile(response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.glxp.udidl.admin.converter;
|
||||
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Long 类型的 List 转为字符串
|
||||
*/
|
||||
public class LongList2StringConverter {
|
||||
|
||||
/**
|
||||
* Long 类型的 List 转为字符串
|
||||
* @param longList
|
||||
* @param regex
|
||||
* @return
|
||||
*/
|
||||
public static String convert(List<Long> longList, String regex) {
|
||||
|
||||
if (longList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Set<String> stringSet = new HashSet<>();
|
||||
for (Long value: longList){
|
||||
stringSet.add(value.toString());
|
||||
}
|
||||
if (stringSet.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return StringUtils.join(stringSet, regex);
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.glxp.udidl.admin.converter;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字符串切割为 List<Long>
|
||||
*/
|
||||
public class String2LongListConverter {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string
|
||||
* @param regex 切割的字符
|
||||
* @return
|
||||
*/
|
||||
public static List<Long> convert(String string, String regex) {
|
||||
try {
|
||||
if (null == string || "".equals(string)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
String[] strings = string.split(regex);
|
||||
if (strings.length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> longList = new ArrayList<>();
|
||||
for (String str : strings) {
|
||||
longList.add(Long.valueOf(str));
|
||||
}
|
||||
return longList;
|
||||
}catch (Exception e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.glxp.udidl.admin.converter;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字符串切割为 List<String>
|
||||
*/
|
||||
public class String2StringListConverter {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string
|
||||
* @param regex 切割的字符
|
||||
* @return
|
||||
*/
|
||||
public static List<String> convert(String string, String regex) {
|
||||
try {
|
||||
if (null == string || "".equals(string)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
String[] strings = string.split(regex);
|
||||
if (strings.length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return new ArrayList<>(Arrays.asList(strings));
|
||||
}catch (Exception e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.glxp.udidl.admin.dao.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthAdmin;
|
||||
import com.glxp.udidl.admin.req.auth.AuthAdminQueryRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AuthAdminMapper extends BaseMapper<AuthAdmin> {
|
||||
|
||||
/**
|
||||
* 后台业务查询列表
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<AuthAdmin> listAdminPage(AuthAdminQueryRequest authAdminQueryRequest);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 传入的id
|
||||
* @return
|
||||
*/
|
||||
AuthAdmin findById(Long id);
|
||||
|
||||
/**
|
||||
* 根据id查询 password
|
||||
*
|
||||
* @param id 传入的id
|
||||
* @return
|
||||
*/
|
||||
AuthAdmin findPwdById(Long id);
|
||||
|
||||
/**
|
||||
* 根据Name
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return
|
||||
*/
|
||||
AuthAdmin findByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param authAdmin
|
||||
* @return
|
||||
*/
|
||||
boolean insertAuthAdmin(AuthAdmin authAdmin);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param authAdmin
|
||||
* @return
|
||||
*/
|
||||
boolean updateAuthAdmin(AuthAdmin authAdmin);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询医院用户列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<AuthAdmin> selectHospitalUser();
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.glxp.udidl.admin.dao.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthPermission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AuthPermissionMapper extends BaseMapper<AuthPermission> {
|
||||
|
||||
/**
|
||||
* 根据roleIds查询
|
||||
*
|
||||
* @param roleIds 传入的id
|
||||
* @return
|
||||
*/
|
||||
List<AuthPermission> listByRoleIdIn(List<Long> roleIds);
|
||||
|
||||
/**
|
||||
* 根据 roleId 查询
|
||||
*
|
||||
* @param roleId 传入的id
|
||||
* @return
|
||||
*/
|
||||
List<AuthPermission> listByRoleId(Long roleId);
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param authPermissionList
|
||||
* @return
|
||||
*/
|
||||
int insertAuthPermissionAll(List<AuthPermission> authPermissionList);
|
||||
|
||||
/**
|
||||
* 根据角色id删除
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
boolean deleteByRoleId(Long roleId);
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.glxp.udidl.admin.dao.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthPermissionRule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface AuthPermissionRuleMapper extends BaseMapper<AuthPermissionRule> {
|
||||
|
||||
/**
|
||||
* 根据ids查询 规则名称
|
||||
*
|
||||
* @param ids 传入的ids
|
||||
* @return
|
||||
*/
|
||||
List<AuthPermissionRule> listByIdIn(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
List<AuthPermissionRule> listAll();
|
||||
|
||||
/**
|
||||
* 根据 父级 pid 查询
|
||||
*
|
||||
* @param pid
|
||||
* @return
|
||||
*/
|
||||
List<AuthPermissionRule> listByPid(Long pid);
|
||||
|
||||
/**
|
||||
* 根据 规则名称查询
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
AuthPermissionRule findByName(String name);
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param authPermissionRule
|
||||
* @return
|
||||
*/
|
||||
boolean insertAuthPermissionRule(AuthPermissionRule authPermissionRule);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param authPermissionRule
|
||||
* @return
|
||||
*/
|
||||
boolean updateAuthPermissionRule(AuthPermissionRule authPermissionRule);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.glxp.udidl.admin.dao.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthRoleAdmin;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface AuthRoleAdminMapper extends BaseMapper<AuthRoleAdmin> {
|
||||
|
||||
/**
|
||||
* 根据 adminId 查询
|
||||
*
|
||||
* @param adminId 传入的 adminId
|
||||
* @return
|
||||
*/
|
||||
List<AuthRoleAdmin> listByAdminId(Long adminId);
|
||||
|
||||
/**
|
||||
* 根据 多个 adminId 查询
|
||||
*
|
||||
* @param adminIds 传入的 adminIds
|
||||
* @return
|
||||
*/
|
||||
List<AuthRoleAdmin> listByAdminIdIn(List<Long> adminIds);
|
||||
|
||||
/**
|
||||
* 根据 role_id 查询 admin_id
|
||||
*
|
||||
* @param roleId 传入的 roleId
|
||||
* @return
|
||||
*/
|
||||
List<AuthRoleAdmin> listByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param authRoleAdminList
|
||||
* @return
|
||||
*/
|
||||
int insertAuthRoleAdminAll(List<AuthRoleAdmin> authRoleAdminList);
|
||||
|
||||
|
||||
/**
|
||||
* 根据 adminId 删除
|
||||
*
|
||||
* @param adminId
|
||||
* @return
|
||||
*/
|
||||
boolean deleteByAdminId(Long adminId);
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.glxp.udidl.admin.dao.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthRole;
|
||||
import com.glxp.udidl.admin.req.auth.AuthRoleQueryRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AuthRoleMapper extends BaseMapper<AuthRole> {
|
||||
|
||||
/**
|
||||
* 后台管理业务查询列表
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<AuthRole> listAdminPage(AuthRoleQueryRequest authRoleQueryRequest);
|
||||
|
||||
/**
|
||||
* 返回id,name 字段的列表
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
List<AuthRole> listAuthAdminRolePage(Integer status);
|
||||
|
||||
AuthRole findByName(String name);
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param authAdmin
|
||||
* @return
|
||||
*/
|
||||
boolean insertAuthRole(AuthRole authAdmin);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param authAdmin
|
||||
* @return
|
||||
*/
|
||||
boolean updateAuthRole(AuthRole authAdmin);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.udidl.admin.dao.info;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.info.CompanyEntity;
|
||||
|
||||
public interface CompanyMapper extends BaseMapper<CompanyEntity> {
|
||||
|
||||
CompanyEntity findCompany();
|
||||
|
||||
boolean modifyCompany(CompanyEntity companyEntity);
|
||||
|
||||
boolean insertCompany(CompanyEntity companyEntity);
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.glxp.udidl.admin.dao.info;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.info.FileInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FileInfoMapper extends BaseMapper<FileInfoEntity> {
|
||||
|
||||
List<FileInfoEntity> list();
|
||||
|
||||
int insert(FileInfoEntity fileInfoEntity);
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.udidl.admin.dao.info;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.info.ScheduledEntity;
|
||||
import com.glxp.udidl.admin.req.info.ScheduledRequest;
|
||||
|
||||
public interface ScheduledMapper extends BaseMapper<ScheduledEntity> {
|
||||
|
||||
ScheduledEntity findScheduled(ScheduledRequest scheduledRequest);
|
||||
|
||||
boolean insertScheduled(ScheduledEntity scheduledEntity);
|
||||
|
||||
boolean deleteScheduled(String id);
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.udidl.admin.dao.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.sys.SysMenu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
|
||||
int getChildCount(Integer parentId);
|
||||
|
||||
List<SysMenu> selectActiveAll();
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.glxp.udidl.admin.dao.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.dto.sys.SysRoleParam;
|
||||
import com.glxp.udidl.admin.entity.sys.SysRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(SysRole record);
|
||||
|
||||
SysRole selectByPrimaryKey(Integer id);
|
||||
|
||||
List<SysRole> selectAll();
|
||||
|
||||
int updateByPrimaryKey(SysRole record);
|
||||
|
||||
List<SysRole> list(SysRoleParam param);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.glxp.udidl.admin.dao.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.sys.SysRoleMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
|
||||
|
||||
int insert(SysRoleMenu record);
|
||||
|
||||
List<SysRoleMenu> selectAll();
|
||||
|
||||
List<Integer> selectByRoleId(@Param("roleId") Integer roleId);
|
||||
|
||||
int deleteByRoleId(@Param("roleId") Integer roleId);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.udidl.admin.dao.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.sys.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int hasAuthPerms(@Param("appId") String appId, @Param("appSecret") String appSecret, @Param("perms") String perms);
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.glxp.udidl.admin.dao.udi;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.dto.device.ProductDetailModel;
|
||||
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import com.glxp.udidl.admin.req.ProductInfoFilterRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductInfoMapper extends BaseMapper<ProductInfoEntity> {
|
||||
|
||||
List<ProductInfoEntity> filterProductInfo(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> filterCpmctymc(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> filterUdiByTyshxydm(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> filterUdiByCreditNo(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> filterUdiByNewest(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> selectByUpdateTime(@Param("startDate") String startDate, @Param("endDate") String endDate);//按更新时间查询
|
||||
|
||||
boolean insertProductInfo(ProductInfoEntity productInfoEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteAll(@Param("ids") List<String> ids);
|
||||
|
||||
boolean updateProductInfo(ProductInfoEntity productInfoEntity);
|
||||
|
||||
boolean updateProductByUuid(ProductInfoEntity productInfoEntity);
|
||||
|
||||
List<String> findAllUuids(ListPageRequest listPageRequest);
|
||||
|
||||
List<ProductInfoEntity> selectByUuid(@Param("uuid") String uuid);
|
||||
|
||||
List<ProductInfoEntity> filterUdi(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> syncDlUdi(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<String> filterUuidByCreditNo(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> selectAllByUuid(@Param("ids") List<String> ids);
|
||||
|
||||
List<String> findAllTyshxyh();
|
||||
|
||||
List<ProductDetailModel> selectByDeviceRecordKey(String key);
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.udidl.admin.dao.udi;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
|
||||
import com.glxp.udidl.admin.entity.udid.Contactlist;
|
||||
import com.glxp.udidl.admin.req.UdiCompanyRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdiCompanyMapper extends BaseMapper<UdiCompanyEntity> {
|
||||
|
||||
List<UdiCompanyEntity> selectAllTyshxyh();
|
||||
|
||||
List<Contactlist> selectContactBykey(@Param("deviceRecordKey") String deviceRecordKey);
|
||||
|
||||
List<UdiCompanyEntity> filterUdiCompany(UdiCompanyRequest udiCompanyRequest);
|
||||
|
||||
boolean insertUdiCompany(UdiCompanyEntity udiCompanyEntity);
|
||||
|
||||
boolean insertUdiCompanys(@Param("udiCompanyEntities") List<UdiCompanyEntity> udiCompanyEntities);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteAll(@Param("ids") List<String> ids);
|
||||
|
||||
boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity);
|
||||
|
||||
List<String> searchByName(String name);//公司名称搜索
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.glxp.udidl.admin.dao.udid;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.Contactlist;
|
||||
import com.glxp.udidl.admin.entity.udid.ContactlistExample;
|
||||
import com.glxp.udidl.admin.req.DlConnactRequest;
|
||||
import com.glxp.udidl.admin.req.DownloadUdiRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ContactlistMapper extends BaseMapper<Contactlist> {
|
||||
|
||||
long countByExample(ContactlistExample example);
|
||||
|
||||
int deleteByExample(ContactlistExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Contactlist record);
|
||||
|
||||
int insertSelective(Contactlist record);
|
||||
|
||||
List<Contactlist> selectByExample(ContactlistExample example);
|
||||
|
||||
Contactlist selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") Contactlist record, @Param("example") ContactlistExample example);
|
||||
|
||||
int updateByExample(@Param("record") Contactlist record, @Param("example") ContactlistExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(Contactlist record);
|
||||
|
||||
int updateByPrimaryKey(Contactlist record);
|
||||
|
||||
List<Contactlist> downloadContactlist(DownloadUdiRequest downloadUdiRequest);
|
||||
|
||||
List<Contactlist> dlConnacts(DlConnactRequest dlConnactRequest);
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.glxp.udidl.admin.dao.udid;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.Device;
|
||||
import com.glxp.udidl.admin.entity.udid.DeviceExample;
|
||||
import com.glxp.udidl.admin.req.DownloadUdiRequest;
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import com.glxp.udidl.admin.req.udid.DeviceListRequest;
|
||||
import com.glxp.udidl.admin.req.udid.DeviceSearchRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceMapper extends BaseMapper<Device> {
|
||||
|
||||
long countByExample(DeviceExample example);
|
||||
|
||||
int deleteByExample(DeviceExample example);
|
||||
|
||||
int deleteByPrimaryKey(String uuid);
|
||||
|
||||
int insert(Device record);
|
||||
|
||||
int insertSelective(Device record);
|
||||
|
||||
List<Device> selectByExample(DeviceExample example);
|
||||
|
||||
Device selectByPrimaryKey(String uuid);
|
||||
|
||||
int updateByExampleSelective(@Param("record") Device record, @Param("example") DeviceExample example);
|
||||
|
||||
int updateByExample(@Param("record") Device record, @Param("example") DeviceExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(Device record);
|
||||
|
||||
int updateByPrimaryKey(Device record);
|
||||
|
||||
List<Device> searchBykey(DeviceListRequest deviceListRequest);
|
||||
|
||||
Device searchByBs(@Param("zxxsdycpbs") String zzxsbs);
|
||||
|
||||
List<Device> search(DeviceSearchRequest deviceSearchRequest);
|
||||
|
||||
long getTotal(DeviceSearchRequest deviceListRequest);
|
||||
|
||||
boolean deleteHistory(@Param("deviceRecordKey") String deviceRecordKey);
|
||||
|
||||
Device searchByDeviceRecordKey(@Param("deviceRecordKey") String deviceRecordKey);
|
||||
|
||||
Device searchByZxxscpbs(@Param("zxxsdycpbs") String zxxsdycpbs);
|
||||
|
||||
List<Device> searchHistory(@Param("deviceRecordKey") String deviceRecordKey);
|
||||
|
||||
String selectisSame(@Param("deviceRecordKey") String deviceRecordKey, @Param("versionNumber") String versionNumber);
|
||||
|
||||
String selectKey(@Param("zxxsdycpbs") String zxxsdycpbs);
|
||||
|
||||
List<Device> downloadDevice(DownloadUdiRequest downloadUdiRequest);
|
||||
|
||||
List<String> findAllByZxxscpbs();
|
||||
|
||||
List<String> findAllByZxxscpbsPage(ListPageRequest listPageRequest);
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.glxp.udidl.admin.dao.udid;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.Deviceclinical;
|
||||
import com.glxp.udidl.admin.entity.udid.DeviceclinicalExample;
|
||||
import com.glxp.udidl.admin.req.DownloadUdiRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceclinicalMapper extends BaseMapper<Deviceclinical> {
|
||||
|
||||
long countByExample(DeviceclinicalExample example);
|
||||
|
||||
int deleteByExample(DeviceclinicalExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Deviceclinical record);
|
||||
|
||||
int insertSelective(Deviceclinical record);
|
||||
|
||||
List<Deviceclinical> selectByExample(DeviceclinicalExample example);
|
||||
|
||||
Deviceclinical selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") Deviceclinical record, @Param("example") DeviceclinicalExample example);
|
||||
|
||||
int updateByExample(@Param("record") Deviceclinical record, @Param("example") DeviceclinicalExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(Deviceclinical record);
|
||||
|
||||
int updateByPrimaryKey(Deviceclinical record);
|
||||
|
||||
List<Deviceclinical> downloadDeviceclinical(DownloadUdiRequest downloadUdiRequest);
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.glxp.udidl.admin.dao.udid;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.Devicedownload;
|
||||
import com.glxp.udidl.admin.entity.udid.DevicedownloadExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DevicedownloadMapper extends BaseMapper<Devicedownload> {
|
||||
|
||||
long countByExample(DevicedownloadExample example);
|
||||
|
||||
int deleteByExample(DevicedownloadExample example);
|
||||
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(Devicedownload record);
|
||||
|
||||
int insertSelective(Devicedownload record);
|
||||
|
||||
List<Devicedownload> selectByExample(DevicedownloadExample example);
|
||||
|
||||
Devicedownload selectByPrimaryKey(String id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") Devicedownload record, @Param("example") DevicedownloadExample example);
|
||||
|
||||
int updateByExample(@Param("record") Devicedownload record, @Param("example") DevicedownloadExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(Devicedownload record);
|
||||
|
||||
int updateByPrimaryKey(Devicedownload record);
|
||||
|
||||
int updateProgress(Devicedownload record);
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.glxp.udidl.admin.dao.udid;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.Devicepackage;
|
||||
import com.glxp.udidl.admin.entity.udid.DevicepackageExample;
|
||||
import com.glxp.udidl.admin.req.DownloadUdiRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DevicepackageMapper extends BaseMapper<Devicepackage> {
|
||||
|
||||
long countByExample(DevicepackageExample example);
|
||||
|
||||
int deleteByExample(DevicepackageExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Devicepackage record);
|
||||
|
||||
int insertSelective(Devicepackage record);
|
||||
|
||||
List<Devicepackage> selectByExample(DevicepackageExample example);
|
||||
|
||||
Devicepackage selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") Devicepackage record, @Param("example") DevicepackageExample example);
|
||||
|
||||
int updateByExample(@Param("record") Devicepackage record, @Param("example") DevicepackageExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(Devicepackage record);
|
||||
|
||||
int updateByPrimaryKey(Devicepackage record);
|
||||
|
||||
List<Devicepackage> downloadDevicepackage(DownloadUdiRequest downloadUdiRequest);
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.glxp.udidl.admin.dao.udid;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.Devicestorage;
|
||||
import com.glxp.udidl.admin.entity.udid.DevicestorageExample;
|
||||
import com.glxp.udidl.admin.req.DownloadUdiRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DevicestorageMapper extends BaseMapper<Devicestorage> {
|
||||
|
||||
long countByExample(DevicestorageExample example);
|
||||
|
||||
int deleteByExample(DevicestorageExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Devicestorage record);
|
||||
|
||||
int insertSelective(Devicestorage record);
|
||||
|
||||
List<Devicestorage> selectByExample(DevicestorageExample example);
|
||||
|
||||
Devicestorage selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") Devicestorage record, @Param("example") DevicestorageExample example);
|
||||
|
||||
int updateByExample(@Param("record") Devicestorage record, @Param("example") DevicestorageExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(Devicestorage record);
|
||||
|
||||
int updateByPrimaryKey(Devicestorage record);
|
||||
|
||||
List<Devicestorage> downloadDevicestorage(DownloadUdiRequest downloadUdiRequest);
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.glxp.udidl.admin.dao.udid;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udid.JobLog;
|
||||
import com.glxp.udidl.admin.req.udid.JobLogFilterRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface JobLogMapper extends BaseMapper<JobLog> {
|
||||
|
||||
/**
|
||||
* 日志查询
|
||||
*
|
||||
* @param jobLogFilterRequest
|
||||
* @return
|
||||
*/
|
||||
List<JobLog> list(JobLogFilterRequest jobLogFilterRequest);
|
||||
|
||||
/**
|
||||
* 日志记录
|
||||
*
|
||||
* @param jobLog
|
||||
* @return
|
||||
*/
|
||||
int insert(JobLog jobLog);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.glxp.udidl.admin.dao.udplat;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.dto.udplat.BaseParam;
|
||||
import com.glxp.udidl.admin.dto.udplat.UnitsListModel;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatDistributor;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdplatDistributorMapper extends BaseMapper<UdplatDistributor> {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(UdplatDistributor record);
|
||||
|
||||
UdplatDistributor selectByPrimaryKey(Integer id);
|
||||
|
||||
List<UdplatDistributor> selectAll();
|
||||
|
||||
int updateByPrimaryKey(UdplatDistributor record);
|
||||
|
||||
List<UdplatDistributor> list(BaseParam param);
|
||||
|
||||
UdplatDistributor selectByDistributorId(String id);
|
||||
|
||||
List<UnitsListModel> getUnitsList(@Param("key") String key);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.glxp.udidl.admin.dao.udplat;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.dto.udplat.ProductListModel;
|
||||
import com.glxp.udidl.admin.dto.udplat.ProductParam;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsParam;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatGoods;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdplatGoodsMapper extends BaseMapper<UdplatGoods> {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(UdplatGoods record);
|
||||
|
||||
UdplatGoods selectByGoodsId(String deliveryGoodId);
|
||||
|
||||
UdplatGoods selectByProjectGoodsCode(String projectGoodsCode);
|
||||
|
||||
UdplatGoods selectById(Integer id);
|
||||
|
||||
List<UdplatGoods> selectAll();
|
||||
|
||||
int update(UdplatGoods record);
|
||||
|
||||
List<UdplatGoods> list(UdplatGoodsParam param);
|
||||
|
||||
List<ProductListModel> getProducts(ProductParam param);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.udidl.admin.dao.udplat;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.dto.device.ProductGoodsMatchModel;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchListModel;
|
||||
import com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchParam;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatGoodsMatch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdplatGoodsMatchMapper extends BaseMapper<UdplatGoodsMatch> {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(UdplatGoodsMatch record);
|
||||
|
||||
UdplatGoodsMatch selectByPrimaryKey(Integer id);
|
||||
|
||||
List<UdplatGoodsMatch> selectAll();
|
||||
|
||||
int updateByPrimaryKey(UdplatGoodsMatch record);
|
||||
|
||||
UdplatGoodsMatch selectByDeviceRecordKey(String id);
|
||||
|
||||
List<UdplatGoodsMatchListModel> getList(UdplatGoodsMatchParam param);
|
||||
|
||||
List<ProductGoodsMatchModel> getMatchList(String uuid);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.udidl.admin.dao.udplat;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.dto.udplat.BaseParam;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatHospital;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdplatHospitalMapper extends BaseMapper<UdplatHospital> {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(UdplatHospital record);
|
||||
|
||||
UdplatHospital selectByPrimaryKey(Integer id);
|
||||
|
||||
List<UdplatHospital> selectAll();
|
||||
|
||||
int updateByPrimaryKey(UdplatHospital record);
|
||||
|
||||
List<UdplatHospital> list(BaseParam param);
|
||||
|
||||
UdplatHospital selectByPurchaseId(String id);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.glxp.udidl.admin.dao.udplat;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatLog;
|
||||
import com.glxp.udidl.admin.req.udid.JobLogFilterRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdplatLogMapper extends BaseMapper<UdplatLog> {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(UdplatLog record);
|
||||
|
||||
UdplatLog selectByPrimaryKey(Integer id);
|
||||
|
||||
List<UdplatLog> selectAll();
|
||||
|
||||
int updateByPrimaryKey(UdplatLog record);
|
||||
|
||||
List<UdplatLog> list(JobLogFilterRequest jobLogFilterRequest);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.udidl.admin.dao.udplat;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.udidl.admin.dto.udplat.BaseParam;
|
||||
import com.glxp.udidl.admin.entity.udplat.UdplatManufacture;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdplatManufactureMapper extends BaseMapper<UdplatManufacture> {
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(UdplatManufacture record);
|
||||
|
||||
UdplatManufacture selectByPrimaryKey(Integer id);
|
||||
|
||||
List<UdplatManufacture> selectAll();
|
||||
|
||||
int updateByPrimaryKey(UdplatManufacture record);
|
||||
|
||||
List<UdplatManufacture> list(BaseParam param);
|
||||
|
||||
UdplatManufacture selectByManufactureId(String manufactureId);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.glxp.udidl.admin.dto.device;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "产品详情实体")
|
||||
public class ProductDetailModel {
|
||||
|
||||
@ApiModelProperty(value = "产品标识")
|
||||
private String nameCode;//产品标识
|
||||
|
||||
@ApiModelProperty(value = "产品名称")
|
||||
private String cpmctymc;//产品名称
|
||||
|
||||
@ApiModelProperty(value = "包装级别")
|
||||
private String packLevel;//包装级别
|
||||
|
||||
@ApiModelProperty(value = "包装层级")
|
||||
private String bzcj;//包装层级
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.udidl.admin.dto.device;
|
||||
|
||||
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "产品对照信息")
|
||||
public class ProductGoodsMatchModel extends ProductInfoEntity {
|
||||
|
||||
@ApiModelProperty(value = "目录key")
|
||||
private String deliveryGoodsId;//目录key
|
||||
|
||||
@ApiModelProperty(value = "医保编码")
|
||||
private String medicalCode;//医保编码
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.udidl.admin.dto.sys;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class RoleMenuTreeModel {
|
||||
private List<MenuTreeModel> menuTrees;
|
||||
private List<Integer> roleMenuIds;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.udidl.admin.dto.sys;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SysRoleMenuModel {
|
||||
private Integer roleId;
|
||||
private List<Integer> menuIds;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.udidl.admin.dto.sys;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysRoleModel {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色代码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 状态0: 启用,1: 禁用
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.glxp.udidl.admin.dto.sys;
|
||||
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysRoleParam extends ListPageRequest {
|
||||
private String status;
|
||||
private String name;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.udidl.admin.dto.sys;
|
||||
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysUserParam extends ListPageRequest {
|
||||
|
||||
private String status;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel("查询参数")
|
||||
public class BaseParam extends ListPageRequest {
|
||||
|
||||
@ApiModelProperty(name = "startDate", value = "开始日期")
|
||||
private String startDate;//开始日期
|
||||
|
||||
@ApiModelProperty(name = "endDate", value = "结束日期")
|
||||
private String endDate;//结束日期
|
||||
|
||||
@ApiModelProperty(name = "name", value = "名称,支持模糊查询")
|
||||
private String name;//名称,支持模糊查询
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductListModel {
|
||||
private String code;
|
||||
private String name;
|
||||
private String measname;//计量单位
|
||||
private String model;//型号
|
||||
private String spec;//规格
|
||||
private String registerNo;//注册证号
|
||||
private String manufactureId;//生成企业ID
|
||||
private String manufactory;//生产企业
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductParam extends ListPageRequest {
|
||||
private String code;//产品编码
|
||||
private String name;//产品名称
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "配送企业信息参数")
|
||||
public class UdplatDistributorModel {
|
||||
/**
|
||||
* 配送企业id
|
||||
*/
|
||||
@ApiModelProperty(value = "配送企业id")
|
||||
private String distributorId;
|
||||
|
||||
/**
|
||||
* 配送企业编码
|
||||
*/
|
||||
@ApiModelProperty(value = "配送企业编码")
|
||||
private String distributorCode;
|
||||
|
||||
/**
|
||||
* 配送企业名称
|
||||
*/
|
||||
@ApiModelProperty(value = "配送企业名称")
|
||||
private String distributorName;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "阳光采购平台产品对照信息")
|
||||
public class UdplatGoodsMatchListModel {
|
||||
|
||||
@ApiModelProperty(value = "uuid")
|
||||
private String uuid;//uuid
|
||||
|
||||
@ApiModelProperty(value = "最小销售单元产品标识")
|
||||
private String nameCode;//最小销售单元产品标识
|
||||
|
||||
@ApiModelProperty(value = "注册、备案人名称")
|
||||
private String ylqxzcrbarmc;//注册/备案人名称
|
||||
|
||||
@ApiModelProperty(value = "注册证号")
|
||||
private String zczbhhzbapzbh;//注册证号
|
||||
|
||||
@ApiModelProperty(value = "产品名称")
|
||||
private String cpmctymc;//产品名称
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String ggxh; //规格型号
|
||||
|
||||
@ApiModelProperty(value = "产品描述")
|
||||
private String cpms; //产品描述
|
||||
|
||||
@ApiModelProperty(value = "产品key")
|
||||
private String deviceRecordKey;//产品key
|
||||
|
||||
@ApiModelProperty(value = "目录key")
|
||||
private String deliveryGoodsId;//目录key
|
||||
|
||||
@ApiModelProperty(value = "医保编码")
|
||||
private String medicalCode;//医保编码
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "阳光采购平台产品对照信息")
|
||||
public class UdplatGoodsMatchModel {
|
||||
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
@ApiModelProperty(value = "产品ID")
|
||||
private String deviceRecordKey;
|
||||
|
||||
/**
|
||||
* 配送目录ID
|
||||
*/
|
||||
@ApiModelProperty(value = "配送目录ID")
|
||||
private String deliveryGoodsId;
|
||||
|
||||
/**
|
||||
* 医保编码
|
||||
*/
|
||||
@ApiModelProperty(value = "医保编码")
|
||||
private String medicalCode;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "阳光采购平台产品信息查询参数")
|
||||
public class UdplatGoodsParam extends BaseParam {
|
||||
|
||||
@ApiModelProperty(value = "生产企业")
|
||||
private String manufactureName;//生产企业
|
||||
|
||||
@ApiModelProperty(value = "配送企业")
|
||||
private String distributorName;//配送企业
|
||||
|
||||
@ApiModelProperty(value = "注册证号")
|
||||
private String regNum;//注册证号
|
||||
|
||||
@ApiModelProperty(value = "型号")
|
||||
private String model;//型号
|
||||
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String spec;//规格
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 医疗机构批量增加导入实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "医疗机构信息实体")
|
||||
public class UdplatHospitalModel {
|
||||
|
||||
/**
|
||||
* 医疗机构ID
|
||||
*/
|
||||
@ApiModelProperty(value = "医疗机构ID")
|
||||
private String purchaseId;
|
||||
|
||||
/**
|
||||
* 医疗机构编码
|
||||
*/
|
||||
@ApiModelProperty(value = "医疗机构编码")
|
||||
private String purchaseCode;
|
||||
|
||||
/**
|
||||
* 医疗机构名称
|
||||
*/
|
||||
@ApiModelProperty(value = "医疗机构名称")
|
||||
private String purchaseName;
|
||||
|
||||
/**
|
||||
* 医疗机构区域名称
|
||||
*/
|
||||
@ApiModelProperty(value = "医疗机构区域名称")
|
||||
private String purchaseArea;
|
||||
|
||||
/**
|
||||
* 医疗机构区域ID
|
||||
*/
|
||||
@ApiModelProperty(value = "医疗机构区域ID")
|
||||
private String purchaseAreaId;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "生产企业信息实体")
|
||||
public class UdplatManufactureModel {
|
||||
|
||||
/**
|
||||
* 生产企业id
|
||||
*/
|
||||
@ApiModelProperty(value = "生产企业id")
|
||||
private String manufactureId;
|
||||
|
||||
/**
|
||||
* 生产企业编码
|
||||
*/
|
||||
@ApiModelProperty(value = "生产企业编码")
|
||||
private String manufactureCode;
|
||||
|
||||
/**
|
||||
* 生产企业名称
|
||||
*/
|
||||
@ApiModelProperty(value = "生产企业名称")
|
||||
private String manufactureName;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.udidl.admin.dto.udplat;
|
||||
|
||||
import com.glxp.udidl.admin.req.ListPageRequest;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UnitsParam extends ListPageRequest {
|
||||
@ApiModelProperty(value = "关键字查询")
|
||||
private String key;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.udidl.admin.entity.auth;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AuthAdmin {
|
||||
|
||||
// 主键
|
||||
private Long id;
|
||||
// 昵称
|
||||
private String userName;
|
||||
// 登录密码
|
||||
private String passWord;
|
||||
|
||||
// 最后登录ip
|
||||
private String lastLoginIp;
|
||||
// 最后登录时间
|
||||
private Date lastLoginTime;
|
||||
// 创建时间
|
||||
private Date createTime;
|
||||
// 状态
|
||||
private Integer userFlag;
|
||||
|
||||
private Date lastModifyTime;
|
||||
private String comments;
|
||||
private String employeeName;
|
||||
private Integer CustomerId;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.udidl.admin.entity.auth;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 权限授权表
|
||||
*/
|
||||
@Data
|
||||
public class AuthPermission {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
private Long permissionRuleId;
|
||||
|
||||
private String type;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.glxp.udidl.admin.entity.auth;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 规则表
|
||||
*/
|
||||
@Data
|
||||
public class AuthPermissionRule {
|
||||
|
||||
private Long id;
|
||||
private Long pid;
|
||||
private String name;
|
||||
private String title;
|
||||
private Integer status;
|
||||
private String condition;
|
||||
private Integer listorder;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.glxp.udidl.admin.entity.auth;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色表
|
||||
*/
|
||||
@Data
|
||||
public class AuthRole {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private Long pid;
|
||||
private Long status;
|
||||
private String remark;
|
||||
private Long listorder;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue