New file |
| | |
| | | <?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"> |
| | | <parent> |
| | | <artifactId>eyes</artifactId> |
| | | <groupId>com</groupId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>optometrist</artifactId> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-test</artifactId> |
| | | <version>5.3.9</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.4.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.4.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com</groupId> |
| | | <artifactId>common</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | <!--security--> |
| | | <!--<dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency>--> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-core</artifactId> |
| | | <version>5.5.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-config</artifactId> |
| | | <version>5.5.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-web</artifactId> |
| | | <version>5.5.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-crypto</artifactId> |
| | | <version>5.5.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>commons-codec</groupId> |
| | | <artifactId>commons-codec</artifactId> |
| | | <version>1.1</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>optometrist</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>${spring.boot.version}</version> |
| | | <configuration> |
| | | <excludes> |
| | | <exclude> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </exclude> |
| | | </excludes> |
| | | <mainClass>com.jilongda.optometrist.ManageApplication</mainClass> |
| | | </configuration> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-surefire-plugin</artifactId> |
| | | <version>2.22.2</version> |
| | | <configuration> |
| | | <skipTests>true</skipTests> |
| | | </configuration> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>3.8.0</version> |
| | | <configuration> |
| | | <source>1.8</source> |
| | | <target>1.8</target> |
| | | <encoding>UTF-8</encoding> |
| | | <optimize>true</optimize> |
| | | <useIncrementalCompilation>false</useIncrementalCompilation> |
| | | <!-- 去除泛型编译告警 --> |
| | | <compilerArgument>-Xlint:unchecked</compilerArgument> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.jilongda.optometrist; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/6/8/00817:37 |
| | | */ |
| | | @Slf4j |
| | | @ComponentScan(basePackages = "com.jilongda") |
| | | @MapperScan({"com.jilongda.optometrist.mapper", "com.jilongda.optometrist.authority.mapper"}) |
| | | @EnableTransactionManagement |
| | | @SpringBootApplication |
| | | public class ManageApplication { |
| | | |
| | | public static void main(String[] args) throws UnknownHostException { |
| | | ConfigurableApplicationContext application = SpringApplication.run(ManageApplication.class, args); |
| | | Environment env = application.getEnvironment(); |
| | | log.info("\n----------------------------------------------------------\n\t" + |
| | | "应用 '{}' 运行成功! 访问连接:\n\t" + |
| | | "Swagger文档: \t\thttp://{}:{}/doc.html\n" + |
| | | "----------------------------------------------------------", |
| | | env.getProperty("spring.application.name", "后台管理"), |
| | | InetAddress.getLocalHost().getHostAddress(), |
| | | env.getProperty("server.port", "8089")); |
| | | } |
| | | |
| | | @Bean |
| | | public PasswordEncoder passwordEncoder() { |
| | | return new BCryptPasswordEncoder(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.controller; |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.Constant; |
| | | import com.jilongda.common.exception.ServiceException; |
| | | import com.jilongda.common.log.OperLoginLog; |
| | | import com.jilongda.common.redis.RedisAutoTemplate; |
| | | import com.jilongda.common.security.SecurityUtils; |
| | | import com.jilongda.common.utils.WebUtils; |
| | | import com.jilongda.optometrist.authority.dto.LoginCodeDTO; |
| | | import com.jilongda.optometrist.authority.dto.LoginDTO; |
| | | import com.jilongda.optometrist.authority.dto.VerificationCodeDTO; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.service.SecUserService; |
| | | import com.jilongda.optometrist.security.SecurityUserDetails; |
| | | import com.jilongda.optometrist.utils.MsgUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName LoginController |
| | | * @Description |
| | | * @date 2022-05-23 17:24 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "验光师登录 相关接口") |
| | | @RestController |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @RequestMapping("/") |
| | | public class LoginController { |
| | | |
| | | private final AuthenticationManager authenticationManager; |
| | | private final SecurityUtils securityUtils; |
| | | private final PasswordEncoder passwordEncoder; |
| | | private final RedisAutoTemplate redisAutoTemplate; |
| | | private final MsgUtils msgUtils; |
| | | private final SecUserService secUserService; |
| | | |
| | | @Autowired |
| | | public LoginController(AuthenticationManager authenticationManager, SecurityUtils securityUtils, PasswordEncoder passwordEncoder, RedisAutoTemplate redisAutoTemplate, MsgUtils msgUtils, SecUserService secUserService) { |
| | | this.authenticationManager = authenticationManager; |
| | | this.securityUtils = securityUtils; |
| | | this.passwordEncoder = passwordEncoder; |
| | | this.redisAutoTemplate = redisAutoTemplate; |
| | | this.msgUtils = msgUtils; |
| | | this.secUserService = secUserService; |
| | | } |
| | | /** |
| | | * 登录接口 |
| | | */ |
| | | @ApiOperation("验光师短信登录") |
| | | @PostMapping(value = "code/login") |
| | | public ApiResult<Map<String, Object>> loginByCode(@Validated @RequestBody LoginCodeDTO dto) { |
| | | SecUser one = secUserService.lambdaQuery().eq(SecUser::getPhone, dto.getPhone()) |
| | | .eq(SecUser::getUserType, 2).one(); |
| | | if (one==null){ |
| | | return ApiResult.failed(500, "手机号未注册"); |
| | | } |
| | | SecUser two = secUserService.lambdaQuery().eq(SecUser::getPhone, dto.getPhone()) |
| | | .eq(SecUser::getUserType, 2) |
| | | .eq(SecUser::getState,0) |
| | | .one(); |
| | | if (two==null){ |
| | | return ApiResult.failed(500, "账号已被禁用"); |
| | | } |
| | | // 先检验是否登录 |
| | | String phone = dto.getPhone(); |
| | | String code = dto.getCode(); |
| | | // 校验验证码是否正确 |
| | | String redisCode = redisAutoTemplate.getStr(dto.getPhone()); |
| | | Assert.isTrue(StringUtils.hasLength(redisCode), "验证码已过期"); |
| | | if (!code.equals(redisCode)) { |
| | | throw new ServiceException(500, "验证码错误,请重新输入验证码!"); |
| | | } |
| | | try { |
| | | Map<String, Object> token = securityUtils.login(phone, code, authenticationManager, SecurityUserDetails.class, 2); |
| | | return ApiResult.success(token); |
| | | } catch (Exception e) { |
| | | ApiResult<Map<String, Object>> failed = ApiResult.failed(new HashMap<>(1)); |
| | | failed.setCode(0); |
| | | failed.setSuccess(false); |
| | | failed.setMsg(e.getMessage()); |
| | | return failed; |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "发送验证码", notes = "发送验证码") |
| | | @PostMapping(value = "sendMsg") |
| | | public ApiResult<String> sendMsg(@Validated @RequestBody VerificationCodeDTO dto) throws Exception { |
| | | // 发送验证码并存储到redis |
| | | if (StringUtils.hasLength(dto.getPhone())) { |
| | | SecUser one = secUserService.lambdaQuery().eq(SecUser::getPhone, dto.getPhone()) |
| | | .eq(SecUser::getUserType, 2).one(); |
| | | if (one==null){ |
| | | return ApiResult.failed(500, "手机号未注册"); |
| | | } |
| | | SecUser two = secUserService.lambdaQuery().eq(SecUser::getPhone, dto.getPhone()) |
| | | .eq(SecUser::getUserType, 2) |
| | | .eq(SecUser::getState,0) |
| | | .one(); |
| | | if (two==null){ |
| | | return ApiResult.failed(500, "账号已被禁用"); |
| | | } |
| | | |
| | | String code = String.valueOf((int) (Math.random() * 1000000)); |
| | | redisAutoTemplate.setStr(dto.getPhone(), code); |
| | | redisAutoTemplate.expire(dto.getPhone(), Constant.REDIS_EXPIRE); |
| | | msgUtils.sendMsg(dto.getPhone(), code); |
| | | return ApiResult.success("发送短信验证码成功!15分钟内有效"); |
| | | } |
| | | return ApiResult.failed(500, "发送短信验证码失败,请确认手机号码!"); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 退出 |
| | | * |
| | | * @return 退出登录 |
| | | */ |
| | | @ApiOperation("验光师退出登录") |
| | | @GetMapping("logout") |
| | | public ApiResult<String> logout() { |
| | | boolean flag = securityUtils.invalidateToken(WebUtils.request()); |
| | | if (flag) { |
| | | return ApiResult.success("退出成功"); |
| | | } |
| | | return ApiResult.success("退出失败"); |
| | | } |
| | | |
| | | /** |
| | | * h5登录 |
| | | */ |
| | | /*@ApiOperation("h5登录") |
| | | @PostMapping(value = "h5/login") |
| | | public ApiResult<Map<String, Object>> webLogin(@Validated @RequestBody LoginDTO loginDto) { |
| | | // 先检验是否登录 |
| | | String username = loginDto.getAccount(); |
| | | String password = loginDto.getPassword(); |
| | | EvaluatePerson evaluatePerson = evaluatePersonService.getOne(Wrappers.lambdaQuery(EvaluatePerson.class) |
| | | .eq(EvaluatePerson::getPersonAccount, username).last(" LIMIT 1")); |
| | | if (Objects.isNull(evaluatePerson)) { |
| | | throw new UsernameNotFoundException("该用户不存在"); |
| | | } |
| | | // 根据加密算法加密用户输入的密码,然后和数据库中保存的密码进行比较 |
| | | if (!passwordEncoder.matches(password, evaluatePerson.getPersonPassword())) { |
| | | throw new BadCredentialsException("输入账号或密码不正确"); |
| | | } |
| | | try { |
| | | Map<String, Object> token = securityUtils.login(username, evaluatePerson, authenticationManager, EvaluatePerson.class,2); |
| | | String account = JwtTokenUtils.getUsername(); |
| | | log.info("登录账号=============:{}",account); |
| | | return ApiResult.success(token); |
| | | } catch (Exception e) { |
| | | ApiResult<Map<String, Object>> failed = ApiResult.failed(new HashMap<>(1)); |
| | | failed.setCode(0); |
| | | failed.setSuccess(false); |
| | | failed.setMsg(e.getMessage()); |
| | | return failed; |
| | | } |
| | | }*/ |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class Btn implements Serializable { |
| | | private String title; |
| | | private String name; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/6/27/02715:49 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "短信验证码登录") |
| | | public class LoginCodeDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @NotBlank(message = "手机号不能为空") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "验证码") |
| | | @NotBlank(message = "验证码不能为空") |
| | | private String code; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName LoginDto |
| | | * @Description |
| | | * @date 2020-08-20 17:52 |
| | | */ |
| | | @Data |
| | | @ApiModel("登录相关dto") |
| | | public class LoginDTO { |
| | | @NotBlank(message = "账号不能为空") |
| | | private String account; |
| | | |
| | | @NotBlank(message = "密码不能为空") |
| | | private String password; |
| | | |
| | | // @NotNull(message = "必须正确验证") |
| | | // private Boolean verify; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class Meta implements Serializable { |
| | | private String title; |
| | | private String parent; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/10/17 14:20 |
| | | */ |
| | | @Data |
| | | public class ResetPasswordDTO { |
| | | @ApiModelProperty(value = "账号") |
| | | private String account; |
| | | @ApiModelProperty(value = "验证码") |
| | | private String code; |
| | | @ApiModelProperty(value = "新密码") |
| | | @Length(min = 8, max = 16, message = "密码长度在8-16之间") |
| | | private String password; |
| | | @ApiModelProperty(value = "旧密码") |
| | | private String oldPassword; |
| | | private Long id; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName SysResDTO |
| | | * @Description |
| | | * @date 2021-04-20 10:25 |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @ApiModel("资源dto") |
| | | public class SecResDTO extends SecResources { |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 11:35 |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @ApiModel("角色dto") |
| | | public class SecRoleDTO extends SecRole { |
| | | /** |
| | | * 角色id |
| | | */ |
| | | @ApiModelProperty("角色id") |
| | | private Long rid; |
| | | /** |
| | | * 资源列表 |
| | | */ |
| | | @ApiModelProperty("资源列表集合") |
| | | private List<Long> resourceIds; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 11:35 |
| | | */ |
| | | @Data |
| | | @ApiModel("角色赋予资源dto") |
| | | public class SecRoleResDTO { |
| | | /** |
| | | * 角色id |
| | | */ |
| | | @ApiModelProperty("角色id") |
| | | private Long rid; |
| | | /** |
| | | * 资源列表 |
| | | */ |
| | | @ApiModelProperty("资源列表集合") |
| | | private List<Long> resourceIds; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 11:25 |
| | | */ |
| | | @Data |
| | | @ApiModel("角色列表dto请求体") |
| | | public class SecRolesDTO extends BasePage { |
| | | @ApiModelProperty("角色名称") |
| | | private String rolename; |
| | | |
| | | @ApiModelProperty(value = "角色状态") |
| | | private Boolean roleState; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 10:59 |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @ApiModel("管理员账号dto") |
| | | public class SecUserDTO extends SecUser { |
| | | |
| | | @ApiModelProperty("角色id") |
| | | private Long roleId; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 10:59 |
| | | */ |
| | | @Data |
| | | @ApiModel("用户查询dto") |
| | | @JsonIgnoreProperties({BaseModel.UPDATE_TIME}) |
| | | public class SecUserQueryDTO extends TimeRangePageDTO { |
| | | |
| | | @ApiModelProperty("角色id") |
| | | private Long id; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/6/29/0299:31 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "人员绑定角色DTO") |
| | | public class SecUserRoleDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "人员id集合") |
| | | private List<Long> userIds; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | @NotBlank(message = "角色不可为空") |
| | | private Long roleId; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 管理员列表dto对象 |
| | | * </p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 10:18 |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @ApiModel("管理员列表dto对象") |
| | | public class SecUsersDTO extends BasePage { |
| | | @ApiModelProperty("姓名") |
| | | private String nickName; |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | @ApiModelProperty("店铺id") |
| | | private Integer storeId; |
| | | @ApiModelProperty("人员角色id") |
| | | private Long roleId; |
| | | @ApiModelProperty("状态 true = 禁用 ") |
| | | private Boolean state; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SysSourcesDTO implements Serializable { |
| | | private String icon; |
| | | |
| | | private String path; |
| | | |
| | | private String name; |
| | | |
| | | private String component; |
| | | |
| | | private Boolean hidden; |
| | | |
| | | private Meta meta; |
| | | |
| | | private List<Btn> btn; |
| | | |
| | | private List<SysSourcesDTO> children; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SysSourcesListDTO implements Serializable { |
| | | private List<SysSourcesDTO> menus; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/6/27/02715:33 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "验证码") |
| | | public class VerificationCodeDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @NotBlank(message = "请输入手机号") |
| | | @Length(min = 11, max = 11, message = "手机号只能为11位") |
| | | @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误") |
| | | private String phone; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资源表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Mapper |
| | | public interface SecResourcesMapper extends BaseMapper<SecResources> { |
| | | |
| | | /** |
| | | * 根据uid获取资源 |
| | | * |
| | | * @param uid 管理员id |
| | | * @return 用户资源 |
| | | */ |
| | | List<SecResources> selectResourceByUid(@Param("uid")Long uid); |
| | | |
| | | List<SecResourceVO> getList(@Param("rid")Long rid); |
| | | |
| | | List<SecResourceVO> allList(); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.authority.dto.SecUserQueryDTO; |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.vo.SecUserVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Mapper |
| | | public interface SecRoleMapper extends BaseMapper<SecRole> { |
| | | /** |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<SecRole> selectRolesByUid(@Param("uid") Long uid); |
| | | /** |
| | | * 通过角色查找人员 |
| | | * |
| | | * @param dto |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<SecUserVO> getUserByRole(@Param("dto") SecUserQueryDTO dto, PageInfo<SecUserVO> pageInfo); |
| | | |
| | | /** |
| | | * 根据角色id查询角色资源 |
| | | * |
| | | * @param rid |
| | | * @return |
| | | */ |
| | | List<Long> selectResByRid(@Param("rid")Long rid); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.authority.model.SecRoleResource; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Mapper |
| | | public interface SecRoleResourceMapper extends BaseMapper<SecRoleResource> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.authority.dto.SecUsersDTO; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.query.SecUserLowerQuery; |
| | | import com.jilongda.optometrist.authority.vo.SecUsersVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Mapper |
| | | public interface SecUserMapper extends BaseMapper<SecUser> { |
| | | |
| | | /** |
| | | * 后台系统用户列表 |
| | | * |
| | | * @param dto |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<SecUsersVO> getSecUserList(@Param("dto") SecUsersDTO dto, @Param("pageInfo") PageInfo<SecUsersVO> pageInfo); |
| | | |
| | | /** |
| | | * KAM查询下级 |
| | | * |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<SecUser> queryLower(@Param("query") SecUserLowerQuery query, @Param("pageInfo") PageInfo<SecUser> pageInfo); |
| | | |
| | | void removeById(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 通过角色id获取账号 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<SecUser> getUserByRoleId(@Param("id") Long id); |
| | | /** |
| | | * 通过用户名手机号部门id获取账号 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<SecUser> selectListByNamePhoneDeptId(@Param("name")String name,@Param("deptId")Long deptId); |
| | | /** |
| | | * 通过用户名手机号部门id集合获取账号 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<SecUser> selectListByNamePhoneDeptIds(@Param("name")String name,@Param("deptIds")List<Long> deptIds); |
| | | |
| | | /** |
| | | * 通过用户id获取账号 |
| | | * @param orderingPersonId |
| | | * @return |
| | | */ |
| | | SecUser selectUserById(@Param("orderingPersonId") Long orderingPersonId); |
| | | |
| | | |
| | | /** |
| | | * 查询所有用户 |
| | | * @return |
| | | */ |
| | | List<SecUser> queryList(); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.model.SecUserRole; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Mapper |
| | | public interface SecUserRoleMapper extends BaseMapper<SecUserRole> { |
| | | |
| | | /** |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | SecRole getRoleByUserId(@Param("userId") String userId); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资源表 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sec_resources") |
| | | @ApiModel(value="SecResources对象", description="资源表") |
| | | public class SecResources extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "父级id") |
| | | @TableField("parent_id") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty(value = "资源名") |
| | | @TableField("title") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "资源描述") |
| | | @TableField("descriptions") |
| | | private String descriptions; |
| | | |
| | | @ApiModelProperty(value = "排序,数字越大越靠后,最小值为0,最大值为100000") |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | |
| | | @ApiModelProperty(value = "菜单或按钮图标") |
| | | @TableField("icon") |
| | | private String icon; |
| | | |
| | | @ApiModelProperty(value = "前端页面名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "menu") |
| | | @TableField("menu") |
| | | private String menu; |
| | | |
| | | @ApiModelProperty(value = "前端文件路径") |
| | | @TableField("component") |
| | | private String component; |
| | | |
| | | @ApiModelProperty(value = "针对请求地址是否允许通过,默认不通过,设为通过则不会校验其权限") |
| | | @TableField("permit") |
| | | private Boolean permit; |
| | | |
| | | @ApiModelProperty(value = "权限类型,页面-1,按钮-2 默认页面") |
| | | @TableField("cate") |
| | | private Integer cate; |
| | | |
| | | @ApiModelProperty(value = "权限类型") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "页面是否隐藏,1是 0否(默认)") |
| | | @TableField("hidden") |
| | | private Boolean hidden; |
| | | |
| | | @ApiModelProperty(value = "1前台 2后台") |
| | | @TableField("env_port") |
| | | private Integer envPort; |
| | | |
| | | @ApiModelProperty(value = "前端页面路径") |
| | | @TableField("path") |
| | | private String path; |
| | | |
| | | @ApiModelProperty(value = "相关接口,多个逗号隔开") |
| | | @TableField("api_url") |
| | | private String apiUrl; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sec_role") |
| | | @ApiModel(value = "SecRole对象", description = "") |
| | | public class SecRole extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户组名称") |
| | | @TableField("rolename") |
| | | private String rolename; |
| | | |
| | | @ApiModelProperty(value = "角色描述") |
| | | @TableField("role_desc") |
| | | private String roleDesc; |
| | | |
| | | @ApiModelProperty(value = "是否启用 1启用 0禁用") |
| | | @TableField("role_state") |
| | | private Boolean roleState; |
| | | |
| | | @ApiModelProperty(value = "排序 倒序") |
| | | @TableField("sortBy") |
| | | private Integer sortBy; |
| | | |
| | | @ApiModelProperty(value = "资源") |
| | | @TableField(exist = false) |
| | | private List<SecResources> secResourceVOS; |
| | | |
| | | |
| | | @ApiModelProperty(value = "账号") |
| | | @TableField(exist = false) |
| | | private List<SecUser> secUsers; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sec_role_resource") |
| | | @ApiModel(value="SecRoleResource对象", description="") |
| | | public class SecRoleResource { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("role_id") |
| | | private Long roleId; |
| | | |
| | | @TableField("resource_id") |
| | | private Long resourceId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.model; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sec_user") |
| | | @ApiModel(value = "SecUser对象", description = "") |
| | | public class SecUser extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "账户") |
| | | @Length(max = 18, message = "账户最多输入18个字符") |
| | | @TableField("account") |
| | | @Excel(name = "账号_唯一:中英文1-10个字符:禁止回车、空格等特殊字符", width = 15, orderNum = "1") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | @TableField("password") |
| | | @Length(min = 6, max = 16, message = "密码可输入6~16个字符") |
| | | @Excel(name = "密码_中英文1-10个字符", width = 15, orderNum = "2") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "用户描述") |
| | | @TableField("description") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "手机号码") |
| | | @TableField("phone") |
| | | @Length(min = 6, max = 11, message = "手机号码可输入6~11位") |
| | | @NotNull(message = "手机号不可为空") |
| | | @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误") |
| | | @Excel(name = "手机号", width = 15, orderNum = "4") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "账户状态 是否禁用") |
| | | @TableField("state") |
| | | private Boolean state; |
| | | |
| | | @ApiModelProperty(value = "最近一次登陆时间") |
| | | @TableField("last_login_time") |
| | | private LocalDateTime lastLoginTime; |
| | | |
| | | @ApiModelProperty(value = "用户昵称") |
| | | @TableField("nick_name") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "微信头像地址") |
| | | @TableField("avatar_url") |
| | | private String avatarUrl; |
| | | |
| | | @ApiModelProperty(value = "省") |
| | | @TableField("province") |
| | | private String province; |
| | | |
| | | @ApiModelProperty(value = "市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty(value = "区") |
| | | @TableField("area") |
| | | private String area; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "生日") |
| | | @TableField("birthday") |
| | | private LocalDateTime birthday; |
| | | |
| | | @ApiModelProperty(value = "1男2女0未知") |
| | | @TableField("gender") |
| | | private Integer gender; |
| | | |
| | | @ApiModelProperty(value = "部门id") |
| | | @TableField("deptId") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "类型1平台管理员2验光师3员工") |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "省code") |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | @ApiModelProperty(value = "市code") |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | @ApiModelProperty(value = "区code") |
| | | @TableField("areaCode") |
| | | private String areaCode; |
| | | @ApiModelProperty(value = "图片") |
| | | @TableField("pictures") |
| | | private String pictures; |
| | | |
| | | public boolean isAdmin() |
| | | { |
| | | return isAdmin(this.id); |
| | | } |
| | | |
| | | public static boolean isAdmin(Long userId) |
| | | { |
| | | return userId != null && 1L == userId; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sec_user_role") |
| | | @ApiModel(value="SecUserRole对象", description="") |
| | | public class SecUserRole { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | @TableField("role_id") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/7/2/00211:44 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "KAM查询下级") |
| | | public class SecUserLowerQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "KAM 的 personnelStructureId") |
| | | private String kamPersonnelStructureId; |
| | | |
| | | @ApiModelProperty(value = "下级类型 6DR 7HC") |
| | | private Integer userType; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service; |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.optometrist.authority.dto.SysSourcesListDTO; |
| | | import com.jilongda.optometrist.authority.mapper.SecResourcesMapper; |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资源表 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | public interface SecResourcesService extends IService<SecResources> { |
| | | |
| | | SecResourcesMapper getSecResourcesMapper(); |
| | | |
| | | ApiResult<String> importAllSources(SysSourcesListDTO dto); |
| | | |
| | | /** |
| | | * 获取资源结构列表 |
| | | * 不会走递归 |
| | | * |
| | | * @return |
| | | */ |
| | | List<SecResourceVO> selectResources(); |
| | | /** |
| | | * 获取资源结构列表 |
| | | * 走递归 |
| | | * |
| | | * @return |
| | | */ |
| | | List<SecResourceVO> selectResourcesRecursion(); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecRoleResource; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | public interface SecRoleResourceService extends IService<SecRoleResource> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.authority.dto.SecUserQueryDTO; |
| | | import com.jilongda.optometrist.authority.mapper.SecRoleMapper; |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import com.jilongda.optometrist.authority.vo.SecUserVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | public interface SecRoleService extends IService<SecRole> { |
| | | |
| | | SecRoleMapper getSecRoleMapper(); |
| | | |
| | | PageInfo<SecUserVO> getUserByRole(SecUserQueryDTO dto); |
| | | |
| | | /** |
| | | * 根据角色id查询角色资源 |
| | | * |
| | | * @param rid |
| | | * @return |
| | | */ |
| | | List<SecResourceVO> selectRoleResourcesByRid(Long rid); |
| | | |
| | | |
| | | List<SecResourceVO> getRecursion(Long rid); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecUserRole; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | public interface SecUserRoleService extends IService<SecUserRole> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.authority.dto.SecUserDTO; |
| | | import com.jilongda.optometrist.authority.dto.SecUsersDTO; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.query.SecUserLowerQuery; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import com.jilongda.optometrist.authority.vo.SecUsersVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | public interface SecUserService extends IService<SecUser> { |
| | | |
| | | /** |
| | | * 获取用户的资源--含层级结构 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<SecResourceVO> selectUserResourcesTag(Long uid); |
| | | |
| | | /** |
| | | * 获取用户的资源--含层级结构 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<SecResourceVO> getResourceTag(Long uid); |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | PageInfo<SecUsersVO> getSysUserList(SecUsersDTO dto); |
| | | |
| | | /** |
| | | * 新增-编辑-新增或编辑用户 |
| | | * |
| | | * @param dto |
| | | */ |
| | | void addOrUpdateUser(SecUserDTO dto); |
| | | |
| | | /** |
| | | * KAM查看用户下级 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<SecUser> queryLower(SecUserLowerQuery query); |
| | | |
| | | void deleteById(Long uid); |
| | | |
| | | /** |
| | | * 通过角色id获取账号 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<SecUser> getUserByRoleId(Long id); |
| | | |
| | | /** |
| | | * 通过名称手机号查询用户部门id |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<SecUser> selectListByNamePhoneDeptId(String name,Long deptId); |
| | | /** |
| | | * 通过名称手机号查询用户部门id集合 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<SecUser> selectListByNamePhoneDeptIds(String name,List<Long> deptIds); |
| | | |
| | | /** |
| | | * 通过id查询用户 |
| | | * @param orderingPersonId |
| | | * @return |
| | | */ |
| | | SecUser selectUserById(Long orderingPersonId); |
| | | |
| | | /** |
| | | * 查询所有用户 |
| | | * @return |
| | | */ |
| | | List<SecUser> queryList(); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.utils.SpringUtils; |
| | | import com.jilongda.optometrist.authority.dto.Btn; |
| | | import com.jilongda.optometrist.authority.dto.SysSourcesDTO; |
| | | import com.jilongda.optometrist.authority.dto.SysSourcesListDTO; |
| | | import com.jilongda.optometrist.authority.mapper.SecResourcesMapper; |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import com.jilongda.optometrist.authority.service.SecResourcesService; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | | |
| | | import static java.util.Comparator.comparing; |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | /** |
| | | * <p> |
| | | * 资源表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Service |
| | | public class SecResourcesServiceImpl extends ServiceImpl<SecResourcesMapper, SecResources> implements SecResourcesService { |
| | | |
| | | @Autowired |
| | | private SecResourcesMapper secResourcesMapper; |
| | | |
| | | @Override |
| | | public SecResourcesMapper getSecResourcesMapper() { |
| | | return secResourcesMapper; |
| | | } |
| | | |
| | | @Override |
| | | public ApiResult<String> importAllSources(SysSourcesListDTO dto) { |
| | | try { |
| | | secResourcesMapper.delete(Wrappers.lambdaQuery(SecResources.class).eq(SecResources::getIsDelete, false)); |
| | | |
| | | List<SysSourcesDTO> menus = dto.getMenus(); |
| | | for (SysSourcesDTO sources : menus) { |
| | | importMenu(sources, 0L); |
| | | } |
| | | return ApiResult.success(); |
| | | } catch (Exception e) { |
| | | return ApiResult.failed(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<SecResourceVO> selectResources() { |
| | | List<SecResources> allResources = secResourcesMapper.selectList(Wrappers.lambdaQuery(SecResources.class) |
| | | .ne(SecResources::getHidden,1)); |
| | | SecResourceVO item; |
| | | //获取根节点的集合 |
| | | List<SecResourceVO> root = new ArrayList<>(); |
| | | Map<Long, SecResourceVO> tempMap = new HashMap<>(3); |
| | | //子节点集合 |
| | | SecResourceVO parent; |
| | | for (SecResources resources : allResources) { |
| | | item = SpringUtils.beanCopy(resources, SecResourceVO.class); |
| | | //每次循环都将集合重新循环添加到父集合中 |
| | | tempMap.put(resources.getId(), item); |
| | | parent = tempMap.get(resources.getParentId()); |
| | | if (Objects.nonNull(parent)) { |
| | | //父集合不为空时,获取下级集合 |
| | | //子节点集合 |
| | | parent.getChildren().add(item); |
| | | // 对子集排序,升序 |
| | | parent.getChildren().sort(comparing(SecResourceVO::getSort)); |
| | | } else { |
| | | //根集合 |
| | | root.add(item); |
| | | // 对根集合排序,升序 |
| | | root.sort(comparing(SecResourceVO::getSort)); |
| | | } |
| | | } |
| | | return root; |
| | | } |
| | | |
| | | @Override |
| | | public List<SecResourceVO> selectResourcesRecursion() { |
| | | List<SecResourceVO> resourceVOS = secResourcesMapper.allList(); |
| | | // 判空 |
| | | if (CollectionUtils.isEmpty(resourceVOS)) |
| | | return Lists.newArrayList(); |
| | | |
| | | // 找出所有父级 |
| | | List<SecResourceVO> parent = resourceVOS.stream().filter(resource -> resource.getParentId()==0).collect(toList()); |
| | | // 通过父级递归子集 |
| | | getChildren(resourceVOS,parent); |
| | | |
| | | return parent; |
| | | } |
| | | |
| | | private void getChildren(List<SecResourceVO> resourceVOS, List<SecResourceVO> parentList) { |
| | | parentList.forEach(parent -> { |
| | | List<SecResourceVO> childrenList = resourceVOS.stream().filter(region -> region.getParentId().equals(parent.getId())).collect(toList()); |
| | | parent.setChildren(childrenList); |
| | | if (!CollectionUtils.isEmpty(childrenList)) |
| | | getChildren(resourceVOS,childrenList); |
| | | }); |
| | | } |
| | | |
| | | private void importMenu(SysSourcesDTO sources, Long parentId) { |
| | | //装填本体 |
| | | SecResources resources = new SecResources(); |
| | | if ("0".equals(parentId)) { |
| | | resources.setType(1); |
| | | } else { |
| | | resources.setType(2); |
| | | } |
| | | if (Objects.nonNull(sources.getMeta())) { |
| | | resources.setMenu(sources.getMeta().getParent()); |
| | | resources.setTitle(sources.getMeta().getTitle()); |
| | | } |
| | | resources.setParentId(parentId); |
| | | resources.setIcon(sources.getIcon()); |
| | | resources.setPath(sources.getPath()); |
| | | resources.setName(sources.getName()); |
| | | resources.setComponent(sources.getComponent()); |
| | | if (Objects.nonNull(sources.getHidden())) { |
| | | resources.setHidden(sources.getHidden()); |
| | | } |
| | | //存储本体 |
| | | secResourcesMapper.insert(resources); |
| | | //判断是否有btn按钮,有则存储 |
| | | if (!CollectionUtils.isEmpty(sources.getBtn())) { |
| | | setButtons(sources.getBtn(), resources.getId()); |
| | | } |
| | | //判断是否存在子菜单,存在则递归存储 |
| | | if (!CollectionUtils.isEmpty(sources.getChildren())) { |
| | | for (SysSourcesDTO nextSources : sources.getChildren()) { |
| | | importMenu(nextSources, resources.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void setButtons(List<Btn> buttons, Long parentId) { |
| | | for (Btn button : buttons) { |
| | | SecResources btn = new SecResources(); |
| | | btn.setType(3); |
| | | btn.setTitle(button.getTitle()); |
| | | btn.setName(button.getName()); |
| | | btn.setParentId(parentId); |
| | | secResourcesMapper.insert(btn); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.authority.mapper.SecRoleResourceMapper; |
| | | import com.jilongda.optometrist.authority.model.SecRoleResource; |
| | | import com.jilongda.optometrist.authority.service.SecRoleResourceService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Service |
| | | public class SecRoleResourceServiceImpl extends ServiceImpl<SecRoleResourceMapper, SecRoleResource> implements SecRoleResourceService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.optometrist.authority.mapper.SecResourcesMapper; |
| | | import com.jilongda.optometrist.authority.mapper.SecRoleMapper; |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.utils.SpringUtils; |
| | | import com.jilongda.optometrist.authority.dto.SecUserQueryDTO; |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.service.SecRoleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import com.jilongda.optometrist.authority.vo.SecUserVO; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Service |
| | | public class SecRoleServiceImpl extends ServiceImpl<SecRoleMapper, SecRole> implements SecRoleService { |
| | | |
| | | @Autowired |
| | | private SecRoleMapper secRoleMapper; |
| | | @Autowired |
| | | private SecResourcesMapper secResourcesMapper; |
| | | |
| | | @Override |
| | | public SecRoleMapper getSecRoleMapper() { |
| | | return secRoleMapper; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<SecUserVO> getUserByRole(SecUserQueryDTO dto) { |
| | | PageInfo<SecUserVO> pageInfo = new PageInfo<SecUserVO>(dto.getPageNum(), dto.getPageSize()); |
| | | List<SecUserVO> secUserVOS = secRoleMapper.getUserByRole(dto, pageInfo); |
| | | pageInfo.setRecords(secUserVOS); |
| | | // 获取列表 |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public List<SecResourceVO> selectRoleResourcesByRid(Long rid) { |
| | | List<SecResources> allResources = secResourcesMapper.selectList(Wrappers.emptyWrapper()); |
| | | List<Long> resourceIds = secRoleMapper.selectResByRid(rid); |
| | | SecResourceVO item; |
| | | //获取根节点的集合 |
| | | List<SecResourceVO> root = new ArrayList<>(); |
| | | Map<Long, SecResourceVO> tempMap = new HashMap<>(3); |
| | | //子节点集合 |
| | | SecResourceVO parent; |
| | | for (SecResources resources : allResources) { |
| | | item = SpringUtils.beanCopy(resources, SecResourceVO.class); |
| | | if (resourceIds.contains(resources.getId())) { |
| | | item.setFlag(true); |
| | | } |
| | | //每次循环都将集合重新循环添加到父集合中 |
| | | tempMap.put(resources.getId(), item); |
| | | parent = tempMap.get(resources.getParentId()); |
| | | if (null != parent) { |
| | | //父集合不为空时,获取下级集合 |
| | | //子节点集合 |
| | | parent.getChildren().add(item); |
| | | } else { |
| | | //根集合 |
| | | root.add(item); |
| | | } |
| | | } |
| | | return root; |
| | | } |
| | | |
| | | @Override |
| | | public List<SecResourceVO> getRecursion(Long rid) { |
| | | List<SecResourceVO> secResourceVOS = secResourcesMapper.getList(rid); |
| | | // 判空 |
| | | if (CollectionUtils.isEmpty(secResourceVOS)) |
| | | return Lists.newArrayList(); |
| | | // 找出所有父级 |
| | | List<SecResourceVO> parent = secResourceVOS.stream().filter(resourceVO -> resourceVO.getParentId().equals("0")).collect(toList()); |
| | | // 通过父级递归子集 |
| | | getChildren(secResourceVOS,parent); |
| | | return parent; |
| | | } |
| | | |
| | | private void getChildren(List<SecResourceVO> secResourceVOS, List<SecResourceVO> parentList) { |
| | | parentList.forEach(parent -> { |
| | | List<SecResourceVO> childrenList = secResourceVOS.stream().filter(resourceVO -> resourceVO.getParentId().equals(parent.getId())).collect(toList()); |
| | | parent.setChildren(childrenList); |
| | | if (!CollectionUtils.isEmpty(childrenList)) |
| | | getChildren(secResourceVOS,childrenList); |
| | | }); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.authority.mapper.SecUserRoleMapper; |
| | | import com.jilongda.optometrist.authority.model.SecUserRole; |
| | | import com.jilongda.optometrist.authority.service.SecUserRoleService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Service |
| | | public class SecUserRoleServiceImpl extends ServiceImpl<SecUserRoleMapper, SecUserRole> implements SecUserRoleService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.exception.ServiceException; |
| | | import com.jilongda.common.utils.SpringUtils; |
| | | import com.jilongda.optometrist.authority.dto.SecUserDTO; |
| | | import com.jilongda.optometrist.authority.dto.SecUsersDTO; |
| | | import com.jilongda.optometrist.authority.mapper.SecResourcesMapper; |
| | | import com.jilongda.optometrist.authority.mapper.SecRoleMapper; |
| | | import com.jilongda.optometrist.authority.mapper.SecUserMapper; |
| | | import com.jilongda.optometrist.authority.mapper.SecUserRoleMapper; |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.model.SecUserRole; |
| | | import com.jilongda.optometrist.authority.query.SecUserLowerQuery; |
| | | import com.jilongda.optometrist.authority.service.SecUserService; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import com.jilongda.optometrist.authority.vo.SecUsersVO; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static java.util.Comparator.comparing; |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-06-08 |
| | | */ |
| | | @Service |
| | | public class SecUserServiceImpl extends ServiceImpl<SecUserMapper, SecUser> implements SecUserService { |
| | | |
| | | @Autowired |
| | | private SecResourcesMapper secResourcesMapper; |
| | | @Autowired |
| | | private SecUserMapper secUserMapper; |
| | | @Autowired |
| | | private SecUserRoleMapper secUserRoleMapper; |
| | | @Autowired |
| | | private PasswordEncoder passwordEncoder; |
| | | @Autowired |
| | | private SecRoleMapper secRoleMapper; |
| | | |
| | | @Override |
| | | public List<SecResourceVO> selectUserResourcesTag(Long uid) { |
| | | List<SecResources> sysResources = secResourcesMapper.selectResourceByUid(uid); |
| | | List<Long> resourcesIds = sysResources.stream().map(SecResources::getId).collect(Collectors.toList()); |
| | | // 排序会导致结构问题 |
| | | List<SecResources> allResources = secResourcesMapper.selectList(Wrappers.lambdaQuery(SecResources.class)); |
| | | SecResourceVO item; |
| | | //获取根节点的集合 |
| | | List<SecResourceVO> root = new ArrayList<>(); |
| | | Map<Long, SecResourceVO> tempMap = new HashMap<>(3); |
| | | //子节点集合 |
| | | SecResourceVO parent; |
| | | for (SecResources resources : allResources) { |
| | | item = SpringUtils.beanCopy(resources, SecResourceVO.class); |
| | | if (resourcesIds.contains(resources.getId())) { |
| | | item.setFlag(true); |
| | | } else { |
| | | item.setFlag(false); |
| | | } |
| | | //每次循环都将集合重新循环添加到父集合中 |
| | | tempMap.put(resources.getId(), item); |
| | | parent = tempMap.get(resources.getParentId()); |
| | | if (Objects.nonNull(parent)) { |
| | | //父集合不为空时,获取下级集合,追加子集合 |
| | | parent.getChildren().add(item); |
| | | // 对子集排序,升序 |
| | | parent.getChildren().sort(comparing(SecResourceVO::getSort)); |
| | | } else { |
| | | //根集合 |
| | | root.add(item); |
| | | // 对根排序,升序 |
| | | root.sort(comparing(SecResourceVO::getSort)); |
| | | } |
| | | } |
| | | return root; |
| | | } |
| | | |
| | | @Override |
| | | public List<SecResourceVO> getResourceTag(Long uid) { |
| | | List<SecResources> sysResources = secResourcesMapper.selectResourceByUid(uid); |
| | | // 判空 |
| | | if (CollectionUtils.isEmpty(sysResources)) |
| | | return Lists.newArrayList(); |
| | | |
| | | // 找出所有父级 |
| | | List<SecResources> parent = sysResources.stream().filter(resources -> resources.getParentId()==0).collect(Collectors.toList()); |
| | | List<SecResourceVO> parentList = new ArrayList<>(); |
| | | for (SecResources secResources : parent) { |
| | | SecResourceVO secResourceVO = SpringUtils.beanCopy(secResources, SecResourceVO.class); |
| | | parentList.add(secResourceVO); |
| | | } |
| | | // 通过父级递归子集 |
| | | getChildren(sysResources, parentList); |
| | | return parentList; |
| | | } |
| | | |
| | | private void getChildren(List<SecResources> sysResources, List<SecResourceVO> parentList) { |
| | | parentList.forEach(parent -> { |
| | | List<SecResources> childrenList = sysResources.stream().filter(resources -> resources.getParentId().equals(parent.getId())).collect(toList()); |
| | | List<SecResourceVO> childrens = new ArrayList<>(); |
| | | for (SecResources secResources : childrenList) { |
| | | SecResourceVO secResourceVO = SpringUtils.beanCopy(secResources, SecResourceVO.class); |
| | | childrens.add(secResourceVO); |
| | | } |
| | | parent.setChildren(childrens); |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(childrenList)) |
| | | getChildren(sysResources, childrens); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 后台系统用户列表 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<SecUsersVO> getSysUserList(SecUsersDTO dto) { |
| | | PageInfo<SecUsersVO> pageInfo = new PageInfo<>(dto.getPageNum(), dto.getPageSize()); |
| | | // 查询角色 |
| | | List<SecUsersVO> sysUserListVOS = secUserMapper.getSecUserList(dto, pageInfo); |
| | | // List<SecRole> secRoles = secRoleMapper.selectList(Wrappers.lambdaQuery(SecRole.class)); |
| | | |
| | | |
| | | // for (SecUsersVO sysUserListVO : sysUserListVOS) { |
| | | // List<SecRole> roles = secRoles.stream().filter(role -> Objects.nonNull(sysUserListVO.getRoleId()) && sysUserListVO.getRoleId().equals(role.getId())).collect(toList()); |
| | | // sysUserListVO.setSecRole(CollectionUtils.isNotEmpty(roles) ? roles.get(0) : null); |
| | | // tDepts.stream().filter(dept -> Objects.nonNull(sysUserListVO.getDeptId()) && sysUserListVO.getDeptId().equals(dept.getId())).forEach(dept -> { |
| | | // sysUserListVO.setDeptName(dept.getDeptName()); |
| | | // }); |
| | | // } |
| | | pageInfo.setRecords(sysUserListVOS); |
| | | // 获取列表 |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public void addOrUpdateUser(SecUserDTO dto) { |
| | | if (Objects.isNull(dto.getId())) { |
| | | // 检查登陆账号是否存在 |
| | | SecUser sysUser = secUserMapper.selectOne(new LambdaQueryWrapper<SecUser>() |
| | | .eq(SecUser::getPhone, dto.getPhone())); |
| | | if (Objects.nonNull(sysUser)) { |
| | | throw new ServiceException("该账号已存在,请勿重复注册"); |
| | | } |
| | | dto.setAccount(dto.getPhone()); |
| | | dto.setUserType(3); |
| | | dto.setLastLoginTime(LocalDateTime.now()); |
| | | if (StringUtils.hasLength(dto.getPassword())) { |
| | | dto.setPassword(passwordEncoder.encode(dto.getPassword())); |
| | | } |
| | | secUserMapper.insert(dto); |
| | | } else { |
| | | if (StringUtils.hasLength(dto.getPassword())) { |
| | | dto.setPassword(passwordEncoder.encode(dto.getPassword())); |
| | | } |
| | | secUserMapper.updateById(dto); |
| | | // 删除之前的 |
| | | secUserRoleMapper.delete(Wrappers.lambdaQuery(SecUserRole.class).eq(SecUserRole::getUserId, dto.getId())); |
| | | } |
| | | SecUserRole sur = new SecUserRole(); |
| | | sur.setRoleId(dto.getRoleId()); |
| | | sur.setUserId(dto.getId()); |
| | | secUserRoleMapper.insert(sur); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<SecUser> queryLower(SecUserLowerQuery query) { |
| | | PageInfo<SecUser> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<SecUser> secUserList = secUserMapper.queryLower(query, pageInfo); |
| | | pageInfo.setRecords(secUserList); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Long uid) { |
| | | secUserMapper.removeById(uid); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<SecUser> getUserByRoleId(Long id) { |
| | | return secUserMapper.getUserByRoleId(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<SecUser> selectListByNamePhoneDeptId(String name,Long deptId) { |
| | | return secUserMapper.selectListByNamePhoneDeptId(name,deptId); |
| | | } |
| | | |
| | | @Override |
| | | public List<SecUser> selectListByNamePhoneDeptIds(String name, List<Long> deptIds) { |
| | | return secUserMapper.selectListByNamePhoneDeptIds(name,deptIds); |
| | | } |
| | | |
| | | @Override |
| | | public SecUser selectUserById(Long orderingPersonId) { |
| | | return secUserMapper.selectUserById(orderingPersonId); |
| | | } |
| | | |
| | | @Override |
| | | public List<SecUser> queryList() { |
| | | return secUserMapper.queryList(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.vo; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author madman |
| | | * @version 1.0 |
| | | * @date 2019/8/13 11:56 |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @ApiModel(value = "资源vo") |
| | | public class SecResourceVO extends SecResources { |
| | | private static final long serialVersionUID = 2932580245701601388L; |
| | | @ApiModelProperty(value = "用户是否拥有此权限") |
| | | private Boolean flag; |
| | | |
| | | @ApiModelProperty(value = "子集列表,无则为[]") |
| | | private List<SecResourceVO> children = new ArrayList<>(); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.vo; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName SysUserRoleResouceVo |
| | | * @Description |
| | | * @date 2020-09-23 16:03 |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | public class SecUserRoleResouceVO extends SecUser { |
| | | private static final long serialVersionUID = -4099422915334750845L; |
| | | /** |
| | | * 角色 |
| | | */ |
| | | List<SecRole> roles; |
| | | |
| | | /** |
| | | * 资源 |
| | | */ |
| | | List<SecResources> resources; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 10:42 |
| | | */ |
| | | @Data |
| | | @ApiModel("系统用户列表vo实体(通过Role查询)") |
| | | public class SecUserVO { |
| | | |
| | | @ApiModelProperty("角色id") |
| | | private Integer roleId; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("账号姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("登陆账号") |
| | | private String account; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.authority.vo; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/9/3 10:42 |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @ApiModel("系统用户列表vo实体") |
| | | public class SecUsersVO extends SecUser { |
| | | private static final long serialVersionUID = 8351204679799277051L; |
| | | @ApiModelProperty("角色名称") |
| | | private String rolename; |
| | | |
| | | @ApiModelProperty("角色id") |
| | | private String roleId; |
| | | |
| | | @ApiModelProperty("角色") |
| | | private SecRole secRole; |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String deptName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.component; |
| | | |
| | | |
| | | import com.aliyun.oss.OSS; |
| | | import com.aliyun.oss.OSSClientBuilder; |
| | | import com.aliyun.oss.common.utils.BinaryUtil; |
| | | import com.aliyun.oss.model.MatchMode; |
| | | import com.aliyun.oss.model.OSSObject; |
| | | import com.aliyun.oss.model.PolicyConditions; |
| | | import com.aliyun.oss.model.PutObjectResult; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.component.AliOss; |
| | | import com.jilongda.common.utils.WebUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * @author feiyunchuan |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "Ali-OSS文件上传接口") |
| | | @RestController |
| | | @RequestMapping("/ali-obs/") |
| | | public class AliOssManageFileUploadController { |
| | | |
| | | @Value("${file.cdn:https://nncdn.pharmacylinked.com}") |
| | | private String FILE_CDN; |
| | | |
| | | @ApiOperation(value = "服务端上传", notes = "服务端上传") |
| | | @PostMapping(value = "upload") |
| | | public ApiResult<String> fileUpload(@RequestParam(value = "file") MultipartFile file) throws IOException { |
| | | InputStream inputStream = file.getInputStream(); |
| | | String filename = System.currentTimeMillis() + file.getOriginalFilename(); |
| | | // Endpoint以杭州为例,其它Region请按实际情况填写。 |
| | | final String endpoint = AliOss.endpoint; |
| | | // 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。 |
| | | final String accessKeyId = AliOss.accessKeyId; |
| | | final String accessKeySecret = AliOss.accessKeySecret; |
| | | final String bucketName = AliOss.bucketName; |
| | | // <yourObjectName>上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。 |
| | | String objectName = AliOss.dir + filename; |
| | | log.info(objectName); |
| | | // 创建OSSClient实例。 |
| | | OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); |
| | | // 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件流。 |
| | | // InputStream inputStream = new FileInputStream("D:\\localpath\\examplefile.txt"); |
| | | // 依次填写Bucket名称(例如examplebucket)和Object完整路径(例如exampledir/exampleobject.txt)。Object完整路径中不能包含Bucket名称。 |
| | | PutObjectResult putObjectResult = ossClient.putObject(bucketName, objectName, inputStream); |
| | | log.info("上传结果:{}", putObjectResult); |
| | | OSSObject ossObject = ossClient.getObject(bucketName, objectName); |
| | | String uri = ossObject.getResponse().getUri(); |
| | | // 关闭OSSClient。 |
| | | ossClient.shutdown(); |
| | | // uri = uri.replace("http://nn-bucket.oss-cn-shanghai.aliyuncs.com",FILE_CDN); |
| | | return ApiResult.okmsg(uri); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "服务端签名后直传", notes = "服务端签名后直传") |
| | | @PostMapping("signature") |
| | | public ApiResult<Map<String, String>> signature() { |
| | | OSS builder = new OSSClientBuilder().build(AliOss.endpoint, AliOss.accessKeyId, AliOss.accessKeySecret); |
| | | long expireTime = 30; |
| | | long expireEndTime = System.currentTimeMillis() + expireTime * 1000; |
| | | Date expiration = new Date(expireEndTime); |
| | | PolicyConditions policyConds = new PolicyConditions(); |
| | | policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 1048576000); |
| | | policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, AliOss.dir); |
| | | String postPolicy = builder.generatePostPolicy(expiration, policyConds); |
| | | byte[] binaryData = postPolicy.getBytes(StandardCharsets.UTF_8); |
| | | String encodedPolicy = BinaryUtil.toBase64String(binaryData); |
| | | String postSignature = builder.calculatePostSignature(postPolicy); |
| | | Map<String, String> respMap = new LinkedHashMap<>(6); |
| | | respMap.put("accessid", AliOss.accessKeyId); |
| | | respMap.put("policy", encodedPolicy); |
| | | respMap.put("signature", postSignature); |
| | | // 示例为dir |
| | | respMap.put("dir", AliOss.dir); |
| | | // 前端为key |
| | | // respMap.put("key", AliOss.dir); |
| | | respMap.put("host", AliOss.host); |
| | | // respMap.put("cdn", AliOss.cdn); |
| | | respMap.put("expire", String.valueOf(expireEndTime / 1000)); |
| | | // // 回调 |
| | | // if (StringUtils.hasLength(AliOss.callbackUrl)) { |
| | | // JSONObject jasonCallback = new JSONObject(); |
| | | // jasonCallback.put("callbackUrl", AliOss.callbackUrl); |
| | | // String callbackBody = "{\"filename\":${object},\"size\":${size},\"mimeType\":${mimeType}}"; |
| | | // jasonCallback.put("callbackBody", callbackBody); |
| | | // jasonCallback.put("callbackBodyType", "application/json"); |
| | | // String base64CallbackBody = BinaryUtil.toBase64String(jasonCallback.toString().getBytes()); |
| | | // respMap.put("callback", base64CallbackBody); |
| | | // } |
| | | |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "GET, POST"); |
| | | |
| | | // 关闭OSSClient。 |
| | | builder.shutdown(); |
| | | return ApiResult.success(respMap); |
| | | } |
| | | |
| | | @ApiOperation(value = "服务端上传(二进制字符串)", notes = "服务端上传") |
| | | @PostMapping(value = "str/upload") |
| | | public String strUpload(InputStream inputStream, String filename) throws IOException { |
| | | //String filename = System.currentTimeMillis() + CodeGenerateUtils.generateVolumeSn()+".jpg"; |
| | | // Endpoint以杭州为例,其它Region请按实际情况填写。 |
| | | final String endpoint = AliOss.endpoint; |
| | | // 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。 |
| | | final String accessKeyId = AliOss.accessKeyId; |
| | | final String accessKeySecret = AliOss.accessKeySecret; |
| | | final String bucketName = AliOss.bucketName; |
| | | // <yourObjectName>上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。 |
| | | String objectName = AliOss.dir + filename; |
| | | log.info(objectName); |
| | | // 创建OSSClient实例。 |
| | | OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); |
| | | // 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件流。 |
| | | // InputStream inputStream = new FileInputStream("D:\\localpath\\examplefile.txt"); |
| | | // 依次填写Bucket名称(例如examplebucket)和Object完整路径(例如exampledir/exampleobject.txt)。Object完整路径中不能包含Bucket名称。 |
| | | PutObjectResult putObjectResult = ossClient.putObject(bucketName, objectName, inputStream); |
| | | log.info("上传结果:{}", putObjectResult); |
| | | OSSObject ossObject = ossClient.getObject(bucketName, objectName); |
| | | String uri = ossObject.getResponse().getUri(); |
| | | // 关闭OSSClient。 |
| | | ossClient.shutdown(); |
| | | return uri; |
| | | } |
| | | |
| | | /** |
| | | * oss上传成功回调 |
| | | * |
| | | * @param callback |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "oss回调", notes = "oss回调") |
| | | @PostMapping(value = "/callback") |
| | | public ApiResult callback(@RequestBody Map<String, Object> callback) { |
| | | log.info("oss回调{}", callback); |
| | | String filename = "http://".concat(AliOss.bucketName).concat(".").concat(AliOss.endpoint).concat("/").concat(callback.get("filename").toString()); |
| | | return ApiResult.okmsg(filename); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.component; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName AliOss |
| | | * @Description |
| | | * @date 2020-04-15 10:23 |
| | | */ |
| | | public class AliOssMange { |
| | | /** |
| | | * 请填写您的AccessKeyId。LTAI5tPbJsVfBZZTPqPe8A2r |
| | | */ |
| | | public static final String accessKeyId = "LTAI5tQZzqsZYX5gw8yRNchQ"; |
| | | // public static final String accessKeyId = "LTAI5tPbJsVfBZZTPqPe8A2r"; |
| | | /** |
| | | * 请填写您的AccessKeySecret。 |
| | | */ |
| | | public static final String accessKeySecret = "5yJVdXwRzwPZwKKXp07lRAc7tkTxQp"; |
| | | // public static final String accessKeySecret = "BvRc85RcX0bgrl9TMUOGHEMLUPlCr2"; |
| | | /** |
| | | * 请填写您的 endpoint。 |
| | | */ |
| | | public static final String endpoint = "oss-cn-hongkong.aliyuncs.com"; |
| | | /** |
| | | * 请填写您的 bucketname 。 |
| | | */ |
| | | // public static final String bucketName = "sales-bucket"; |
| | | public static final String bucketName = "bizuphk"; |
| | | /** |
| | | * cdn |
| | | */ |
| | | // public static final String cdn = "https://cdn.pharmacylinked.com"; |
| | | // public static final String cdn = "https://nncdn.pharmacylinked.com"; |
| | | /** |
| | | * host的格式为 bucketname.endpoint |
| | | */ |
| | | public static final String host = "https://" + bucketName + "." + endpoint; |
| | | |
| | | // 此处不需要回调 |
| | | // callbackUrl为上传回调服务器的URL,请将下面的IP和Port配置为您自己的真实信息。 |
| | | public static final String callbackUrl = "https://alwaystest.xisheninfo.com/api/ali-oss/callback"; |
| | | public static String dir = "hollywood/"; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | |
| | | import java.util.concurrent.Executor; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | |
| | | @Configuration |
| | | @EnableAsync |
| | | public class AsyncConfiguration { |
| | | |
| | | @Bean("fileDownloadExecutor") |
| | | public Executor fileDownloadExecutor() { |
| | | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
| | | // 核心线程数:线程池创建时候初始化的线程数 |
| | | executor.setCorePoolSize(10); |
| | | // 最大线程数:线程池最大的线程数,只有在缓冲队列满了之后才会申请超过核心线程数的线程 |
| | | executor.setMaxPoolSize(20); |
| | | // 缓冲队列:用来缓冲执行任务的队列 |
| | | executor.setQueueCapacity(500); |
| | | // 允许线程的空闲时间60秒:当超过了核心线程之外的线程在空闲时间到达之后会被销毁 |
| | | executor.setKeepAliveSeconds(60); |
| | | // 线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池 |
| | | executor.setThreadNamePrefix("fileDownload-"); |
| | | // 缓冲队列满了之后的拒绝策略:由调用线程处理(一般是主线程) |
| | | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy()); |
| | | executor.initialize(); |
| | | return executor; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.config; |
| | | |
| | | import com.jilongda.optometrist.security.SecurityAccessDeniedHandler; |
| | | import com.jilongda.optometrist.security.SysUserDetailsService; |
| | | import com.jilongda.common.basic.Constant; |
| | | import com.jilongda.common.cache.CaffineCache; |
| | | import com.jilongda.common.security.SecurityUtils; |
| | | import com.jilongda.common.security.filter.AuthenticationFilter; |
| | | import com.jilongda.common.security.hadler.SecurityAuthenticationEntryPoint; |
| | | import com.jilongda.optometrist.security.AuthenticationProvider; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; |
| | | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; |
| | | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| | | import org.springframework.security.config.annotation.web.builders.WebSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; |
| | | import org.springframework.security.config.http.SessionCreationPolicy; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; |
| | | |
| | | /** |
| | | * 细粒度的访问控制 |
| | | * <p> |
| | | * 注:需要使用注解@EnableGlobalMethodSecurity(prePostEnabled=true) 开启 |
| | | * |
| | | * @author xiaochen |
| | | */ |
| | | @Configuration |
| | | @EnableWebSecurity |
| | | @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) |
| | | public class WebSecurityConfig extends WebSecurityConfigurerAdapter { |
| | | private final CaffineCache<String> accessTokenCache; |
| | | private final CaffineCache<String> refreshTokenCache; |
| | | private final PasswordEncoder passwordEncoder; |
| | | private final SecurityAccessDeniedHandler securityAccessDeniedHandler; |
| | | private final SecurityAuthenticationEntryPoint securityAuthenticationEntryPoint; |
| | | private final SysUserDetailsService loadUserDetailsService; |
| | | |
| | | |
| | | @Autowired |
| | | public WebSecurityConfig(CaffineCache<String> accessTokenCache, CaffineCache<String> refreshTokenCache, PasswordEncoder passwordEncoder, SecurityAccessDeniedHandler securityAccessDeniedHandler, SecurityAuthenticationEntryPoint securityAuthenticationEntryPoint, SysUserDetailsService loadUserDetailsService) { |
| | | this.accessTokenCache = accessTokenCache; |
| | | this.refreshTokenCache = refreshTokenCache; |
| | | this.passwordEncoder = passwordEncoder; |
| | | this.securityAccessDeniedHandler = securityAccessDeniedHandler; |
| | | this.securityAuthenticationEntryPoint = securityAuthenticationEntryPoint; |
| | | this.loadUserDetailsService = loadUserDetailsService; |
| | | } |
| | | |
| | | /** |
| | | * 应用重启token无效,可手动使令牌无效,管理了token的生命周期 |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public SecurityUtils securityUtils() { |
| | | // return new SecurityUtils(accessTokenCache,refreshTokenCache); |
| | | return new SecurityUtils(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 不需要认证的在此处放行,比如系统的一些字典请求 |
| | | * 会包含Basic认证的请求。意思是如果请求在Basic中存在,在此处也存在,那么该请求的认证会被忽略 |
| | | * 这种方式的优势是不走 Spring Security 过滤器链 |
| | | * |
| | | * @param web |
| | | */ |
| | | @Override |
| | | public void configure(WebSecurity web) { |
| | | web.ignoring().antMatchers(Constant.DOC_LIST); |
| | | web.ignoring().antMatchers(Constant.AUTH_WHITELIST); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 使用自定义登录身份认证组件,自实现rest登录请求,不适用于在过滤其中实现 在过滤其中无法提供接口文档,维护不方便 |
| | | * |
| | | * @param auth |
| | | */ |
| | | @Override |
| | | public void configure(AuthenticationManagerBuilder auth) { |
| | | auth.authenticationProvider(new AuthenticationProvider(loadUserDetailsService, passwordEncoder)); |
| | | } |
| | | |
| | | /** |
| | | * Security各项配置 |
| | | * |
| | | * @param http |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | protected void configure(HttpSecurity http) throws Exception { |
| | | // 需要Basic认证的请求 |
| | | http |
| | | .cors().disable() |
| | | // 关闭登录,自定义接口实现 |
| | | .formLogin().disable() |
| | | // 关闭httpBasic认证 |
| | | .httpBasic().disable() |
| | | // 关闭退出,自定义接口实现 |
| | | .logout().disable() |
| | | .csrf().disable() |
| | | // 放在 Cookie 中返回前端,防止跨域伪造 |
| | | //.csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()).and() |
| | | //.and() |
| | | .authorizeRequests() |
| | | // 跨域预检请求 |
| | | // .antMatchers(HttpMethod.OPTIONS, "/**").permitAll() |
| | | // 登录URL permitAll() 无需保护 ---> 此种方式配置忽略认证规则会走Spring Security 过滤器链,在过滤器链中,给请求放行 |
| | | // 不需要保护的请求,但需要经过过滤连 |
| | | .antMatchers(HttpMethod.POST, "/**").permitAll() |
| | | // 其他都需要权限认证 |
| | | .anyRequest() |
| | | .authenticated() |
| | | // RBAC 动态 url 认证 |
| | | //.access("@rbacAuthorityService.hasPermission(request,authentication)") |
| | | // 其他所有请求需要身份认证 |
| | | .and() |
| | | // 异常拦截 |
| | | .exceptionHandling() |
| | | // 认证过的用户访问没有权限资源的处理 |
| | | .accessDeniedHandler(securityAccessDeniedHandler) |
| | | // 未授权用户访问无权限时的处理 |
| | | .authenticationEntryPoint(securityAuthenticationEntryPoint) |
| | | .and() |
| | | .sessionManagement() |
| | | .maximumSessions(5); |
| | | // 此处存在session共享的问题,如要共享session,则需要管理 |
| | | http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); |
| | | // 访问控制时登录状态检查过滤器 |
| | | http.addFilterBefore(new AuthenticationFilter(securityUtils()), UsernamePasswordAuthenticationFilter.class); |
| | | //禁用缓存 |
| | | http.headers().cacheControl(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 验证管理器,在登录接口时用到 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Bean |
| | | @Override |
| | | public AuthenticationManager authenticationManager() throws Exception { |
| | | return super.authenticationManager(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.optometrist.dto.SecFeeItemsDTO; |
| | | import com.jilongda.optometrist.model.SecFeeItems; |
| | | import com.jilongda.optometrist.service.SecFeeItemsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置-收费项设置 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "收费项设置") |
| | | @RestController |
| | | @RequestMapping("/sec-fee-items") |
| | | public class SecFeeItemsController { |
| | | |
| | | |
| | | @Autowired |
| | | private SecFeeItemsService secFeeItemsService; |
| | | |
| | | /** |
| | | * 收费项设置 |
| | | */ |
| | | @ApiOperation(value = "收费项设置查询列表") |
| | | @PostMapping(value = "/list") |
| | | public ApiResult<List<SecFeeItems>> list() { |
| | | return ApiResult.success(secFeeItemsService.list()); |
| | | } |
| | | |
| | | /** |
| | | * 查询详情 |
| | | */ |
| | | @ApiOperation(value = "收费项设置修改") |
| | | @PostMapping(value = "/updateList") |
| | | public ApiResult<String> updateList(@RequestBody SecFeeItemsDTO dto ) { |
| | | List<SecFeeItems> secFeeItemsList = dto.getSecFeeItemsList(); |
| | | secFeeItemsService.saveOrUpdateBatch(secFeeItemsList); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "收费项设置启用禁用") |
| | | @GetMapping(value = "/upAndDown") |
| | | public ApiResult<Boolean> upAndDown(@RequestParam Long id, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(secFeeItemsService.upAndDown(id,status)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.optometrist.model.SecSetting; |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import com.jilongda.optometrist.service.SecSettingService; |
| | | import com.jilongda.optometrist.vo.TWarehousingVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "低库存警告") |
| | | @RestController |
| | | @RequestMapping("/sec-setting") |
| | | public class SecSettingController { |
| | | |
| | | @Autowired |
| | | private SecSettingService secSettingService; |
| | | |
| | | /** |
| | | * 查询详情 |
| | | */ |
| | | @ApiOperation(value = "低库存警告查询") |
| | | @PostMapping(value = "/getDetailById") |
| | | public ApiResult<SecSetting> getDetailById() { |
| | | return ApiResult.success(secSettingService.getById(1)); |
| | | } |
| | | |
| | | /** |
| | | * 低库存警告修改 |
| | | */ |
| | | @ApiOperation(value = "低库存警告修改") |
| | | @PostMapping(value = "/updateById") |
| | | public ApiResult<String> updateById(@RequestBody SecSetting secSetting) { |
| | | secSettingService.updateById(secSetting); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TCouponReceive; |
| | | import com.jilongda.optometrist.model.TOptometry; |
| | | import com.jilongda.optometrist.model.TOrder; |
| | | import com.jilongda.optometrist.query.TAppUserCouponQuery; |
| | | import com.jilongda.optometrist.query.TAppUserQuery; |
| | | import com.jilongda.optometrist.query.TOptometristQuery; |
| | | import com.jilongda.optometrist.service.TAppUserService; |
| | | import com.jilongda.optometrist.service.TCouponReceiveService; |
| | | import com.jilongda.optometrist.service.TOptometryService; |
| | | import com.jilongda.optometrist.service.TOrderService; |
| | | import com.jilongda.optometrist.vo.TAppUserCouponVO; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | import com.jilongda.optometrist.vo.TOptometristVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "用户管理") |
| | | @RequestMapping("/t-app-user") |
| | | public class TAppUserController { |
| | | |
| | | @Resource |
| | | private TAppUserService appUserService; |
| | | @Resource |
| | | private TOrderService orderService; |
| | | @Resource |
| | | private TOptometryService tOptometryService; |
| | | @Resource |
| | | private TCouponReceiveService couponReceiveService; |
| | | @ApiOperation(value = "用户列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TAppUserVO>> pageList(@RequestBody TAppUserQuery query) { |
| | | if (StringUtils.hasLength(query.getStartTime())){ |
| | | query.setStartTime(query.getStartTime()+" 00:00:00"); |
| | | query.setEndTime(query.getEndTime()+" 23:59:59"); |
| | | } |
| | | PageInfo<TAppUserVO> appUserVOPageInfo = appUserService.pageList(query); |
| | | return ApiResult.success(appUserVOPageInfo); |
| | | } |
| | | @ApiOperation(value = "启用/禁用") |
| | | @GetMapping(value = "/updateState") |
| | | public ApiResult updateState(Integer id) { |
| | | TAppUser byId = appUserService.getById(id); |
| | | if (byId.getStatus()==1){ |
| | | byId.setStatus(2); |
| | | }else{ |
| | | byId.setStatus(1); |
| | | } |
| | | appUserService.updateById(byId); |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "用户详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TAppUserVO> getDetailById(Integer id) { |
| | | TAppUser byId = appUserService.getById(id); |
| | | TAppUserVO tAppUserVO = new TAppUserVO(); |
| | | BeanUtils.copyProperties(byId, tAppUserVO); |
| | | // 查询消费次数 |
| | | long l = orderService.count(new LambdaQueryWrapper<TOrder>() |
| | | .eq(TOrder::getUserId, tAppUserVO.getId())); |
| | | tAppUserVO.setSalesCount((int) l); |
| | | // 查询验光次数 |
| | | int size = tOptometryService.lambdaQuery().eq(TOptometry::getUserId, tAppUserVO.getId()) |
| | | .eq(TOptometry::getStatus, 3).list().size(); |
| | | tAppUserVO.setOptometryCount(size); |
| | | // 查询最后消费时间 |
| | | tAppUserVO.setSalesTime(orderService.lambdaQuery().eq(TOrder::getUserId, tAppUserVO.getId()) |
| | | .orderByDesc(TOrder::getCreateTime).last("limit 1").one().getCreateTime()); |
| | | // 查询最后验光时间 |
| | | tAppUserVO.setOptometryTime(tOptometryService.lambdaQuery().eq(TOptometry::getUserId, tAppUserVO.getId()) |
| | | .eq(TOptometry::getStatus, 3).orderByDesc(TOptometry::getCreateTime).last("limit 1").one().getCreateTime()); |
| | | // 查询订单总额 |
| | | BigDecimal reduce = orderService.lambdaQuery().eq(TOrder::getUserId, byId.getId()).list().stream().map(TOrder::getPayMoney) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | tAppUserVO.setSalesAmount(reduce); |
| | | |
| | | return ApiResult.success(tAppUserVO); |
| | | } |
| | | @ApiOperation(value = "用户详情-查看优惠券") |
| | | @GetMapping(value = "/getCouponDetailById") |
| | | public ApiResult<PageInfo<TAppUserCouponVO>> getCouponDetailById(@RequestBody TAppUserCouponQuery query) { |
| | | PageInfo<TAppUserCouponVO> appUserVOPageInfo = couponReceiveService.pageList(query); |
| | | return ApiResult.success(appUserVOPageInfo); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TBrand; |
| | | import com.jilongda.optometrist.query.TBrandQuery; |
| | | import com.jilongda.optometrist.service.TBrandService; |
| | | import com.jilongda.optometrist.utils.LoginInfoUtil; |
| | | import com.jilongda.optometrist.vo.TBrandVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架-镜片品牌表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "镜架-镜片品牌表") |
| | | @RestController |
| | | @RequestMapping("/t-brand") |
| | | public class TBrandController { |
| | | |
| | | @Autowired |
| | | private TBrandService brandService; |
| | | |
| | | /** |
| | | * 获取镜架-镜片品牌列表 |
| | | */ |
| | | @ApiOperation(value = "获取镜架-镜片品牌分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TBrandVO>> pageList(@RequestBody TBrandQuery query) { |
| | | return ApiResult.success(brandService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加镜架-镜片品牌 |
| | | */ |
| | | @ApiOperation(value = "添加镜架-镜片品牌") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@Validated @RequestBody TBrand dto) { |
| | | brandService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改镜架-镜片品牌--启用、禁用、设置主要品牌接口") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TBrand dto) { |
| | | brandService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除镜架-镜片品牌") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public ApiResult<Boolean> deleteById(@RequestParam Long id) { |
| | | return ApiResult.success(brandService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除镜架-镜片品牌") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { |
| | | return ApiResult.success(brandService.removeByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询镜架-镜片品牌详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TBrand> getDetailById(@RequestParam Long id) { |
| | | return ApiResult.success(brandService.getById(id)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.utils.UUIDUtil; |
| | | import com.jilongda.optometrist.dto.TModelDTO; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TCoupon; |
| | | import com.jilongda.optometrist.model.TCouponReceive; |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import com.jilongda.optometrist.query.TAppUserQuery; |
| | | import com.jilongda.optometrist.query.TCouponQuery; |
| | | import com.jilongda.optometrist.service.TAppUserService; |
| | | import com.jilongda.optometrist.service.TCouponReceiveService; |
| | | import com.jilongda.optometrist.service.TCouponService; |
| | | import com.jilongda.optometrist.utils.QRCodeUtil; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | import com.jilongda.optometrist.vo.TCouponInfoVO; |
| | | import com.jilongda.optometrist.vo.TCouponVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.core.io.ByteArrayResource; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | 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 javax.annotation.Resource; |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取记录 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "优惠券管理") |
| | | @RequestMapping("/t-coupon") |
| | | public class TCouponController { |
| | | @Resource |
| | | private TCouponService couponService; |
| | | @Resource |
| | | private TCouponReceiveService couponReceiveService; |
| | | @Resource |
| | | private TAppUserService appUserService; |
| | | @ApiOperation(value = "优惠券列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TCouponVO>> pageList(@RequestBody TCouponQuery query) { |
| | | PageInfo<TCouponVO> appUserVOPageInfo = couponService.pageList(query); |
| | | return ApiResult.success(appUserVOPageInfo); |
| | | } |
| | | @ApiOperation(value = "添加优惠券") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add( @RequestBody TCoupon dto) throws Exception { |
| | | couponService.save(dto); |
| | | switch (dto.getType()){ |
| | | case 2: |
| | | // 全局发放 |
| | | List<Integer> collect = appUserService.lambdaQuery().list().stream() |
| | | .map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<TCouponReceive> tCouponReceives = new ArrayList<>(); |
| | | for (Integer i : collect) { |
| | | TCouponReceive tCouponReceive = new TCouponReceive(); |
| | | tCouponReceive.setCouponId(dto.getId()); |
| | | tCouponReceive.setUserId(i); |
| | | tCouponReceive.setType(2); |
| | | tCouponReceive.setAmount(dto.getAmount()); |
| | | tCouponReceive.setStoreId(dto.getStoreId()); |
| | | if (dto.getTime()!=0){ |
| | | tCouponReceive.setEndTime(LocalDateTime.now().plusDays(dto.getTime())); |
| | | } |
| | | tCouponReceive.setAmountCondition(dto.getAmountCondition()); |
| | | tCouponReceive.setStatus(1); |
| | | tCouponReceives.add(tCouponReceive); |
| | | } |
| | | couponReceiveService.saveBatch(tCouponReceives); |
| | | break; |
| | | case 3: |
| | | List<TCouponReceive> tCouponReceives1 = new ArrayList<>(); |
| | | |
| | | for (Integer userId : dto.getUserIds()) { |
| | | TCouponReceive tCouponReceive = new TCouponReceive(); |
| | | tCouponReceive.setCouponId(dto.getId()); |
| | | tCouponReceive.setUserId(userId); |
| | | tCouponReceive.setType(2); |
| | | tCouponReceive.setAmount(dto.getAmount()); |
| | | tCouponReceive.setStoreId(dto.getStoreId()); |
| | | if (dto.getTime()!=0){ |
| | | tCouponReceive.setEndTime(LocalDateTime.now().plusDays(dto.getTime())); |
| | | } |
| | | tCouponReceive.setAmountCondition(dto.getAmountCondition()); |
| | | tCouponReceive.setStatus(1); |
| | | tCouponReceives1.add(tCouponReceive); |
| | | } |
| | | couponReceiveService.saveBatch(tCouponReceives1); |
| | | break; |
| | | case 4: |
| | | String code = "{\"id\": "+dto.getId()+ "}"; |
| | | BufferedImage blueImage = QRCodeUtil.createImage(code); |
| | | MultipartFile blueFile = convert(blueImage, new Date().getTime() + UUIDUtil.getRandomCode(3) + ".PNG"); |
| | | // todo 没有云存储 |
| | | // String s = OssUploadUtil.ossUpload("img/", blueFile); |
| | | break; |
| | | } |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "修改优惠券") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update( @RequestBody TCoupon dto) throws Exception { |
| | | couponService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "优惠券详情") |
| | | @PostMapping(value = "/getDetail") |
| | | public ApiResult<TCouponInfoVO> getDetail(Integer id) { |
| | | TCouponInfoVO tCouponInfoVO = new TCouponInfoVO(); |
| | | TCoupon byId = couponService.getById(id); |
| | | BeanUtils.copyProperties(byId, tCouponInfoVO); |
| | | int size = couponReceiveService.list(new LambdaQueryWrapper<TCouponReceive>() |
| | | .eq(TCouponReceive::getCouponId, id)).size(); |
| | | tCouponInfoVO.setGrantCout(size); |
| | | int size1 = couponReceiveService.list(new LambdaQueryWrapper<TCouponReceive>() |
| | | .eq(TCouponReceive::getCouponId, id) |
| | | .eq(TCouponReceive::getStatus, 2)).size(); |
| | | tCouponInfoVO.setUseCount(size1); |
| | | |
| | | return ApiResult.success(tCouponInfoVO); |
| | | } |
| | | public static MultipartFile convert(BufferedImage bufferedImage, String fileName) throws IOException { |
| | | // 将 BufferedImage 转换为字节数组 |
| | | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | | ImageIO.write(bufferedImage, "png", baos); |
| | | byte[] bytes = baos.toByteArray(); |
| | | |
| | | // 创建 ByteArrayResource |
| | | ByteArrayResource resource = new ByteArrayResource(bytes); |
| | | |
| | | // 创建 MockMultipartFile |
| | | MockMultipartFile multipartFile = new MockMultipartFile( |
| | | "file", |
| | | fileName, |
| | | "image/png", |
| | | resource.getInputStream() |
| | | ); |
| | | |
| | | return multipartFile; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-coupon-receive") |
| | | public class TCouponReceiveController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架出库入库详细表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-frame-warehousing-detail") |
| | | public class TFrameWarehousingDetailController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.dto.FrameInventoryDTO; |
| | | import com.jilongda.optometrist.dto.GetCurrentByParam; |
| | | import com.jilongda.optometrist.dto.GetCurrentByParamLens; |
| | | import com.jilongda.optometrist.dto.LensInventoryDTO; |
| | | import com.jilongda.optometrist.query.TInventoryQuery; |
| | | import com.jilongda.optometrist.utils.LoginInfoUtil; |
| | | import com.jilongda.optometrist.vo.TInventoryInfoVO; |
| | | import com.jilongda.optometrist.vo.TInventoryVO; |
| | | import com.jilongda.optometrist.model.*; |
| | | import com.jilongda.optometrist.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 盘点表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "盘点管理") |
| | | @RequestMapping("/t-inventory") |
| | | public class TInventoryController { |
| | | |
| | | @Resource |
| | | private TInventoryService inventoryService; |
| | | @Resource |
| | | private TInventoryFrameDetailService inventoryFrameDetailService; |
| | | @Resource |
| | | private TInventoryLensDetailService inventoryLensDetailService; |
| | | @Resource |
| | | private LoginInfoUtil loginInfoUtil; |
| | | @Resource |
| | | private TFrameGoodsService frameGoodsService; |
| | | @Resource |
| | | private TLensGoodsService lensGoodsService; |
| | | @Resource |
| | | private TLensSeriesService lensSeriesService; |
| | | @Resource |
| | | private TModelService modelService; |
| | | @Resource |
| | | private TStoreService storeService; |
| | | @ApiOperation(value = "盘点分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TInventoryVO>> pageList(@RequestBody TInventoryQuery query) { |
| | | if (StringUtils.hasLength(query.getStartTime())){ |
| | | query.setStartTime(query.getStartTime()+" 00:00:00"); |
| | | query.setEndTime(query.getEndTime()+" 23:59:59"); |
| | | } |
| | | return ApiResult.success(inventoryService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "镜架添加盘点") |
| | | @PostMapping(value = "/addFrameInventory") |
| | | public ApiResult addFrameInventory(@RequestBody FrameInventoryDTO query) { |
| | | TInventory tInventory = new TInventory(); |
| | | BeanUtils.copyProperties(query, tInventory); |
| | | inventoryService.save(tInventory); |
| | | for (TInventoryFrameDetail tInventoryFrameDetail : query.getList()) { |
| | | tInventoryFrameDetail.setInventoryId(tInventory.getId()); |
| | | } |
| | | inventoryFrameDetailService.saveBatch(query.getList()); |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "镜片添加盘点") |
| | | @PostMapping(value = "/addLensInventory") |
| | | public ApiResult addLensInventory(@RequestBody LensInventoryDTO query) { |
| | | TInventory tInventory = new TInventory(); |
| | | BeanUtils.copyProperties(query, tInventory); |
| | | inventoryService.save(tInventory); |
| | | for (TInventoryLensDetail tInventoryFrameDetail : query.getList()) { |
| | | tInventoryFrameDetail.setInventoryId(tInventory.getId()); |
| | | } |
| | | inventoryLensDetailService.saveBatch(query.getList()); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "镜架-根据品牌id查询对应库存") |
| | | @PostMapping(value = "/getCountByBrandId") |
| | | public ApiResult getCountByBrandId(Integer id) { |
| | | List<Integer> collect = modelService.lambdaQuery().eq(TModel::getBrandId, id) |
| | | .list().stream().map(TModel::getId).distinct().collect(Collectors.toList()); |
| | | if (collect.isEmpty())collect.add(-1); |
| | | List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect).list(); |
| | | if (list.isEmpty())return ApiResult.success("0"); |
| | | int i = 0; |
| | | for (TFrameGoods tFrameGoods : list) { |
| | | i+=tFrameGoods.getTotal(); |
| | | } |
| | | return ApiResult.success(i); |
| | | } |
| | | @ApiOperation(value = "镜架-根据材质id查询对应库存") |
| | | @PostMapping(value = "/getCountByMaterialId") |
| | | public ApiResult getCountByMaterialId(Integer id) { |
| | | List<Integer> collect = modelService.lambdaQuery().eq(TModel::getMaterialId, id) |
| | | .list().stream().map(TModel::getId).distinct().collect(Collectors.toList()); |
| | | if (collect.isEmpty())collect.add(-1); |
| | | List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect).list(); |
| | | if (list.isEmpty())return ApiResult.success("0"); |
| | | int i = 0; |
| | | for (TFrameGoods tFrameGoods : list) { |
| | | i+=tFrameGoods.getTotal(); |
| | | } |
| | | return ApiResult.success(i); |
| | | } |
| | | @ApiOperation(value = "镜架-根据品牌id、型号名称、色号名称、材质id查询当前库存") |
| | | @PostMapping(value = "/getCurrentByParamFrame") |
| | | public ApiResult<Integer> getCurrentByParamFrame(@RequestBody GetCurrentByParam getCurrentByParam) { |
| | | // 根据型号名称 查询型号列表ids |
| | | List<Integer> collect = modelService.lambdaQuery().eq(TModel::getName, getCurrentByParam.getModel()) |
| | | .eq(TModel::getColor,getCurrentByParam.getColor()) |
| | | .eq(TModel::getMaterialId,getCurrentByParam.getMaterialId()) |
| | | .eq(TModel::getBrandId,getCurrentByParam.getBrandId()) |
| | | .list().stream().map(TModel::getId).collect(Collectors.toList()); |
| | | TFrameGoods one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect) |
| | | .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).one(); |
| | | if (one!=null){ |
| | | return ApiResult.success(one.getTotal()); |
| | | |
| | | } |
| | | return ApiResult.success(0); |
| | | } |
| | | @ApiOperation(value = "镜片-根据品牌id、型号名称、色号名称、材质id查询当前库存") |
| | | @PostMapping(value = "/getCurrentByParamLens") |
| | | public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) { |
| | | TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId()) |
| | | .eq(dto.getLensType()!=null,TLensGoods::getLensType, dto.getLensType()) |
| | | .eq(dto.getRefractiveIndex()!=null,TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) |
| | | .eq(dto.getBallMirror()!=null,TLensGoods::getBallMirror, dto.getBallMirror()) |
| | | .eq(dto.getColumnMirror()!=null,TLensGoods::getColumnMirror, dto.getColumnMirror()) |
| | | .one(); |
| | | if (one!=null){ |
| | | return ApiResult.success(one.getTotal()); |
| | | } |
| | | return ApiResult.success(0); |
| | | } |
| | | @ApiOperation(value = "查看详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TInventoryInfoVO> getDetailById(Integer id) { |
| | | TInventoryInfoVO tInventoryInfoVO = new TInventoryInfoVO(); |
| | | |
| | | TInventory byId = inventoryService.getById(id); |
| | | BeanUtils.copyProperties(byId, tInventoryInfoVO); |
| | | switch (byId.getType()){ |
| | | case 1: |
| | | List<TInventoryFrameDetail> list = inventoryFrameDetailService.lambdaQuery().eq(TInventoryFrameDetail::getInventoryId, id).list(); |
| | | tInventoryInfoVO.setFrameList(list); |
| | | break; |
| | | case 2: |
| | | List<TInventoryLensDetail> list2 = inventoryLensDetailService.lambdaQuery().eq(TInventoryLensDetail::getInventoryId, id).list(); |
| | | tInventoryInfoVO.setLensList(list2); |
| | | break; |
| | | } |
| | | TStore byId1 = storeService.getById(byId.getStoreId()); |
| | | if (byId1!=null)tInventoryInfoVO.setStore(byId1.getName()); |
| | | return ApiResult.success(tInventoryInfoVO); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 材质表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-inventory-frame-detail") |
| | | public class TInventoryFrameDetailController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架盘点详细表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-inventory-lens-detail") |
| | | public class TInventoryLensDetailController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.JsonArray; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TLensSeries; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import com.jilongda.optometrist.query.TLensSeriesQuery; |
| | | import com.jilongda.optometrist.query.TOptometristQuery; |
| | | import com.jilongda.optometrist.service.TLensSeriesService; |
| | | import com.jilongda.optometrist.vo.TLensSeriesVO; |
| | | import com.jilongda.optometrist.vo.TOptometristVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片系列表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "镜片系列管理") |
| | | @RestController |
| | | @RequestMapping("/t-lens-series") |
| | | public class TLensSeriesController { |
| | | @Autowired |
| | | private TLensSeriesService lensSeriesService; |
| | | @ApiOperation(value = "镜片系列列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TLensSeriesVO>> pageList(@RequestBody TLensSeriesQuery query) { |
| | | PageInfo<TLensSeriesVO> optometristVOPageInfo = lensSeriesService.pageList(query); |
| | | return ApiResult.success(optometristVOPageInfo); |
| | | } |
| | | @ApiOperation(value = "镜片系列添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TLensSeries dto) { |
| | | lensSeriesService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "镜片系列编辑") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TLensSeries dto) { |
| | | if (!StringUtils.hasLength(dto.getSphere())){ |
| | | dto.setSphere(""); |
| | | } |
| | | if (!StringUtils.hasLength(dto.getAsphericSurface())){ |
| | | dto.setAsphericSurface(""); |
| | | } |
| | | if (!StringUtils.hasLength(dto.getDoubleNon())){ |
| | | dto.setDoubleNon(""); |
| | | } |
| | | lensSeriesService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "镜片系列启用/禁用") |
| | | @GetMapping(value = "/updateState") |
| | | public ApiResult<String> update(Integer id) { |
| | | TLensSeries byId = lensSeriesService.getById(id); |
| | | if (byId.getStatus()==1){ |
| | | byId.setStatus(2); |
| | | }else{ |
| | | byId.setStatus(1); |
| | | } |
| | | lensSeriesService.updateById(byId); |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "通过品牌id查询镜片系列列表") |
| | | @GetMapping(value = "/seriesList") |
| | | public ApiResult<List<TLensSeries>> seriesList(Integer brandId) { |
| | | return ApiResult.success(lensSeriesService.lambdaQuery().eq(TLensSeries::getBrandId,brandId).list()); |
| | | } |
| | | @ApiOperation(value = "通过系列id查询球/非球 返回参数1为球 2非球 3双飞") |
| | | @GetMapping(value = "/lensTypeList") |
| | | public ApiResult<List<Integer>> lensTypeList(Integer id) { |
| | | TLensSeries byId = lensSeriesService.getById(id); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | if (StringUtils.hasLength(byId.getSphere())){ |
| | | integers.add(1); |
| | | } |
| | | if (StringUtils.hasLength(byId.getAsphericSurface())){ |
| | | integers.add(2); |
| | | } |
| | | if (StringUtils.hasLength(byId.getDoubleNon())){ |
| | | integers.add(3); |
| | | } |
| | | return ApiResult.success(integers); |
| | | } |
| | | @ApiOperation(value = "根据系列id + 球/非球查询折射率列表 球/非球入参数1为球 2非球 3双飞") |
| | | @GetMapping(value = "/refractiveIndexList") |
| | | public ApiResult<List<String>> refractiveIndexList(Integer id, Integer lensType) { |
| | | TLensSeries byId = lensSeriesService.getById(id); |
| | | if (lensType==1){ |
| | | String sphere = byId.getSphere(); |
| | | // 将字符串化为jsonArray |
| | | if (StringUtils.hasLength(sphere)) { |
| | | JSONObject.parseArray(sphere); |
| | | } else { |
| | | return ApiResult.success(new ArrayList<String>()); |
| | | } |
| | | } |
| | | if (lensType==2){ |
| | | String asphericSurface = byId.getAsphericSurface(); |
| | | if (StringUtils.hasLength(asphericSurface)) { |
| | | JSONObject.parseArray(asphericSurface); |
| | | } else { |
| | | return ApiResult.success(new ArrayList<String>()); |
| | | } |
| | | } |
| | | if (lensType==3){ |
| | | String doubleNon = byId.getDoubleNon(); |
| | | if (StringUtils.hasLength(doubleNon)) { |
| | | JSONObject.parseArray(doubleNon); |
| | | } else { |
| | | return ApiResult.success(new ArrayList<String>()); |
| | | } |
| | | } |
| | | return ApiResult.success(new ArrayList<String>()); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片出库入库明细表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-lens-warehousing-detail") |
| | | public class TLensWarehousingDetailController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TLineUp; |
| | | import com.jilongda.optometrist.model.TOptometryDetail; |
| | | import com.jilongda.optometrist.query.TLineUpQuery; |
| | | import com.jilongda.optometrist.query.TOptometryQuery; |
| | | import com.jilongda.optometrist.service.TAppUserService; |
| | | import com.jilongda.optometrist.service.TLineUpService; |
| | | import com.jilongda.optometrist.vo.TOptometryVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 排号管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-line-up") |
| | | public class TLineUpController { |
| | | @Autowired |
| | | private TLineUpService lineUpService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | @ApiOperation(value = "获取排号分页列表",tags = "排号管理") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TLineUp>> pageList(@RequestBody TLineUpQuery query) { |
| | | PageInfo<TLineUp> res = lineUpService.pageList(query); |
| | | return ApiResult.success(res); |
| | | } |
| | | @ApiOperation(value = "查询当前排队人数",tags = "排号a管理") |
| | | @PostMapping(value = "/getCount") |
| | | public ApiResult getCount() { |
| | | return ApiResult.success(lineUpService.lambdaQuery().eq(TLineUp::getStatus,1).list().size()); |
| | | } |
| | | @ApiOperation(value = "取消排队",tags = "排号管理") |
| | | @GetMapping(value = "/cancel") |
| | | public ApiResult cancel(Integer id) { |
| | | TLineUp byId = lineUpService.getById(id); |
| | | byId.setStatus(5); |
| | | lineUpService.updateById(byId); |
| | | return ApiResult.success(); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TMaterial; |
| | | import com.jilongda.optometrist.query.TMaterialQuery; |
| | | import com.jilongda.optometrist.service.TMaterialService; |
| | | import com.jilongda.optometrist.vo.TMaterialVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 材质表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "材质管理") |
| | | @RestController |
| | | @RequestMapping("/t-material") |
| | | public class TMaterialController { |
| | | |
| | | @Autowired |
| | | private TMaterialService materialService; |
| | | |
| | | /** |
| | | * 获取材质列表 |
| | | */ |
| | | @ApiOperation(value = "获取材质分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TMaterialVO>> pageList(@RequestBody TMaterialQuery query) { |
| | | return ApiResult.success(materialService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取材质列表 |
| | | */ |
| | | @ApiOperation(value = "获取材质列表") |
| | | @PostMapping(value = "/list") |
| | | public ApiResult<List<TMaterial>> list(@RequestBody TMaterialQuery query) { |
| | | List<TMaterial> list = materialService.list(Wrappers.lambdaQuery(TMaterial.class) |
| | | .eq(TMaterial::getStatus, 1)); |
| | | return ApiResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 添加材质 |
| | | */ |
| | | @ApiOperation(value = "添加材质") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@Validated @RequestBody TMaterial dto) { |
| | | Boolean flag = materialService.isExit(dto.getId(), dto.getName()); |
| | | if(flag){ |
| | | return ApiResult.failed("材质名称已存在"); |
| | | } |
| | | materialService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改材质") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@Validated @RequestBody TMaterial dto) { |
| | | Boolean flag = materialService.isExit(dto.getId(), dto.getName()); |
| | | if(flag){ |
| | | return ApiResult.failed("材质名称已存在"); |
| | | } |
| | | materialService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 材质启用禁用 |
| | | */ |
| | | @ApiOperation(value = "材质启用禁用") |
| | | @GetMapping(value = "/upAndDown") |
| | | public ApiResult<Boolean> upAndDown(@RequestParam Long id, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(materialService.upAndDown(id,status)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除材质") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public ApiResult<Boolean> deleteById(@RequestParam Long id) { |
| | | return ApiResult.success(materialService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除材质") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { |
| | | return ApiResult.success(materialService.removeByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询材质详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TMaterial> getDetailById(@RequestParam Long id) { |
| | | return ApiResult.success(materialService.getById(id)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.dto.TModelDTO; |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import com.jilongda.optometrist.query.TModelQuery; |
| | | import com.jilongda.optometrist.service.TModelService; |
| | | import com.jilongda.optometrist.vo.TModelVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架型号表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "镜架型号表") |
| | | @RestController |
| | | @RequestMapping("/t-model") |
| | | public class TModelController { |
| | | |
| | | @Autowired |
| | | private TModelService modelService; |
| | | |
| | | /** |
| | | * 获取镜架型号列表 |
| | | */ |
| | | @ApiOperation(value = "获取镜架型号分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TModelVO>> pageList(@RequestBody TModelQuery query) { |
| | | return ApiResult.success(modelService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 通过品牌查询型号列表 |
| | | */ |
| | | @ApiOperation(value = "通过品牌id查询型号列表") |
| | | @GetMapping(value = "/getListByBrandId") |
| | | public ApiResult<List<TModel>> pageList(@RequestParam Integer brandId) { |
| | | List<TModel> list = modelService.list(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getBrandId, brandId) |
| | | .groupBy(TModel::getName)); |
| | | return ApiResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 通过型号查询色号列表 |
| | | */ |
| | | @ApiOperation(value = "通过型号查询色号列表") |
| | | @GetMapping(value = "/getListByName") |
| | | public ApiResult<List<TModel>> pageList(@RequestParam String name) { |
| | | List<TModel> list = modelService.list(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getName, name)); |
| | | return ApiResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 添加镜架型号 |
| | | */ |
| | | @ApiOperation(value = "添加镜架型号") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@Validated @RequestBody TModelDTO dto) { |
| | | List<String> colorList = dto.getColorList(); |
| | | List<TModel> models = new ArrayList<>(); |
| | | for (String s : colorList) { |
| | | TModel model = new TModel(); |
| | | BeanUtils.copyProperties(dto, model); |
| | | model.setColor(s); |
| | | models.add(model); |
| | | } |
| | | modelService.saveBatch(models); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改镜架型号") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TModelDTO dto) { |
| | | |
| | | modelService.remove(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getName,dto.getName())); |
| | | |
| | | List<String> colorList = dto.getColorList(); |
| | | List<TModel> models = new ArrayList<>(); |
| | | for (String s : colorList) { |
| | | TModel model = new TModel(); |
| | | BeanUtils.copyProperties(dto, model); |
| | | model.setId(null); |
| | | model.setColor(s); |
| | | models.add(model); |
| | | } |
| | | modelService.saveBatch(models); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 镜架型号上下架 |
| | | */ |
| | | @ApiOperation(value = "镜架型号上下架--列表使用") |
| | | @GetMapping(value = "/upAndDown") |
| | | public ApiResult<Boolean> upAndDown(@RequestParam String name, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(modelService.upAndDown(name,status)); |
| | | } |
| | | |
| | | /** |
| | | * 镜架型号上下架 |
| | | */ |
| | | @ApiOperation(value = "镜架型号上下架--修改界面使用") |
| | | @GetMapping(value = "/upAndDownColor") |
| | | public ApiResult<Boolean> upAndDownColor(@RequestParam String name, |
| | | @RequestParam String color, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(modelService.upAndDownColor(name,color,status)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除镜架型号") |
| | | @DeleteMapping(value = "/deleteByName") |
| | | public ApiResult<String> deleteById(@RequestParam String name) { |
| | | modelService.remove(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getName, name)); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除镜架型号") |
| | | @DeleteMapping(value = "/deleteByNames") |
| | | public ApiResult<String> deleteByIds(@RequestBody List<String> names) { |
| | | modelService.remove(Wrappers.lambdaQuery(TModel.class) |
| | | .in(TModel::getName, names)); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询镜架型号详情") |
| | | @GetMapping(value = "/getDetailByName") |
| | | public ApiResult<TModelVO> getDetailById(@RequestParam String name) { |
| | | List<TModel> models = modelService.list(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getName, name)); |
| | | TModelVO modelVO = new TModelVO(); |
| | | BeanUtils.copyProperties(models.get(0), modelVO); |
| | | List<String> colorList = models.stream().map(TModel::getColor).collect(Collectors.toList()); |
| | | modelVO.setColorList(colorList); |
| | | return ApiResult.success(modelVO); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.service.SecUserService; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import com.jilongda.optometrist.query.TOptometristQuery; |
| | | import com.jilongda.optometrist.query.TicketQuery; |
| | | import com.jilongda.optometrist.service.TLineUpService; |
| | | import com.jilongda.optometrist.service.TOptometristService; |
| | | import com.jilongda.optometrist.utils.LoginInfoUtil; |
| | | import com.jilongda.optometrist.vo.TOptometristVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光师表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "验光师相关接口") |
| | | @RestController |
| | | @RequestMapping("/t-optometrist") |
| | | public class TOptometristController { |
| | | @Autowired |
| | | private TOptometristService optometristService; |
| | | @Autowired |
| | | private TLineUpService tLineUpService; |
| | | @Autowired |
| | | private LoginInfoUtil loginInfoUtil; |
| | | @Autowired |
| | | private SecUserService secUserService; |
| | | // @ApiOperation(value = "首页") |
| | | // @PostMapping(value = "/pageList") |
| | | // public ApiResult<TOptometristVO> pageList() { |
| | | // Long userId = loginInfoUtil.getUserId(); |
| | | // |
| | | // return ApiResult.success(); |
| | | // } |
| | | |
| | | @ApiOperation(value = "通过门店id查询验光师列表") |
| | | @PostMapping(value = "/queryListByStoreId") |
| | | public ApiResult<List<TOptometrist>> queryListByStoreId(@RequestParam Integer storeId) { |
| | | List<TOptometrist> optometristVOPageInfo = optometristService.list(Wrappers.lambdaQuery(TOptometrist.class) |
| | | .eq(TOptometrist::getStoreId,storeId)); |
| | | return ApiResult.success(optometristVOPageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "验光师添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TOptometrist dto) { |
| | | optometristService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "验光师编辑") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TOptometrist dto) { |
| | | optometristService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "验光师上下架") |
| | | @GetMapping(value = "/upAndDown") |
| | | public ApiResult<Boolean> upAndDown(@RequestParam Integer id, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(optometristService.upAndDown(id,status)); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TOptometryDetail; |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import com.jilongda.optometrist.query.TOptometryQuery; |
| | | import com.jilongda.optometrist.query.TSupplierQuery; |
| | | import com.jilongda.optometrist.service.TAppUserService; |
| | | import com.jilongda.optometrist.service.TOptometristService; |
| | | import com.jilongda.optometrist.service.TOptometryDetailService; |
| | | import com.jilongda.optometrist.service.TSupplierService; |
| | | import com.jilongda.optometrist.vo.TOptometryVO; |
| | | import com.jilongda.optometrist.vo.TSupplierVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-optometry") |
| | | public class TOptometryController { |
| | | @Autowired |
| | | private TSupplierService supplierService; |
| | | @Autowired |
| | | private TOptometristService optometristService; |
| | | @Autowired |
| | | private TOptometryDetailService optometryDetailService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | /** |
| | | * 获取供应商列表 |
| | | */ |
| | | @ApiOperation(value = "获取验光单分页列表",tags = "验光单") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TOptometryVO>> pageList(@RequestBody TOptometryQuery query) { |
| | | String startTime = null; |
| | | String endTime = null; |
| | | if (StringUtils.hasLength(query.getCreateTime())){ |
| | | String[] split = query.getCreateTime().split(" - "); |
| | | startTime = split[0]+" 00:00:00"; |
| | | endTime = split[1]+" 23:59:59"; |
| | | } |
| | | query.setStartTime(startTime); |
| | | query.setEndTime(endTime); |
| | | PageInfo<TOptometryVO> tOptometryVOPageInfo = optometristService.pageList(query); |
| | | List<TOptometryVO> records = tOptometryVOPageInfo.getRecords(); |
| | | for (TOptometryVO record : records) { |
| | | if (record.getUserId()!=null){ |
| | | TAppUser byId = appUserService.getById(record.getUserId()); |
| | | if (byId!=null){ |
| | | record.setName(byId.getName()); |
| | | } |
| | | } |
| | | TOptometryDetail l = optometryDetailService.lambdaQuery() |
| | | .eq(TOptometryDetail::getOptometryId, record.getId()) |
| | | .eq(TOptometryDetail::getType,1) |
| | | .eq(TOptometryDetail::getStatus,1) |
| | | .one(); |
| | | TOptometryDetail r = optometryDetailService.lambdaQuery() |
| | | .eq(TOptometryDetail::getOptometryId, record.getId()) |
| | | .eq(TOptometryDetail::getType,1) |
| | | .eq(TOptometryDetail::getStatus,2) |
| | | .one(); |
| | | double templ = 0.0; |
| | | double tempr = 0.0; |
| | | if (l!=null){ |
| | | record.setLValue(l.getBallMirror().toString()+(l.getColumnMirror()!=null?"-"+l.getColumnMirror():"")); |
| | | templ = Double.parseDouble(l.getPupilDistance()); |
| | | } |
| | | if (r!=null){ |
| | | record.setRValue(r.getBallMirror().toString()+(r.getColumnMirror()!=null?"-"+r.getColumnMirror():"")); |
| | | tempr = Double.parseDouble(r.getPupilDistance()); |
| | | |
| | | } |
| | | record.setPupilDistance((templ+tempr)+""); |
| | | } |
| | | return ApiResult.success(tOptometryVOPageInfo); |
| | | } |
| | | @ApiOperation(value = "查询验光单详情",tags = "验光单") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<List<TOptometryDetail>> getDetailById(@RequestParam Integer id) { |
| | | List<TOptometryDetail> list = optometryDetailService.lambdaQuery() |
| | | .eq(TOptometryDetail::getOptometryId, id) |
| | | .list(); |
| | | return ApiResult.success(list); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单详情 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-optometry-detail") |
| | | public class TOptometryDetailController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单核算表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-order-accounting") |
| | | public class TOrderAccountingController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.constants.WarehousingConstant; |
| | | import com.jilongda.common.utils.CodeGenerateUtils; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import com.jilongda.optometrist.model.TOrderAftersales; |
| | | import com.jilongda.optometrist.query.TOptometristQuery; |
| | | import com.jilongda.optometrist.query.TOrderAftersalesQuery; |
| | | import com.jilongda.optometrist.service.TOrderAftersalesService; |
| | | import com.jilongda.optometrist.vo.TOptometristVO; |
| | | import com.jilongda.optometrist.vo.TOrderAftersalesVO; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单售后表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "订单售后管理") |
| | | @RestController |
| | | @RequestMapping("/t-order-aftersales") |
| | | public class TOrderAftersalesController { |
| | | |
| | | |
| | | @Autowired |
| | | private TOrderAftersalesService orderAftersalesService; |
| | | |
| | | |
| | | @ApiOperation(value = "订单售后列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TOrderAftersalesVO>> pageList(@RequestBody TOrderAftersalesQuery query) { |
| | | PageInfo<TOrderAftersalesVO> orderAftersalesVOPageInfo = orderAftersalesService.pageList(query); |
| | | return ApiResult.success(orderAftersalesVOPageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单售后添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TOrderAftersales dto) { |
| | | dto.setCode(WarehousingConstant.ASTER_SALES+ CodeGenerateUtils.generateVolumeSn()); |
| | | orderAftersalesService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 销售订单表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "") |
| | | @RestController |
| | | @RequestMapping("/t-order") |
| | | public class TOrderController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.Region; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.query.TStoreQuery; |
| | | import com.jilongda.optometrist.service.ITRegionService; |
| | | import com.jilongda.optometrist.service.TStoreService; |
| | | import com.jilongda.optometrist.utils.LoginInfoUtil; |
| | | import com.jilongda.optometrist.vo.TStoreVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * 门店表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "门店管理") |
| | | @RestController |
| | | @RequestMapping("/t-store") |
| | | public class TStoreController { |
| | | |
| | | @Autowired |
| | | private TStoreService storeService; |
| | | @Autowired |
| | | private LoginInfoUtil loginInfoUtil; |
| | | @Autowired |
| | | private ITRegionService regionService; |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | */ |
| | | @ApiOperation(value = "获取门店分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TStoreVO>> pageList(@RequestBody TStoreQuery query) { |
| | | Integer userType = loginInfoUtil.getLoginUser().getUserType(); |
| | | if(!Objects.equals(userType,1)){ |
| | | query.setStatus(1); |
| | | } |
| | | return ApiResult.success(storeService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "省市区三级联动 获取省不传值 市区县传上级code") |
| | | @GetMapping(value = "/list") |
| | | public ApiResult<List<Region>> add(String code) { |
| | | if (!StringUtils.hasLength(code)){ |
| | | return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,0).list()); |
| | | }else{ |
| | | return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,regionService.lambdaQuery().eq(Region::getCode,code).one().getId()).list()); |
| | | |
| | | } |
| | | } |
| | | /** |
| | | * 添加门店 |
| | | */ |
| | | @ApiOperation(value = "添加门店") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@Validated @RequestBody TStore dto) { |
| | | storeService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改门店") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@Validated @RequestBody TStore dto) { |
| | | storeService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除门店") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public ApiResult<Boolean> deleteById(@RequestParam Long id) { |
| | | return ApiResult.success(storeService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除门店") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { |
| | | return ApiResult.success(storeService.removeByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询门店详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TStore> getDetailById(@RequestParam Long id) { |
| | | return ApiResult.success(storeService.getById(id)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import com.jilongda.optometrist.query.TSupplierQuery; |
| | | import com.jilongda.optometrist.service.TSupplierService; |
| | | import com.jilongda.optometrist.vo.TSupplierVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "供应商管理") |
| | | @RestController |
| | | @RequestMapping("/t-supplier") |
| | | public class TSupplierController { |
| | | @Autowired |
| | | private TSupplierService supplierService; |
| | | |
| | | /** |
| | | * 获取供应商列表 |
| | | */ |
| | | @ApiOperation(value = "获取供应商分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TSupplierVO>> pageList(@RequestBody TSupplierQuery query) { |
| | | return ApiResult.success(supplierService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取供应商列表 |
| | | */ |
| | | @ApiOperation(value = "获取供应商列表") |
| | | @PostMapping(value = "/list") |
| | | public ApiResult<List<TSupplier>> list(@RequestBody TSupplierQuery query) { |
| | | LambdaQueryWrapper<TSupplier> wrapper = new LambdaQueryWrapper<>(); |
| | | if(StringUtils.hasLength(query.getName())){ |
| | | wrapper.like(TSupplier::getName, query.getName()); |
| | | } |
| | | wrapper.eq(TSupplier::getStatus, 1); |
| | | List<TSupplier> list = supplierService.list(wrapper); |
| | | return ApiResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 添加供应商 |
| | | */ |
| | | @ApiOperation(value = "添加供应商") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@Validated @RequestBody TSupplier dto) { |
| | | Boolean flag = supplierService.isExit(dto.getId(), dto.getName()); |
| | | if(flag){ |
| | | return ApiResult.failed("供应商名称已存在"); |
| | | } |
| | | supplierService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改供应商") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@Validated @RequestBody TSupplier dto) { |
| | | Boolean flag = supplierService.isExit(dto.getId(), dto.getName()); |
| | | if(flag){ |
| | | return ApiResult.failed("供应商名称已存在"); |
| | | } |
| | | supplierService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 供应商启用禁用 |
| | | */ |
| | | @ApiOperation(value = "供应商启用禁用") |
| | | @GetMapping(value = "/upAndDown") |
| | | public ApiResult<Boolean> upAndDown(@RequestParam Long id, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(supplierService.upAndDown(id,status)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除供应商") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public ApiResult<Boolean> deleteById(@RequestParam Long id) { |
| | | return ApiResult.success(supplierService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除供应商") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { |
| | | return ApiResult.success(supplierService.removeByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询供应商详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TSupplier> getDetailById(@RequestParam Long id) { |
| | | return ApiResult.success(supplierService.getById(id)); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TTicket; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailQuery; |
| | | import com.jilongda.optometrist.query.TicketQuery; |
| | | import com.jilongda.optometrist.service.TTicketService; |
| | | import com.jilongda.optometrist.vo.TFrameWarehousingDetailVO; |
| | | import com.jilongda.optometrist.vo.TTicketVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 小票机 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "小票机") |
| | | @RestController |
| | | @RequestMapping("/t-ticket") |
| | | public class TTicketController { |
| | | |
| | | |
| | | @Autowired |
| | | private TTicketService tTicketService; |
| | | |
| | | @ApiOperation(value = "小票机列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TTicketVO>> pageList(@RequestBody TicketQuery query) { |
| | | PageInfo<TTicketVO> ticketVOPageInfo = tTicketService.pageList(query); |
| | | return ApiResult.success(ticketVOPageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "小票机添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TTicket dto) { |
| | | tTicketService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "小票机编辑") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TTicket dto) { |
| | | tTicketService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "小票机上下架") |
| | | @GetMapping(value = "/upAndDown") |
| | | public ApiResult<Boolean> upAndDown(@RequestParam Integer id, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(tTicketService.upAndDown(id,status)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.constants.WarehousingConstant; |
| | | import com.jilongda.common.enums.WarehousingTypeEnum; |
| | | import com.jilongda.common.security.JwtTokenUtils; |
| | | import com.jilongda.common.utils.CodeGenerateUtils; |
| | | import com.jilongda.common.utils.UUIDUtil; |
| | | import com.jilongda.optometrist.dto.GetCurrentByParam; |
| | | import com.jilongda.optometrist.dto.GetCurrentByParamLens; |
| | | import com.jilongda.optometrist.dto.TWarehousingDTO; |
| | | import com.jilongda.optometrist.dto.TWarehousingLensDTO; |
| | | import com.jilongda.optometrist.query.TFrameGoodsQuery; |
| | | import com.jilongda.optometrist.query.TLensGoodsQuery; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailLensQuery; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailQuery; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架-镜片出库入库表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "镜架-镜片出库入库") |
| | | @RestController |
| | | @RequestMapping("/t-warehousing") |
| | | public class TWarehousingController { |
| | | |
| | | @Autowired |
| | | private TWarehousingService warehousingService; |
| | | @Autowired |
| | | private TFrameWarehousingDetailService frameWarehousingDetailService; |
| | | @Autowired |
| | | private TLensWarehousingDetailService lensWarehousingDetailService; |
| | | @Autowired |
| | | private TFrameGoodsService frameGoodsService; |
| | | @Autowired |
| | | private TLensGoodsService lensGoodsService; |
| | | @Autowired |
| | | private TModelService modelService; |
| | | @Autowired |
| | | private TLensSeriesService lensSeriesService; |
| | | @Autowired |
| | | private TStoreService storeService; |
| | | @Autowired |
| | | private TBrandService brandService; |
| | | /** |
| | | * 通过型号查询色号列表 |
| | | */ |
| | | @ApiOperation(value = "镜架-根据品牌id、型号名称、色号名称查询当前库存") |
| | | @PostMapping(value = "/getCurrentByParamFrame") |
| | | public ApiResult<Integer> getCurrentByParamFrame(@RequestBody GetCurrentByParam getCurrentByParam) { |
| | | // 根据型号名称 查询型号列表ids |
| | | List<Integer> collect = modelService.lambdaQuery().eq(TModel::getName, getCurrentByParam.getModel()) |
| | | .eq(TModel::getMaterialId,getCurrentByParam.getMaterialId()) |
| | | .eq(TModel::getColor,getCurrentByParam.getColor()) |
| | | .eq(TModel::getBrandId,getCurrentByParam.getBrandId()) |
| | | .list().stream().map(TModel::getId).collect(Collectors.toList()); |
| | | TFrameGoods one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect) |
| | | .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).one(); |
| | | if (one!=null){ |
| | | return ApiResult.success(one.getTotal()); |
| | | |
| | | } |
| | | return ApiResult.success(0); |
| | | } |
| | | @ApiOperation(value = "镜片-根据品牌id、型号名称、色号名称、材质id查询当前库存") |
| | | @PostMapping(value = "/getCurrentByParamLens") |
| | | public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) { |
| | | TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId()) |
| | | .eq(dto.getLensType()!=null,TLensGoods::getLensType, dto.getLensType()) |
| | | .eq(dto.getRefractiveIndex()!=null,TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) |
| | | .eq(dto.getBallMirror()!=null,TLensGoods::getBallMirror, dto.getBallMirror()) |
| | | .eq(dto.getColumnMirror()!=null,TLensGoods::getColumnMirror, dto.getColumnMirror()) |
| | | .one(); |
| | | if (one!=null){ |
| | | return ApiResult.success(one.getTotal()); |
| | | } |
| | | return ApiResult.success(0); |
| | | } |
| | | @ApiOperation(value = "镜架库存分页列表") |
| | | @PostMapping(value = "/frameReceiptList") |
| | | public ApiResult<PageInfo<TFrameGoodsVO>> frameReceiptList(@RequestBody TFrameGoodsQuery query) { |
| | | return ApiResult.success(frameGoodsService.lensReceiptList(query)); |
| | | } |
| | | @ApiOperation(value = "镜片库存分页列表") |
| | | @PostMapping(value = "/lensReceiptList") |
| | | public ApiResult<PageInfo<TLensGoodsVO>> lensReceiptList(@RequestBody TLensGoodsQuery query) { |
| | | return ApiResult.success(lensGoodsService.lensReceiptList(query)); |
| | | } |
| | | @ApiOperation(value = "镜片库存分页列表-启用禁用") |
| | | @PostMapping(value = "/updateStateLens") |
| | | public ApiResult updateStateLens(Integer id) { |
| | | TLensGoods byId = lensGoodsService.getById(id); |
| | | if (byId.getStatus()==1){ |
| | | byId.setStatus(2); |
| | | }else { |
| | | byId.setStatus(1); |
| | | } |
| | | return ApiResult.success(); |
| | | } |
| | | @ApiOperation(value = "镜架库存分页列表-启用禁用") |
| | | @PostMapping(value = "/updateStateFrame") |
| | | public ApiResult updateStateFrame(Integer id) { |
| | | TFrameGoods byId = frameGoodsService.getById(id); |
| | | if (byId.getStatus()==1){ |
| | | byId.setStatus(2); |
| | | }else { |
| | | byId.setStatus(1); |
| | | } |
| | | return ApiResult.success(); |
| | | } |
| | | /** |
| | | * 出入库单列表 |
| | | */ |
| | | @ApiOperation(value = "镜架出入库单列表") |
| | | @PostMapping(value = "/inventoryReceiptList") |
| | | public ApiResult<PageInfo<TWarehousingVO>> inventoryReceiptList(@RequestBody TWarehousingDetailQuery query) { |
| | | return ApiResult.success(warehousingService.inventoryReceiptList(query)); |
| | | } |
| | | @ApiOperation(value = "镜片出入库单列表") |
| | | @PostMapping(value = "/inventoryReceiptLensList") |
| | | public ApiResult<PageInfo<TWarehousingLensVO>> inventoryReceiptLensList(@RequestBody TWarehousingDetailLensQuery query) { |
| | | return ApiResult.success(warehousingService.inventoryReceiptLensList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 库存明细记录列表 |
| | | */ |
| | | @ApiOperation(value = "镜架库存明细记录列表") |
| | | @PostMapping(value = "/detailList") |
| | | public ApiResult<PageInfo<TFrameWarehousingDetailVO>> detailList(@RequestBody TWarehousingDetailQuery query) { |
| | | PageInfo<TFrameWarehousingDetailVO> frameWarehousingDetailVOPageInfo = warehousingService.detailList(query); |
| | | return ApiResult.success(frameWarehousingDetailVOPageInfo); |
| | | } |
| | | /** |
| | | * 库存明细记录列表 |
| | | */ |
| | | @ApiOperation(value = "镜片库存明细记录列表--库存详情") |
| | | @PostMapping(value = "/detailLensList") |
| | | public ApiResult<TLensGoodsDetailVO> detailLensList(Integer id) { |
| | | TLensGoodsDetailVO tLensGoodsDetailVO = new TLensGoodsDetailVO(); |
| | | TLensGoods byId = lensGoodsService.getById(id); |
| | | TStore byId1 = storeService.getById(byId.getStoreId()); |
| | | if (byId1!=null){ |
| | | tLensGoodsDetailVO.setStoreName(byId1.getName()); |
| | | } |
| | | TLensSeries byId2 = lensSeriesService.getById(byId.getSeriesId()); |
| | | if (byId2!=null){ |
| | | Integer brandId = byId2.getBrandId(); |
| | | TBrand byId3 = brandService.getById(brandId); |
| | | String t1 = ""; |
| | | switch (byId.getLensType()){ |
| | | case 1: |
| | | t1="球面"; |
| | | break; |
| | | case 2: |
| | | t1="非球面"; |
| | | break; |
| | | case 3: |
| | | t1="双非"; |
| | | break; |
| | | } |
| | | tLensGoodsDetailVO.setTitle(byId3.getName()+byId2.getName()+t1+" "+byId.getRefractiveIndex()); |
| | | } |
| | | // 查询这个商品的库存明细 |
| | | List<TLensWarehousingDetail> list = lensWarehousingDetailService.lambdaQuery().eq(TLensWarehousingDetail::getSeriesId, byId.getSeriesId()) |
| | | .eq(TLensWarehousingDetail::getRefractiveIndex, byId.getRefractiveIndex()).list(); |
| | | tLensGoodsDetailVO.setList(list); |
| | | return ApiResult.success(tLensGoodsDetailVO); |
| | | } |
| | | |
| | | /** |
| | | * 添加镜架出库,入库,作废,退货 |
| | | */ |
| | | @ApiOperation(value = "添加镜架出库,入库,作废,退货") |
| | | @PostMapping(value = "/outBound") |
| | | public ApiResult outBound(@Validated @RequestBody TWarehousingDTO dto) { |
| | | // 获取当前用户 |
| | | String username = JwtTokenUtils.getUsername(); |
| | | dto.setCreateBy(username); |
| | | dto.setCreateTime(LocalDateTime.now()); |
| | | dto.setType(WarehousingTypeEnum.FRAME.getCode()); |
| | | warehousingService.save(dto); |
| | | |
| | | // 添加明细 |
| | | List<TFrameWarehousingDetail> frameWarehousingDetails = dto.getFrameWarehousingDetails(); |
| | | frameWarehousingDetails.forEach(detail -> { |
| | | detail.setWarehousingId(dto.getId()); |
| | | detail.setCode(WarehousingConstant.OUT_BOUND+CodeGenerateUtils.generateVolumeSn()); |
| | | }); |
| | | if (dto.getStatus()==1||dto.getStatus()==3){ |
| | | List<TFrameGoods> list1 = new ArrayList<>(); |
| | | for (TFrameWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { |
| | | TFrameGoods one = frameGoodsService.lambdaQuery().eq(TFrameGoods::getModelId, frameWarehousingDetail.getModelId()) |
| | | .eq(TFrameGoods::getColor, frameWarehousingDetail.getColor()).one(); |
| | | if (one!=null){ |
| | | if (one.getTotal()-frameWarehousingDetail.getTotal()<0){ |
| | | return ApiResult.failed("库存不足"); |
| | | } |
| | | // 增加对应库存 |
| | | one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); |
| | | list1.add(one); |
| | | } |
| | | } |
| | | if (!list1.isEmpty())frameGoodsService.updateBatchById(list1); |
| | | } |
| | | frameWarehousingDetailService.saveBatch(frameWarehousingDetails); |
| | | |
| | | if (dto.getStatus()==2 || dto.getStatus()==4){ |
| | | List<TFrameGoods> list1 = new ArrayList<>(); |
| | | List<TFrameGoods> list2 = new ArrayList<>(); |
| | | for (TFrameWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { |
| | | TFrameGoods one = frameGoodsService.lambdaQuery().eq(TFrameGoods::getModelId, frameWarehousingDetail.getModelId()) |
| | | .eq(TFrameGoods::getColor, frameWarehousingDetail.getColor()).one(); |
| | | if (one!=null){ |
| | | // 增加对应库存 |
| | | one.setTotal(one.getTotal()+frameWarehousingDetail.getTotal()); |
| | | list1.add(one); |
| | | }else { |
| | | // 新增 |
| | | TFrameGoods tFrameGoods = new TFrameGoods(); |
| | | tFrameGoods.setColor(frameWarehousingDetail.getColor()); |
| | | tFrameGoods.setTotal(frameWarehousingDetail.getTotal()); |
| | | tFrameGoods.setModelId(frameWarehousingDetail.getModelId()); |
| | | tFrameGoods.setStoreId(dto.getStoreId()); |
| | | list2.add(tFrameGoods); |
| | | } |
| | | } |
| | | if (!list1.isEmpty())frameGoodsService.updateBatchById(list1); |
| | | if (!list2.isEmpty())frameGoodsService.saveBatch(list2); |
| | | } |
| | | |
| | | return ApiResult.success(dto.getId()); |
| | | } |
| | | /** |
| | | * 添加镜片出库,入库,作废,退货 |
| | | */ |
| | | @ApiOperation(value = "添加镜片出库,入库,作废,退货") |
| | | @PostMapping(value = "/outBoundLens") |
| | | public ApiResult outBoundLens(@Validated @RequestBody TWarehousingLensDTO dto) { |
| | | // 获取当前用户 |
| | | String username = JwtTokenUtils.getUsername(); |
| | | dto.setCreateBy(username); |
| | | dto.setCreateTime(LocalDateTime.now()); |
| | | dto.setType(WarehousingTypeEnum.LENS.getCode()); |
| | | warehousingService.save(dto); |
| | | // 添加明细 |
| | | List<TLensWarehousingDetail> frameWarehousingDetails = dto.getLensWarehousingDetails(); |
| | | frameWarehousingDetails.forEach(detail -> { |
| | | detail.setWarehousingId(dto.getId()); |
| | | detail.setCode(WarehousingConstant.OUT_BOUND+CodeGenerateUtils.generateVolumeSn()); |
| | | }); |
| | | if (dto.getStatus()==1||dto.getStatus()==3){ |
| | | List<TLensGoods> list1 = new ArrayList<>(); |
| | | for (TLensWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { |
| | | TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, frameWarehousingDetail.getSeriesId()) |
| | | .eq(TLensGoods::getRefractiveIndex, frameWarehousingDetail.getRefractiveIndex()) |
| | | .eq(TLensGoods::getLensType, frameWarehousingDetail.getType()) |
| | | .eq(TLensGoods::getBallMirror, frameWarehousingDetail.getBallMirror()) |
| | | .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) |
| | | .one(); |
| | | if (one!=null){ |
| | | if (one.getTotal()-frameWarehousingDetail.getTotal()<0){ |
| | | return ApiResult.failed("库存不足"); |
| | | } |
| | | // 减少对应库存 |
| | | one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); |
| | | list1.add(one); |
| | | } |
| | | } |
| | | if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); |
| | | } |
| | | lensWarehousingDetailService.saveBatch(frameWarehousingDetails); |
| | | |
| | | if (dto.getStatus()==2 || dto.getStatus()==4){ |
| | | List<TLensGoods> list1 = new ArrayList<>(); |
| | | List<TLensGoods> list2 = new ArrayList<>(); |
| | | for (TLensWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { |
| | | TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, frameWarehousingDetail.getSeriesId()) |
| | | .eq(TLensGoods::getRefractiveIndex, frameWarehousingDetail.getRefractiveIndex()) |
| | | .eq(TLensGoods::getBallMirror, frameWarehousingDetail.getBallMirror()) |
| | | .eq(TLensGoods::getLensType, frameWarehousingDetail.getType()) |
| | | |
| | | .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) |
| | | .one(); |
| | | if (one!=null){ |
| | | // 增加对应库存 |
| | | one.setTotal(one.getTotal()+frameWarehousingDetail.getTotal()); |
| | | list1.add(one); |
| | | }else { |
| | | // 新增 |
| | | TLensGoods tFrameGoods = new TLensGoods(); |
| | | tFrameGoods.setLensType(frameWarehousingDetail.getType()); |
| | | tFrameGoods.setSeriesId(frameWarehousingDetail.getSeriesId()); |
| | | tFrameGoods.setBallMirror(frameWarehousingDetail.getBallMirror()); |
| | | tFrameGoods.setColumnMirror(frameWarehousingDetail.getColumnMirror()); |
| | | tFrameGoods.setRefractiveIndex(frameWarehousingDetail.getRefractiveIndex()); |
| | | tFrameGoods.setTotal(frameWarehousingDetail.getTotal()); |
| | | tFrameGoods.setStoreId(dto.getStoreId()); |
| | | list2.add(tFrameGoods); |
| | | } |
| | | } |
| | | if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); |
| | | if (!list2.isEmpty())lensGoodsService.saveBatch(list2); |
| | | } |
| | | return ApiResult.success(dto.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 查询详情 |
| | | */ |
| | | @ApiOperation(value = "镜架查询详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TWarehousingVO> getDetailById(@RequestParam Integer id) { |
| | | TWarehousing warehousing = warehousingService.getById(id); |
| | | TWarehousingVO vo = new TWarehousingVO(); |
| | | BeanUtils.copyProperties(warehousing, vo); |
| | | List<TFrameWarehousingDetail> list = frameWarehousingDetailService.list(Wrappers.lambdaQuery(TFrameWarehousingDetail.class) |
| | | .eq(TFrameWarehousingDetail::getWarehousingId, id)); |
| | | vo.setFrameWarehousingDetails(list); |
| | | // 统计数量 |
| | | vo.setTotalNum(list.stream().mapToInt(TFrameWarehousingDetail::getTotal).sum()); |
| | | return ApiResult.success(vo); |
| | | } |
| | | @ApiOperation(value = "镜片查询详情") |
| | | @GetMapping(value = "/getDetailLensById") |
| | | public ApiResult<TWarehousingLensVO> getDetailLensById(@RequestParam Integer id) { |
| | | TWarehousing warehousing = warehousingService.getById(id); |
| | | TWarehousingLensVO vo = new TWarehousingLensVO(); |
| | | BeanUtils.copyProperties(warehousing, vo); |
| | | List<TLensWarehousingDetail> list = lensWarehousingDetailService.list(Wrappers.lambdaQuery(TLensWarehousingDetail.class) |
| | | .eq(TLensWarehousingDetail::getWarehousingId, id)); |
| | | vo.setLensWarehousingDetails(list); |
| | | // 统计数量 |
| | | vo.setTotalNum(list.stream().mapToInt(TLensWarehousingDetail::getTotal).sum()); |
| | | return ApiResult.success(vo); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import com.jilongda.optometrist.model.TInventory; |
| | | import com.jilongda.optometrist.model.TInventoryFrameDetail; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架盘点DTO") |
| | | public class FrameInventoryDTO extends TInventory { |
| | | |
| | | @ApiModelProperty(value = "镜架明细") |
| | | private List<TInventoryFrameDetail> list; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架查询当前库存DTO") |
| | | public class GetCurrentByParam { |
| | | @ApiModelProperty(value = "镜架型号名称") |
| | | private String model; |
| | | @ApiModelProperty(value = "色号") |
| | | private String color; |
| | | @ApiModelProperty(value = "品牌id") |
| | | private Integer brandId; |
| | | @ApiModelProperty(value = "材质id") |
| | | private Integer materialId; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片查询当前库存DTO") |
| | | public class GetCurrentByParamLens { |
| | | @ApiModelProperty(value = "系列id") |
| | | private Integer seriesId; |
| | | @ApiModelProperty(value = "1球2非球3双非") |
| | | private Integer lensType; |
| | | @ApiModelProperty(value = "品牌id") |
| | | private Integer brandId; |
| | | @ApiModelProperty(value = "折射率") |
| | | private String refractiveIndex; |
| | | @ApiModelProperty(value = "球镜") |
| | | private String ballMirror; |
| | | @ApiModelProperty(value = "柱镜") |
| | | private String columnMirror; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import com.jilongda.optometrist.model.TInventory; |
| | | import com.jilongda.optometrist.model.TInventoryLensDetail; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片盘点DTO") |
| | | public class LensInventoryDTO extends TInventory { |
| | | |
| | | @ApiModelProperty(value = "镜架明细") |
| | | private List<TInventoryLensDetail> list; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import com.jilongda.optometrist.model.SecFeeItems; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "收费项设置修改") |
| | | public class SecFeeItemsDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "收费项") |
| | | private List<SecFeeItems> secFeeItemsList; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架型号DTO") |
| | | public class TModelDTO extends TModel { |
| | | |
| | | @NotNull(message = "镜架色号不能为空") |
| | | @ApiModelProperty(value = "色号集合") |
| | | private List<String> colorList; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架出入库DTO") |
| | | public class TWarehousingDTO extends TWarehousing { |
| | | |
| | | @ApiModelProperty(value = "镜架出入库明细列表") |
| | | private List<TFrameWarehousingDetail> frameWarehousingDetails; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.dto; |
| | | |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片出入库DTO") |
| | | public class TWarehousingLensDTO extends TWarehousing { |
| | | |
| | | @ApiModelProperty(value = "镜架出入库明细列表") |
| | | private List<TLensWarehousingDetail> lensWarehousingDetails; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.log; |
| | | |
| | | import com.jilongda.common.log.OperLoginLog; |
| | | import com.jilongda.common.model.LoginLog; |
| | | import com.jilongda.common.utils.IPUtil; |
| | | import com.jilongda.optometrist.security.SecurityUserDetails; |
| | | import com.jilongda.optometrist.security.SysUserDetailsService; |
| | | import com.jilongda.optometrist.service.LoginLogService; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AnonymousAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.lang.reflect.Method; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * 切面处理类,登录日志记录处理 |
| | | * |
| | | * @author xiaochen |
| | | * @date 2021/12/21 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class LoginLogAspect { |
| | | |
| | | @Autowired |
| | | private LoginLogService loginLogService; |
| | | @Autowired |
| | | private SysUserDetailsService loadUserDetailsService; |
| | | |
| | | /** |
| | | * 设置操作日志切入点 记录登录日志 在注解的位置切入代码 |
| | | */ |
| | | @Pointcut("@annotation(com.jilongda.common.log.OperLoginLog)") |
| | | public void operLoginLogPoinCut() { |
| | | } |
| | | |
| | | /** |
| | | * 正常返回通知,拦截用户登录日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行 |
| | | * |
| | | * @param joinPoint 切入点 |
| | | * @param keys 返回结果 |
| | | */ |
| | | @AfterReturning(value = "operLoginLogPoinCut()", returning = "keys") |
| | | public void saveOperLog(JoinPoint joinPoint, Object keys) { |
| | | // 获取RequestAttributes |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | |
| | | LoginLog operLoginLog = new LoginLog(); |
| | | try { |
| | | // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // 获取切入点所在的方法 |
| | | Method method = signature.getMethod(); |
| | | // 获取操作 |
| | | OperLoginLog opLog = method.getAnnotation(OperLoginLog.class); |
| | | // 获取当前登录用户信息 |
| | | Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); |
| | | String userName = null; |
| | | if (!(authentication instanceof AnonymousAuthenticationToken)) { |
| | | userName = authentication.getName(); |
| | | } |
| | | if (StringUtils.hasLength(userName)) { |
| | | // 通过用户名查询该账号信息 |
| | | SecurityUserDetails userDetails = loadUserDetailsService.loadUserByUsername(userName); |
| | | operLoginLog.setUserName(userDetails.getNickName()); // 请求用户名称 |
| | | operLoginLog.setAccount(userDetails.getAccount()); // 请求账号 |
| | | } |
| | | String ip = IPUtil.getIpAddress(request); |
| | | operLoginLog.setLoginIp(ip); // 请求IP |
| | | // operLoginLog.setLoginAddress(IPAddressUtil.getRealAddress(ip)); // 登录地址,目前服务器带不动 |
| | | String address = IPUtil.getUserLocationByIp(); |
| | | operLoginLog.setLoginAddress(address); |
| | | operLoginLog.setWorkAddress(address); // 工作地 |
| | | operLoginLog.setLoginTime(LocalDateTime.now()); // 登录时间 |
| | | operLoginLog.setAppletOrManage(2); |
| | | loginLogService.save(operLoginLog); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转换request 请求参数 |
| | | * |
| | | * @param paramMap request获取的参数数组 |
| | | */ |
| | | public Map<String, String> converMap(Map<String, String[]> paramMap) { |
| | | Map<String, String> rtnMap = new HashMap<String, String>(); |
| | | for (String key : paramMap.keySet()) { |
| | | rtnMap.put(key, paramMap.get(key)[0]); |
| | | } |
| | | return rtnMap; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.log; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.jilongda.optometrist.service.OperLogService; |
| | | import com.jilongda.common.log.OperationLog; |
| | | import com.jilongda.common.log.ParamParser; |
| | | import com.jilongda.common.model.OperLog; |
| | | import com.jilongda.common.utils.IPUtil; |
| | | import com.jilongda.common.utils.SpringContextUtils; |
| | | import com.jilongda.optometrist.security.SecurityUserDetails; |
| | | import com.jilongda.optometrist.security.SysUserDetailsService; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AnonymousAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.lang.reflect.Method; |
| | | import java.lang.reflect.Parameter; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * 切面处理类,操作日志记录处理 |
| | | * |
| | | * @author xiaochen |
| | | * @date 2021/12/21 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class OperationLogAspect { |
| | | |
| | | @Autowired |
| | | private OperLogService operLogService; |
| | | @Autowired |
| | | private SysUserDetailsService loadUserDetailsService; |
| | | |
| | | /** |
| | | * 设置操作日志切入点 记录操作日志 在注解的位置切入代码 |
| | | */ |
| | | @Pointcut("@annotation(com.jilongda.common.log.OperationLog)") |
| | | public void operLogPoinCut() { |
| | | } |
| | | |
| | | /** |
| | | * 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行 |
| | | * |
| | | * @param joinPoint 切入点 |
| | | * @param keys 返回结果 |
| | | */ |
| | | @AfterReturning(value = "operLogPoinCut()", returning = "keys") |
| | | public void saveOperLog(JoinPoint joinPoint, Object keys) { |
| | | // 获取RequestAttributes |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | // HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | // .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | HttpServletRequest request = SpringContextUtils.getHttpServletRequest(); |
| | | |
| | | OperLog operlog = new OperLog(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | try { |
| | | // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // 获取切入点所在的方法 |
| | | Method method = signature.getMethod(); |
| | | // 获取操作 |
| | | OperationLog opLog = method.getAnnotation(OperationLog.class); |
| | | if (opLog != null) { |
| | | String operModul = opLog.operModul(); |
| | | String operType = opLog.operType(); |
| | | String operDesc = opLog.operDesc(); |
| | | operlog.setOperModel(operModul); // 操作模块 |
| | | operlog.setOperType(operType); // 操作类型 |
| | | operlog.setOperDesc(operDesc); // 操作描述 |
| | | } |
| | | // 获取请求的类名 |
| | | String className = joinPoint.getTarget().getClass().getName(); |
| | | // 获取请求的方法名 |
| | | String methodName = method.getName(); |
| | | methodName = className + "." + methodName; |
| | | operlog.setOperMethod(methodName); // 请求方法 |
| | | |
| | | // 请求的参数 |
| | | // 请求的参数 |
| | | // 操作简述绑定参数 |
| | | Object paramParserObj = null; |
| | | String requestArgs; |
| | | Parameter[] parameters = method.getParameters(); |
| | | if (parameters != null && parameters.length > 0) { |
| | | for (int i = 0; i < parameters.length; i++) { |
| | | ParamParser an = parameters[i].getDeclaredAnnotation(ParamParser.class); |
| | | if (an != null) { |
| | | paramParserObj = an.value(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | // 不止一个参数 |
| | | if (paramParserObj != null) { |
| | | requestArgs = sb.append(":").append(paramParserObj).toString(); |
| | | } else { |
| | | requestArgs = JSONObject.toJSONString(joinPoint.getArgs()); |
| | | } |
| | | operlog.setOperReqParam(requestArgs); |
| | | |
| | | // 获取当前登录用户信息 |
| | | Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); |
| | | String userName = null; |
| | | if (!(authentication instanceof AnonymousAuthenticationToken)) { |
| | | userName = authentication.getName(); |
| | | } |
| | | if (StringUtils.hasLength(userName)) { |
| | | // 通过用户名查询该账号信息 |
| | | SecurityUserDetails userDetails = loadUserDetailsService.loadUserByUsername(userName); |
| | | operlog.setOperUserName(userDetails.getNickName()); // 请求用户名称 |
| | | operlog.setOperAccount(userDetails.getAccount()); // 请求账号 |
| | | } |
| | | // operlog.setOperRespParam(JSON.toJSONString(keys)); // 返回结果 |
| | | // operlog.setOperUserId(UserShiroUtil.getCurrentUserLoginName()); // 请求用户ID |
| | | operlog.setOperIp(IPUtil.getIpAddress(request)); // 请求IP |
| | | operlog.setOperUri(request.getRequestURI()); // 请求URI |
| | | operlog.setOperOperationTime(LocalDateTime.now()); // 创建时间 |
| | | // operlog.setOperVer(operVer); // 操作版本 |
| | | operLogService.save(operlog); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行 |
| | | * |
| | | * @param joinPoint 切入点 |
| | | * @param e 异常信息 |
| | | */ |
| | | /*@AfterThrowing(pointcut = "operExceptionLogPoinCut()", throwing = "e") |
| | | public void saveExceptionLog(JoinPoint joinPoint, Throwable e) { |
| | | // 获取RequestAttributes |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | |
| | | ExceptionLog excepLog = new ExceptionLog(); |
| | | try { |
| | | // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // 获取切入点所在的方法 |
| | | Method method = signature.getMethod(); |
| | | excepLog.setExcId(UuidUtil.get32UUID()); |
| | | // 获取请求的类名 |
| | | String className = joinPoint.getTarget().getClass().getName(); |
| | | // 获取请求的方法名 |
| | | String methodName = method.getName(); |
| | | methodName = className + "." + methodName; |
| | | // 请求的参数 |
| | | Map<String, String> rtnMap = converMap(request.getParameterMap()); |
| | | // 将参数所在的数组转换成json |
| | | String params = JSON.toJSONString(rtnMap); |
| | | excepLog.setExcRequParam(params); // 请求参数 |
| | | excepLog.setOperMethod(methodName); // 请求方法名 |
| | | excepLog.setExcName(e.getClass().getName()); // 异常名称 |
| | | excepLog.setExcMessage(stackTraceToString(e.getClass().getName(), e.getMessage(), e.getStackTrace())); // 异常信息 |
| | | excepLog.setOperUserId(UserShiroUtil.getCurrentUserLoginName()); // 操作员ID |
| | | excepLog.setOperUserName(UserShiroUtil.getCurrentUserName()); // 操作员名称 |
| | | excepLog.setOperUri(request.getRequestURI()); // 操作URI |
| | | excepLog.setOperIp(IPUtil.getRemortIP(request)); // 操作员IP |
| | | excepLog.setOperVer(operVer); // 操作版本号 |
| | | excepLog.setOperCreateTime(new Date()); // 发生异常时间 |
| | | |
| | | exceptionLogService.insert(excepLog); |
| | | |
| | | } catch (Exception e2) { |
| | | e2.printStackTrace(); |
| | | } |
| | | |
| | | }*/ |
| | | |
| | | /** |
| | | * 转换request 请求参数 |
| | | * |
| | | * @param paramMap request获取的参数数组 |
| | | */ |
| | | public Map<String, String> converMap(Map<String, String[]> paramMap) { |
| | | Map<String, String> rtnMap = new HashMap<String, String>(); |
| | | for (String key : paramMap.keySet()) { |
| | | rtnMap.put(key, paramMap.get(key)[0]); |
| | | } |
| | | return rtnMap; |
| | | } |
| | | |
| | | /** |
| | | * 获取方法中请求参数 json格式 |
| | | * |
| | | * @param request |
| | | * @return |
| | | * @throws ServletException |
| | | * @throws IOException |
| | | */ |
| | | public Map<String, String> getJSON(HttpServletRequest request) throws ServletException, IOException { |
| | | |
| | | BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8")); |
| | | StringBuilder responseStrBuilder = new StringBuilder(); |
| | | String inputStr; |
| | | while ((inputStr = streamReader.readLine()) != null) { |
| | | responseStrBuilder.append(inputStr); |
| | | } |
| | | Map<String, String> params = JSON.parseObject(responseStrBuilder.toString(), Map.class); |
| | | |
| | | return params; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转换异常信息为字符串 |
| | | * |
| | | * @param exceptionName 异常名称 |
| | | * @param exceptionMessage 异常信息 |
| | | * @param elements 堆栈信息 |
| | | */ |
| | | public String stackTraceToString(String exceptionName, String exceptionMessage, StackTraceElement[] elements) { |
| | | StringBuffer strbuff = new StringBuffer(); |
| | | for (StackTraceElement stet : elements) { |
| | | strbuff.append(stet + "\n"); |
| | | } |
| | | String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff.toString(); |
| | | return message; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.model.LoginLog; |
| | | import com.jilongda.optometrist.query.LoginLogQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 登录日志 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-09-21 |
| | | */ |
| | | public interface LoginLogMapper extends BaseMapper<LoginLog> { |
| | | |
| | | /** |
| | | * 登录日志分页列表查询 |
| | | * |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<LoginLog> pageList(@Param("query") LoginLogQuery query, @Param("pageInfo") PageInfo<LoginLog> pageInfo); |
| | | |
| | | Long countToday(@Param("today") LocalDate today); |
| | | |
| | | Long countYesterday(@Param("yesterday") LocalDate yesterday); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.model.OperLog; |
| | | import com.jilongda.optometrist.query.OperLogQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 操作日志 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-09-21 |
| | | */ |
| | | public interface OperLogMapper extends BaseMapper<OperLog> { |
| | | |
| | | /** |
| | | * 操作日志分页列表查询 |
| | | * |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<OperLog> pageList(@Param("query") OperLogQuery query, @Param("pageInfo") PageInfo<OperLog> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.model.Region; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市区三级联动 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 吕雪 |
| | | * @since 2019-12-30 |
| | | */ |
| | | public interface RegionMapper extends BaseMapper<Region> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.optometrist.model.SecFeeItems; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置-收费项设置 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface SecFeeItemsMapper extends BaseMapper<SecFeeItems> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.model.SecSetting; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface SecSettingMapper extends BaseMapper<SecSetting> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TAppUserQuery; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TAppUserMapper extends BaseMapper<TAppUser> { |
| | | |
| | | List<TAppUserVO> pageList(@Param("query")TAppUserQuery query, @Param("pageInfo")PageInfo<TAppUserVO> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TBrand; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TBrandQuery; |
| | | import com.jilongda.optometrist.vo.TBrandVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片品牌表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Mapper |
| | | public interface TBrandMapper extends BaseMapper<TBrand> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TBrandVO> pageList(@Param("query") TBrandQuery query, @Param("pageInfo")PageInfo<TBrandVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TCoupon; |
| | | import com.jilongda.optometrist.query.TCouponQuery; |
| | | import com.jilongda.optometrist.vo.TCouponVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TCouponMapper extends BaseMapper<TCoupon> { |
| | | |
| | | List<TCouponVO> pageList(@Param("query")TCouponQuery query,@Param("pageInfo") PageInfo<TCouponVO> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TCouponReceive; |
| | | import com.jilongda.optometrist.query.TAppUserCouponQuery; |
| | | import com.jilongda.optometrist.vo.TAppUserCouponVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TCouponReceiveMapper extends BaseMapper<TCouponReceive> { |
| | | |
| | | List<TAppUserCouponVO> pageList(@Param("query")TAppUserCouponQuery query, @Param("pageInfo")PageInfo<TAppUserCouponVO> pageInfo); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TFrameGoods; |
| | | import com.jilongda.optometrist.query.TAppUserQuery; |
| | | import com.jilongda.optometrist.query.TFrameGoodsQuery; |
| | | import com.jilongda.optometrist.query.TOptometryQuery; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | import com.jilongda.optometrist.vo.TFrameGoodsVO; |
| | | import com.jilongda.optometrist.vo.TOptometryVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TFrameGoodsMapper extends BaseMapper<TFrameGoods> { |
| | | |
| | | |
| | | List<TFrameGoodsVO> lensReceiptList(@Param("query")TFrameGoodsQuery query, @Param("pageInfo")PageInfo<TFrameGoodsVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailQuery; |
| | | import com.jilongda.optometrist.vo.TFrameWarehousingDetailVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架出库入库详细表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Mapper |
| | | public interface TFrameWarehousingDetailMapper extends BaseMapper<TFrameWarehousingDetail> { |
| | | |
| | | /** |
| | | * 分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TFrameWarehousingDetailVO> pageList(@Param("query") TWarehousingDetailQuery query, @Param("pageInfo") PageInfo<TFrameWarehousingDetailVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.optometrist.model.TInventoryFrameDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 材质表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TInventoryFrameDetailMapper extends BaseMapper<TInventoryFrameDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.optometrist.model.TInventoryLensDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架盘点详细表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TInventoryLensDetailMapper extends BaseMapper<TInventoryLensDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TInventory; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TInventoryQuery; |
| | | import com.jilongda.optometrist.query.TLensGoodsQuery; |
| | | import com.jilongda.optometrist.vo.TInventoryVO; |
| | | import com.jilongda.optometrist.vo.TLensGoodsVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 盘点表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TInventoryMapper extends BaseMapper<TInventory> { |
| | | |
| | | List<TInventoryVO> pageList(@Param("query")TInventoryQuery query, @Param("pageInfo")PageInfo<TInventoryVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TFrameGoods; |
| | | import com.jilongda.optometrist.model.TLensGoods; |
| | | import com.jilongda.optometrist.query.TFrameGoodsQuery; |
| | | import com.jilongda.optometrist.query.TLensGoodsQuery; |
| | | import com.jilongda.optometrist.vo.TFrameGoodsVO; |
| | | import com.jilongda.optometrist.vo.TLensGoodsVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLensGoodsMapper extends BaseMapper<TLensGoods> { |
| | | |
| | | |
| | | List<TLensGoodsVO> lensReceiptList(@Param("query")TLensGoodsQuery query, @Param("pageInfo")PageInfo<TLensGoodsVO> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TLensSeries; |
| | | import com.jilongda.optometrist.query.TLensSeriesQuery; |
| | | import com.jilongda.optometrist.vo.TLensSeriesVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片系列表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLensSeriesMapper extends BaseMapper<TLensSeries> { |
| | | List<TLensSeriesVO> pageList(@Param("query")TLensSeriesQuery query, @Param("pageInfo")PageInfo<TLensSeriesVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailLensQuery; |
| | | import com.jilongda.optometrist.vo.TLensWarehousingDetailVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片出库入库明细表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLensWarehousingDetailMapper extends BaseMapper<TLensWarehousingDetail> { |
| | | |
| | | List<TLensWarehousingDetailVO> pageLensList(@Param("query")TWarehousingDetailLensQuery query,@Param("pageInfo") PageInfo<TLensWarehousingDetailVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TLineUp; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TLineUpQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 排号管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLineUpMapper extends BaseMapper<TLineUp> { |
| | | |
| | | List<TLineUp> pageList(@Param("query")TLineUpQuery query, @Param("pageInfo") PageInfo<TLineUp> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TMaterial; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TMaterialQuery; |
| | | import com.jilongda.optometrist.vo.TMaterialVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片品牌表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Mapper |
| | | public interface TMaterialMapper extends BaseMapper<TMaterial> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TMaterialVO> pageList(@Param("query") TMaterialQuery query, @Param("pageInfo")PageInfo<TMaterialVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import com.jilongda.optometrist.query.TModelQuery; |
| | | import com.jilongda.optometrist.vo.TModelVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架型号表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TModelMapper extends BaseMapper<TModel> { |
| | | |
| | | /** |
| | | * 分页查询镜架型号 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TModelVO> pageList(@Param("query") TModelQuery query, @Param("pageInfo")PageInfo<TModelVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import com.jilongda.optometrist.query.TOptometristQuery; |
| | | import com.jilongda.optometrist.query.TOptometryQuery; |
| | | import com.jilongda.optometrist.vo.TOptometristVO; |
| | | import com.jilongda.optometrist.vo.TOptometryVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光师表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOptometristMapper extends BaseMapper<TOptometrist> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOptometristVO> pageList1(@Param("query") TOptometristQuery query, @Param("pageInfo")PageInfo<TOptometristVO> pageInfo); |
| | | List<TOptometryVO> pageList(@Param("query") TOptometryQuery query, @Param("pageInfo")PageInfo<TOptometryVO> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.optometrist.model.TOptometryDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单详情 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOptometryDetailMapper extends BaseMapper<TOptometryDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.optometrist.model.TOptometry; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOptometryMapper extends BaseMapper<TOptometry> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.optometrist.model.TOrderAccounting; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单核算表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOrderAccountingMapper extends BaseMapper<TOrderAccounting> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TOrderAftersales; |
| | | import com.jilongda.optometrist.query.TOrderAftersalesQuery; |
| | | import com.jilongda.optometrist.vo.TOrderAftersalesVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单售后表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOrderAftersalesMapper extends BaseMapper<TOrderAftersales> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOrderAftersalesVO> pageList(@Param("query") TOrderAftersalesQuery query, @Param("pageInfo")PageInfo<TOrderAftersalesVO> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.optometrist.model.TOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 销售订单表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOrderMapper extends BaseMapper<TOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TStoreQuery; |
| | | import com.jilongda.optometrist.vo.TStoreVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 门店表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Mapper |
| | | public interface TStoreMapper extends BaseMapper<TStore> { |
| | | |
| | | /** |
| | | * 获取门店分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TStoreVO> pageList(@Param("query") TStoreQuery query, @Param("pageInfo")PageInfo<TStoreVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import com.jilongda.optometrist.query.TSupplierQuery; |
| | | import com.jilongda.optometrist.vo.TSupplierVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Mapper |
| | | public interface TSupplierMapper extends BaseMapper<TSupplier> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TSupplierVO> pageList(@Param("query") TSupplierQuery query, @Param("pageInfo")PageInfo<TSupplierVO> pageInfo); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TTicket; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.optometrist.query.TicketQuery; |
| | | import com.jilongda.optometrist.vo.TTicketVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 小票机 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TTicketMapper extends BaseMapper<TTicket> { |
| | | |
| | | /** |
| | | * 分页查询小票机列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TTicketVO> pageList(@Param("query") TicketQuery query, @Param("pageInfo")PageInfo<TTicketVO> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.model.TUser; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-04-15 |
| | | */ |
| | | public interface TUserMapper extends BaseMapper<TUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailLensQuery; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailQuery; |
| | | import com.jilongda.optometrist.vo.TWarehousingLensVO; |
| | | import com.jilongda.optometrist.vo.TWarehousingVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片出库入库表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TWarehousingMapper extends BaseMapper<TWarehousing> { |
| | | |
| | | /** |
| | | * |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TWarehousingVO> inventoryReceiptList(@Param("query") TWarehousingDetailQuery query, @Param("pageInfo")PageInfo<TWarehousingVO> pageInfo); |
| | | |
| | | List<TWarehousingLensVO> inventoryReceiptLensList(@Param("query")TWarehousingDetailLensQuery query, @Param("pageInfo")PageInfo<TWarehousingLensVO> pageInfo); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 行政区域数据 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/2/9 10:00 |
| | | */ |
| | | @Data |
| | | @TableName("t_region") |
| | | @ApiModel(value = "省市区实体") |
| | | public class Region { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 城市名称 |
| | | */ |
| | | @TableField("name") |
| | | @ApiModelProperty("省/市 名称") |
| | | private String name; |
| | | /** |
| | | * 城市code |
| | | */ |
| | | @TableField("code") |
| | | @ApiModelProperty("省/市 编码") |
| | | private String code; |
| | | /** |
| | | * 父级id |
| | | */ |
| | | @TableField("parent_id") |
| | | private Integer parentId; |
| | | |
| | | /** |
| | | * 子集 |
| | | */ |
| | | @TableField(exist = false) |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | @ApiModelProperty("子集") |
| | | private List<Region> children = new ArrayList<>(); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置-收费项设置 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sec_fee_items") |
| | | @ApiModel(value="SecFeeItems对象", description="系统设置-收费项设置 ") |
| | | public class SecFeeItems extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "收费项名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手续费比例") |
| | | @TableField("percent") |
| | | private BigDecimal percent; |
| | | |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sec_setting") |
| | | @ApiModel(value="SecSetting对象", description="系统设置 ") |
| | | public class SecSetting extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "镜片警告阈值") |
| | | @TableField("lensThreshold") |
| | | private Integer lensThreshold; |
| | | |
| | | @ApiModelProperty(value = "镜架警告阈值") |
| | | @TableField("frameThreshold") |
| | | private Integer frameThreshold; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user") |
| | | @ApiModel(value="TAppUser对象", description="用户表") |
| | | public class TAppUser extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | @TableField("name") |
| | | private String name; |
| | | @ApiModelProperty(value = "微信openId") |
| | | @TableField("openId") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | @TableField("realName") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | @TableField("age") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "性别1男2女3保密") |
| | | @TableField("gender") |
| | | private Integer gender; |
| | | @ApiModelProperty(value = "状态 1=启用 0=禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "头像") |
| | | @TableField("avatar") |
| | | private String avatar; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片品牌表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_brand") |
| | | @ApiModel(value="TBrand对象", description="镜架/镜片品牌表") |
| | | public class TBrand extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "品牌名称") |
| | | @Length(max = 15,message = "品牌名称不能超过15个字符") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "类型 1镜架 2镜片") |
| | | @NotNull(message = "品牌类型不能为空") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "是否为主要品牌 1是2否") |
| | | @TableField("isMain") |
| | | private Integer isMain; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取记录 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_coupon") |
| | | @ApiModel(value="TCoupon对象", description="优惠券领取记录") |
| | | public class TCoupon extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "发放方式 1注册发放 2全局发放 3指定发放 4扫码发放") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "优惠金额") |
| | | @TableField("amount") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "门店id 空字符串表示不限门店") |
| | | @TableField("storeId") |
| | | private String storeId; |
| | | |
| | | @ApiModelProperty(value = " 有效期(天)最高365 0表示无期限") |
| | | @TableField("time") |
| | | private Integer time; |
| | | |
| | | @ApiModelProperty(value = "优惠条件金额 为0则表示通用券") |
| | | @TableField("amountCondition") |
| | | private BigDecimal amountCondition; |
| | | |
| | | @ApiModelProperty(value = "发放状态1发放中 2暂停发放 只有发放方式为1和4的时候存储") |
| | | @TableField("grantStatus") |
| | | private Integer grantStatus; |
| | | |
| | | @ApiModelProperty(value = "指定发放时传 用户id集合") |
| | | @TableField(exist = false) |
| | | private List<Integer> userIds; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_coupon_receive") |
| | | @ApiModel(value="TCouponReceive对象", description="优惠券") |
| | | public class TCouponReceive extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "优惠券id") |
| | | @TableField("couponId") |
| | | private Integer couponId; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "发放方式 1注册发放 2全局发放 3指定发放 4扫码发放") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "优惠金额") |
| | | @TableField("amount") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "门店id 字段为null表示全部") |
| | | @TableField("storeId") |
| | | private String storeId; |
| | | |
| | | @ApiModelProperty(value = "有效期截止日期") |
| | | @TableField("endTime") |
| | | private LocalDateTime endTime; |
| | | @ApiModelProperty(value = "使用时间") |
| | | @TableField("useTime") |
| | | private LocalDateTime useTime; |
| | | |
| | | @ApiModelProperty(value = "优惠条件金额 为0则表示通用券") |
| | | @TableField("amountCondition") |
| | | private BigDecimal amountCondition; |
| | | |
| | | @ApiModelProperty(value = "1待使用 2已使用 3已过期") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_frame_goods") |
| | | @ApiModel(value="TFrameGoods对象", description="用户表") |
| | | public class TFrameGoods extends BaseModel { |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | @ApiModelProperty(value = "色号") |
| | | @TableField("color") |
| | | private String color; |
| | | @ApiModelProperty(value = "库存") |
| | | @TableField("total") |
| | | private Integer total; |
| | | @ApiModelProperty(value = "型号id") |
| | | @TableField("modelId") |
| | | private Integer modelId; |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "1启用2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架出库入库详细表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_frame_warehousing_detail") |
| | | @ApiModel(value="TFrameWarehousingDetail对象", description="镜架出库入库详细表") |
| | | public class TFrameWarehousingDetail extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "入库出库表id") |
| | | @TableField("warehousingId") |
| | | private Integer warehousingId; |
| | | |
| | | @ApiModelProperty(value = "品牌") |
| | | @TableField("brand") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "供应商") |
| | | @TableField("supplier") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value = "材质") |
| | | @TableField("material") |
| | | private String material; |
| | | |
| | | @ApiModelProperty(value = "入库/出库总数量") |
| | | @TableField("total") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty(value = "色号") |
| | | @TableField("color") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "镜架型号") |
| | | @TableField("model") |
| | | private String model; |
| | | |
| | | @ApiModelProperty(value = "入库编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "型号id") |
| | | @TableField("modelId") |
| | | private Integer modelId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 盘点表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_inventory") |
| | | @ApiModel(value="TInventory对象", description="盘点表") |
| | | public class TInventory extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "盘点类型1型号2品牌3材质4球/柱镜5折射率6系列") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "1镜架2镜片") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 材质表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_inventory_frame_detail") |
| | | @ApiModel(value="TInventoryFrameDetail对象", description="材质表") |
| | | public class TInventoryFrameDetail extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "盘点表id 前端忽略") |
| | | @TableField("inventoryId") |
| | | private Integer inventoryId; |
| | | |
| | | @ApiModelProperty(value = "品牌") |
| | | @TableField("brand") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "供应商") |
| | | @TableField("supplier") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value = "材质") |
| | | @TableField("material") |
| | | private String material; |
| | | |
| | | @ApiModelProperty(value = "库存总数量") |
| | | @TableField("total") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty(value = "盘点类型 1型号2品牌3材质") |
| | | @TableField("category") |
| | | private Integer category; |
| | | |
| | | @ApiModelProperty(value = "色号") |
| | | @TableField("color") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "镜架型号") |
| | | @TableField("model") |
| | | private String model; |
| | | |
| | | @ApiModelProperty(value = "盘点数量") |
| | | @TableField("count") |
| | | private Integer count; |
| | | |
| | | @ApiModelProperty(value = "差值") |
| | | @TableField("diff") |
| | | private Integer diff; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架盘点详细表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_inventory_lens_detail") |
| | | @ApiModel(value="TInventoryLensDetail对象", description="镜架盘点详细表") |
| | | public class TInventoryLensDetail extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "盘点表id") |
| | | @TableField("inventoryId") |
| | | private Integer inventoryId; |
| | | |
| | | @ApiModelProperty(value = "系列") |
| | | @TableField("series") |
| | | private String series; |
| | | |
| | | @ApiModelProperty(value = "1球面 2非球面 3双非") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "库存总数量") |
| | | @TableField("total") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty(value = "盘点数量") |
| | | @TableField("count") |
| | | private Integer count; |
| | | |
| | | @ApiModelProperty(value = "差值") |
| | | @TableField("diff") |
| | | private Integer diff; |
| | | |
| | | @ApiModelProperty(value = "折射率") |
| | | @TableField("refractiveIndex") |
| | | private String refractiveIndex; |
| | | |
| | | @ApiModelProperty(value = "球镜") |
| | | @TableField("ballMirror") |
| | | private String ballMirror; |
| | | |
| | | @ApiModelProperty(value = "柱镜") |
| | | @TableField("columnMirror") |
| | | private String columnMirror; |
| | | |
| | | @ApiModelProperty(value = "盘点类型 1球/柱镜2折射率3系列") |
| | | @TableField("category") |
| | | private Integer category; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_lens_goods") |
| | | @ApiModel(value="TLensGoods对象", description="用户表") |
| | | public class TLensGoods extends BaseModel { |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | @ApiModelProperty(value = "系列id") |
| | | @TableField("seriesId") |
| | | private Integer seriesId; |
| | | @ApiModelProperty(value = "球镜") |
| | | @TableField("ballMirror") |
| | | private String ballMirror; |
| | | @ApiModelProperty(value = "柱镜") |
| | | @TableField("columnMirror") |
| | | private String columnMirror; |
| | | @ApiModelProperty(value = "折射率") |
| | | @TableField("refractiveIndex") |
| | | private String refractiveIndex; |
| | | @ApiModelProperty(value = "库存") |
| | | @TableField("total") |
| | | private Integer total; |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "1启用2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "1球2非球3双非") |
| | | @TableField("lensType") |
| | | private Integer lensType; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片系列表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_lens_series") |
| | | @ApiModel(value="TLensSeries对象", description="镜片系列表") |
| | | public class TLensSeries extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "系列名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "品牌id") |
| | | @TableField("brandId") |
| | | private Integer brandId; |
| | | |
| | | @ApiModelProperty(value = "供应商id") |
| | | @TableField("supplierId") |
| | | private Integer supplierId; |
| | | |
| | | @ApiModelProperty(value = "库存类型 1库存 2非库存") |
| | | @TableField("type") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "状态 1启用2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "球面 refractiveIndex=折射率 cost=成本 sales售价 例:[{\"refractiveIndex\":\"5\",\"cost\":\"20\",\"sales\":\"2\"}]") |
| | | @TableField("sphere") |
| | | private String sphere; |
| | | |
| | | @ApiModelProperty(value = "非球面 refractiveIndex=折射率 cost=成本 sales售价 例:[{\"refractiveIndex\":\"5\",\"cost\":\"20\",\"sales\":\"2\"}]") |
| | | @TableField("asphericSurface") |
| | | private String asphericSurface; |
| | | |
| | | @ApiModelProperty(value = "双非 refractiveIndex=折射率 cost=成本 sales售价 例:[{\"refractiveIndex\":\"5\",\"cost\":\"20\",\"sales\":\"2\"}]") |
| | | @TableField("doubleNon") |
| | | private String doubleNon; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片出库入库明细表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_lens_warehousing_detail") |
| | | @ApiModel(value="TLensWarehousingDetail对象", description="镜片出库入库明细表") |
| | | public class TLensWarehousingDetail extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "品牌") |
| | | @TableField("brand") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "供应商") |
| | | @TableField("supplier") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value = "系列") |
| | | @TableField("series") |
| | | private String series; |
| | | |
| | | @ApiModelProperty(value = "折射率") |
| | | @TableField("refractiveIndex") |
| | | private String refractiveIndex; |
| | | |
| | | @ApiModelProperty(value = "球镜") |
| | | @TableField("ballMirror") |
| | | private String ballMirror; |
| | | |
| | | @ApiModelProperty(value = "柱镜") |
| | | @TableField("columnMirror") |
| | | private String columnMirror; |
| | | |
| | | @ApiModelProperty(value = "1球面 2非球面 3双非") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "入库/出库数量") |
| | | @TableField("total") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty(value = "在库数量(出库没有该字段)") |
| | | @TableField("count") |
| | | private Integer count; |
| | | |
| | | @ApiModelProperty(value = "系列id") |
| | | @TableField("seriesId") |
| | | private Integer seriesId; |
| | | @ApiModelProperty(value = "出入库主表id") |
| | | @TableField("warehousingId") |
| | | private Integer warehousingId; |
| | | @ApiModelProperty(value = "入库编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 排号管理 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_line_up") |
| | | @ApiModel(value="TLineUp对象", description="排号管理") |
| | | public class TLineUp extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableField("code") |
| | | private String code; |
| | | @ApiModelProperty(value = "微信名称") |
| | | @TableField(exist = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | @ApiModelProperty(value = "验光师") |
| | | @TableField(exist = false) |
| | | private String optometrist; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "验光师id") |
| | | @TableField("optometristId") |
| | | private Integer optometristId; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "状态1排队中2验光中3已完成4已过号5已取消") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片品牌表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_material") |
| | | @ApiModel(value="TMaterial对象", description="镜架/镜片品牌表") |
| | | public class TMaterial extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "材质名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架型号表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_model") |
| | | @ApiModel(value="TModel对象", description="镜架型号表") |
| | | public class TModel extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "品牌id") |
| | | @NotNull(message = "品牌不可为空") |
| | | @TableField("brandId") |
| | | private Integer brandId; |
| | | |
| | | @ApiModelProperty(value = "供应商id") |
| | | @NotNull(message = "供应商不可为空") |
| | | @TableField("supplierId") |
| | | private Integer supplierId; |
| | | |
| | | @ApiModelProperty(value = "材质id") |
| | | @NotNull(message = "材质不可为空") |
| | | @TableField("materialId") |
| | | private Integer materialId; |
| | | |
| | | @ApiModelProperty(value = "色号") |
| | | @TableField("color") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "售价") |
| | | @TableField("sale") |
| | | private BigDecimal sale; |
| | | |
| | | @ApiModelProperty(value = "成本价") |
| | | @TableField("cost") |
| | | private BigDecimal cost; |
| | | |
| | | @ApiModelProperty(value = "镜架型号") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "库存") |
| | | @TableField("inventory") |
| | | private Integer inventory; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光师表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_optometrist") |
| | | @ApiModel(value="TOptometrist对象", description="验光师表") |
| | | public class TOptometrist extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "验光师名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "照片") |
| | | @TableField("img") |
| | | private String img; |
| | | |
| | | @ApiModelProperty(value = "注册时间") |
| | | @TableField("registerTime") |
| | | private LocalDateTime registerTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_optometry") |
| | | @ApiModel(value="TOptometry对象", description="验光单") |
| | | public class TOptometry extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | @TableField("age") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "性别 1男2女") |
| | | @TableField("gender") |
| | | private Integer gender; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | @TableField("realName") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "验光师id") |
| | | @TableField("optometristId") |
| | | private Integer optometristId; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "状态1排队中2验光中3已完成4已过号5已取消") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "注册时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @TableField("registerTime") |
| | | private LocalDateTime registerTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单详情 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_optometry_detail") |
| | | @ApiModel(value="TOptometryDetail对象", description="验光单详情") |
| | | public class TOptometryDetail extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "类型1配镜处方 2完全矫正 3旧镜信息") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "验光单id") |
| | | @TableField("optometryId") |
| | | private Integer optometryId; |
| | | |
| | | @ApiModelProperty(value = "球镜") |
| | | @TableField("ballMirror") |
| | | private Double ballMirror; |
| | | |
| | | @ApiModelProperty(value = "柱镜") |
| | | @TableField("columnMirror") |
| | | private Double columnMirror; |
| | | |
| | | @ApiModelProperty(value = "轴位") |
| | | @TableField("axis") |
| | | private String axis; |
| | | |
| | | @ApiModelProperty(value = "add") |
| | | @TableField("add") |
| | | private String add; |
| | | |
| | | @ApiModelProperty(value = "瞳高") |
| | | @TableField("pupilHeight") |
| | | private String pupilHeight; |
| | | |
| | | @ApiModelProperty(value = "瞳距") |
| | | @TableField("pupilDistance") |
| | | private String pupilDistance; |
| | | |
| | | @ApiModelProperty(value = "矫正") |
| | | @TableField("correct") |
| | | private String correct; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "左眼右眼 1为L 2为R") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "注册时间") |
| | | @TableField("registerTime") |
| | | private LocalDateTime registerTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 销售订单表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order") |
| | | @ApiModel(value="TOrder对象", description="销售订单表") |
| | | public class TOrder extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "验光单id") |
| | | @TableField("optometryId") |
| | | private Integer optometryId; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "镜架型号id") |
| | | @TableField("modelId") |
| | | private Integer modelId; |
| | | |
| | | @ApiModelProperty(value = "镜架色号") |
| | | @TableField("color") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "镜片系列id") |
| | | @TableField("series") |
| | | private Integer series; |
| | | |
| | | @ApiModelProperty(value = "镜片右 球镜+柱镜 逗号拼接 字段为空 客户自带") |
| | | @TableField("rLens") |
| | | private String rLens; |
| | | |
| | | @ApiModelProperty(value = "镜片左 球镜+柱镜 逗号拼接 字段为空 客户自带") |
| | | @TableField("lLens") |
| | | private String lLens; |
| | | |
| | | @ApiModelProperty(value = "1球 2非球面 3双非") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "折射率") |
| | | @TableField("refractiveIndex") |
| | | private String refractiveIndex; |
| | | |
| | | @ApiModelProperty(value = "店铺员工id") |
| | | @TableField("sysId") |
| | | private Integer sysId; |
| | | |
| | | @ApiModelProperty(value = "优惠券id") |
| | | @TableField("couponId") |
| | | private Integer couponId; |
| | | |
| | | @ApiModelProperty(value = "收费项id") |
| | | @TableField("itemsId") |
| | | private Integer itemsId; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "是否邮寄 1是2否") |
| | | @TableField("isMail") |
| | | private Integer isMail; |
| | | |
| | | @ApiModelProperty(value = "收件人姓名") |
| | | @TableField("mailName") |
| | | private String mailName; |
| | | |
| | | @ApiModelProperty(value = "收件人电话") |
| | | @TableField("mailPhone") |
| | | private String mailPhone; |
| | | |
| | | @ApiModelProperty(value = "收件人地址") |
| | | @TableField("mailAddress") |
| | | private String mailAddress; |
| | | |
| | | @ApiModelProperty(value = "订单总金额") |
| | | @TableField("orderMoney") |
| | | private BigDecimal orderMoney; |
| | | |
| | | @ApiModelProperty(value = "优惠金额") |
| | | @TableField("couponMoney") |
| | | private BigDecimal couponMoney; |
| | | |
| | | @ApiModelProperty(value = "支付金额") |
| | | @TableField("payMoney") |
| | | private BigDecimal payMoney; |
| | | |
| | | @ApiModelProperty(value = "是否加工 1是2否") |
| | | @TableField("isMachining") |
| | | private Integer isMachining; |
| | | |
| | | @ApiModelProperty(value = "加工编号") |
| | | @TableField("machiningCode") |
| | | private String machiningCode; |
| | | |
| | | @ApiModelProperty(value = "是否核算 1是2否") |
| | | @TableField("isAccounting") |
| | | private Integer isAccounting; |
| | | |
| | | @ApiModelProperty(value = "核算人") |
| | | @TableField("accountingName") |
| | | private String accountingName; |
| | | |
| | | @ApiModelProperty(value = "核算时间") |
| | | @TableField("accountingTime") |
| | | private LocalDateTime accountingTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单核算表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order_accounting") |
| | | @ApiModel(value="TOrderAccounting对象", description="订单核算表") |
| | | public class TOrderAccounting extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableField("orderId") |
| | | private Integer orderId; |
| | | |
| | | @ApiModelProperty(value = "镜片右 核算成本价") |
| | | @TableField("rLens") |
| | | private BigDecimal rLens; |
| | | |
| | | @ApiModelProperty(value = "镜片右 核算成本价") |
| | | @TableField("lLens") |
| | | private BigDecimal lLens; |
| | | |
| | | @ApiModelProperty(value = "镜架核算成本价") |
| | | @TableField("frame") |
| | | private BigDecimal frame; |
| | | |
| | | @ApiModelProperty(value = "手续费") |
| | | @TableField("commission") |
| | | private Integer commission; |
| | | |
| | | @ApiModelProperty(value = "镜片右毛利") |
| | | @TableField("rLensProfit") |
| | | private BigDecimal rLensProfit; |
| | | |
| | | @ApiModelProperty(value = "镜片左毛利") |
| | | @TableField("lLensProfit") |
| | | private BigDecimal lLensProfit; |
| | | |
| | | @ApiModelProperty(value = "镜架毛利") |
| | | @TableField("frameProfit") |
| | | private BigDecimal frameProfit; |
| | | |
| | | @ApiModelProperty(value = "实收金额") |
| | | @TableField("payMoney") |
| | | private String payMoney; |
| | | |
| | | @ApiModelProperty(value = "本单毛利") |
| | | @TableField("profitMoney") |
| | | private BigDecimal profitMoney; |
| | | |
| | | @ApiModelProperty(value = "毛利率") |
| | | @TableField("profitRating") |
| | | private BigDecimal profitRating; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单售后表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order_aftersales") |
| | | @ApiModel(value="TOrderAftersales对象", description="订单售后表") |
| | | public class TOrderAftersales extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "店铺员工id") |
| | | @TableField("sysId") |
| | | private Integer sysId; |
| | | |
| | | @ApiModelProperty(value = "验光师id") |
| | | @TableField("optometristId") |
| | | private Integer optometristId; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableField("orderId") |
| | | private Integer orderId; |
| | | |
| | | @ApiModelProperty(value = "售后原因") |
| | | @TableField("reason") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "处理结果") |
| | | @TableField("handleResult") |
| | | private String handleResult; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 门店表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_store") |
| | | @ApiModel(value="TStore对象", description="门店表") |
| | | public class TStore extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "省") |
| | | @TableField("province") |
| | | private String province; |
| | | |
| | | @ApiModelProperty(value = "省code") |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | |
| | | @ApiModelProperty(value = "市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty(value = "市code") |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "区/县") |
| | | @TableField("area") |
| | | private Integer area; |
| | | |
| | | @ApiModelProperty(value = "区县code") |
| | | @TableField("areaCode") |
| | | private String areaCode; |
| | | |
| | | @ApiModelProperty(value = "地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | @TableField("lon") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | @TableField("lat") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty(value = "照片") |
| | | @TableField("img") |
| | | private String img; |
| | | @ApiModelProperty(value = "状态 1=启用 2=禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_supplier") |
| | | @ApiModel(value="TSupplier对象", description="供应商") |
| | | public class TSupplier extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "供应商名称") |
| | | @Length(max = 25, message = "供应商名称长度不能超过25") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 小票机 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_ticket") |
| | | @ApiModel(value="TTicket对象", description="小票机") |
| | | public class TTicket extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "小票机名称") |
| | | @TableField("name") |
| | | private Integer name; |
| | | |
| | | @ApiModelProperty(value = "类型 1验光单 2加工单") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "云端id") |
| | | @TableField("cloudId") |
| | | private Integer cloudId; |
| | | |
| | | @ApiModelProperty(value = "密钥") |
| | | @TableField("secret") |
| | | private String secret; |
| | | |
| | | @ApiModelProperty(value = "状态 1=启用 2=禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片出库入库表 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_warehousing") |
| | | @ApiModel(value="TWarehousing对象", description="镜架/镜片出库入库表") |
| | | public class TWarehousing extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "1=出库,2=入库,3=作废,4=退货") |
| | | @NotNull(message = "状态不能为空") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "1镜架2镜片") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "关联订单号") |
| | | @TableField("orderNum") |
| | | private String orderNum; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/9/21/02111:52 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "登录日志Query") |
| | | public class LoginLogQuery extends TimeRangePageDTO { |
| | | |
| | | @ApiModelProperty(value = "登录账号") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "账号名称") |
| | | private String shortName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/9/21/02111:52 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "操作日志Query") |
| | | public class OperLogQuery extends TimeRangePageDTO { |
| | | |
| | | @ApiModelProperty(value = "操作账号") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "账号名称") |
| | | private String shortName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "用户详情-查看优惠券") |
| | | public class TAppUserCouponQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer id; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "用户管理查询条件") |
| | | public class TAppUserQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "姓名") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "注册起始时间 例:2022-11-11") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "注册结束时间 例:2022-11-11") |
| | | private String endTime; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架/镜片品牌查询参数") |
| | | public class TBrandQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "1=镜架 2=镜片") |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "用户管理查询条件") |
| | | public class TCouponQuery extends BasePage { |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "发放方式 发放方式 1注册发放 2全局发放 3指定发放 4扫码发放") |
| | | private String type; |
| | | @ApiModelProperty(value = "发放状态1发放中 2暂停发放 只有发放方式为1和4的时候存储") |
| | | private String grantStatus; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架库存Query") |
| | | public class TFrameGoodsQuery extends TimeRangePageDTO { |
| | | |
| | | @ApiModelProperty(value = "品牌id") |
| | | private String brandId; |
| | | |
| | | @ApiModelProperty(value = "供应商") |
| | | private String supplierId; |
| | | |
| | | @ApiModelProperty(value = "色号") |
| | | private String color; |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "镜架型号") |
| | | private String model; |
| | | @ApiModelProperty(value = "材质id") |
| | | private String materialId; |
| | | @ApiModelProperty(value = "状态1启用 2禁用") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "是否低库存 1是2否") |
| | | private Integer isWarning; |
| | | @ApiModelProperty(value = "库存起始数量") |
| | | private Integer startCount; |
| | | @ApiModelProperty(value = "库存结束数量") |
| | | private Integer endCount; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "盘点Query") |
| | | public class TInventoryQuery extends TimeRangePageDTO { |
| | | @ApiModelProperty(value = "盘点品类 1镜架2镜片") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "盘点类型 1型号2品牌3材质4球/柱镜5折射率6系列 123属于镜架 456属于镜片") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "操作人") |
| | | private String createBy; |
| | | @ApiModelProperty(value = "盘点日期起始时间2022-11-11") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "盘点日期结束时间2023-11-11") |
| | | private String endTime; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片库存Query") |
| | | public class TLensGoodsQuery extends TimeRangePageDTO { |
| | | @ApiModelProperty(value = "品牌id") |
| | | private String brandId; |
| | | @ApiModelProperty(value = "系列id") |
| | | private String seriesId; |
| | | @ApiModelProperty(value = "1球2非球3双非") |
| | | private Integer lensType; |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "折射率") |
| | | private String refractiveIndex; |
| | | @ApiModelProperty(value = "库存类型 1库存 2非库存") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "状态1启用 2禁用") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "是否低库存 1是2否") |
| | | private Integer isWarning; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光师查询条件") |
| | | public class TLensSeriesQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "品牌id") |
| | | private Integer brandId; |
| | | |
| | | @ApiModelProperty(value = "库存类型 1库存 2非库存") |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "排号管理查询参数") |
| | | public class TLineUpQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "状态1排队中2验光中3已完成4已过号5已取消") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "材质Query") |
| | | public class TMaterialQuery extends BasePage { |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架型号查询Query") |
| | | public class TModelQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "品牌id") |
| | | private Integer brandId; |
| | | |
| | | @ApiModelProperty(value = "供应商id") |
| | | private Integer supplierId; |
| | | |
| | | @ApiModelProperty(value = "型号") |
| | | private String name; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光师查询条件") |
| | | public class TOptometristQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "验光师名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "状态 1启用 2禁用") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光单查询参数") |
| | | public class TOptometryQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | @ApiModelProperty(value = "姓名") |
| | | private String realName; |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "出单日期 2020-11-11 - 2022-11-11") |
| | | private String createTime; |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "验光师id") |
| | | private Integer optometristId; |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer userId; |
| | | @ApiModelProperty(value = "开始时间 前端忽略") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "结束时间 前端忽略") |
| | | private String endTime; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "订单售后查询参数") |
| | | public class TOrderAftersalesQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "门店查询参数") |
| | | public class TStoreQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "状态 1=启用 2=禁用") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "供应商查询参数") |
| | | public class TSupplierQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "供应商名称") |
| | | private String name; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片明细记录查询/出入库单Query") |
| | | public class TWarehousingDetailLensQuery extends TimeRangePageDTO { |
| | | @ApiModelProperty(value = "品牌") |
| | | private String brand; |
| | | @ApiModelProperty(value = "系列") |
| | | private String series; |
| | | @ApiModelProperty(value = "球/非 1球 2非球 3双非") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "折射率") |
| | | private String refractiveIndex; |
| | | @ApiModelProperty(value = "球镜") |
| | | private String ballMirror; |
| | | @ApiModelProperty(value = "柱镜") |
| | | private String columnMirror; |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "类型 1=出库,2=入库,3=作废,4=退货") |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.jilongda.common.dto.TimeRangePageDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "明细记录查询出入库单Query") |
| | | public class TWarehousingDetailQuery extends TimeRangePageDTO { |
| | | |
| | | @ApiModelProperty(value = "品牌") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "供应商") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value = "色号") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "镜架型号") |
| | | private String model; |
| | | |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "类型 1=出库,2=入库,3=作废,4=退货") |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "小票机查询条件") |
| | | public class TicketQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "类型 1验光单 2加工单") |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.security; |
| | | |
| | | import com.jilongda.optometrist.security.SecurityUserDetails; |
| | | import com.jilongda.optometrist.security.SysUserDetailsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.security.authentication.dao.DaoAuthenticationProvider; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.AuthenticationException; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | import org.springframework.security.core.userdetails.UsernameNotFoundException; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 身份验证提供者--->登录验证逻辑 |
| | | * <p> |
| | | * 不管是 implements AuthenticationProvider 还是 extends DaoAuthenticationProvider 区别不大 |
| | | * <p> |
| | | * DaoAuthenticationProvider 实现了 AuthenticationProvider 类 |
| | | * <p> |
| | | * 验证逻辑都是在 public Authentication authenticate(Authentication authentication) throws AuthenticationException {} 方法中 |
| | | * |
| | | * @author xiaochen |
| | | * @date 2021-01-02 20:17 |
| | | */ |
| | | @Slf4j |
| | | public class AuthenticationProvider extends DaoAuthenticationProvider { |
| | | |
| | | private SysUserDetailsService loadUserDetailsService; |
| | | private PasswordEncoder passwordEncoder; |
| | | |
| | | public AuthenticationProvider(SysUserDetailsService loadUserDetailsService, PasswordEncoder passwordEncoder) { |
| | | this.loadUserDetailsService = loadUserDetailsService; |
| | | this.passwordEncoder = passwordEncoder; |
| | | setUserDetailsService(loadUserDetailsService); |
| | | setPasswordEncoder(passwordEncoder); |
| | | } |
| | | |
| | | @Override |
| | | public Authentication authenticate(Authentication authentication) { |
| | | // 可以在此处覆写整个登录认证逻辑 |
| | | // [1] 获取 username 和 password |
| | | String userName = (String) authentication.getPrincipal(); |
| | | String password = (String) authentication.getCredentials(); |
| | | log.info("用户数据查询======================================"); |
| | | // [2] 使用用户名从数据库读取用户信息 |
| | | SecurityUserDetails userDetails = this.loadUserDetailsService.loadUserByUsername(userName); |
| | | log.info("用户数据查询======================================:{}", userDetails); |
| | | // 判断是否被封禁 |
| | | userDetails.setEnabled(userDetails.getState()); |
| | | // [3] 检查用户信息 |
| | | if (Objects.isNull(userDetails)) { |
| | | throw new UsernameNotFoundException("用户账户不存在"); |
| | | } else if (userDetails.isEnabled() || userDetails.getState()) { |
| | | throw new DisabledException(userName + " 用户已被禁用或删除,请联系管理员"); |
| | | } else if (!userDetails.isAccountNonExpired()) { |
| | | throw new AccountExpiredException(userName + " 账号已过期"); |
| | | } else if (!userDetails.isAccountNonLocked()) { |
| | | throw new LockedException(userName + " 账号已被锁定"); |
| | | } else if (!userDetails.isCredentialsNonExpired()) { |
| | | throw new LockedException(userName + " 凭证已过期"); |
| | | } |
| | | // [4] 数据库用户的密码,一般都是加密过的 |
| | | String encryptedPassword = userDetails.getPassword(); |
| | | |
| | | // 根据加密算法加密用户输入的密码,然后和数据库中保存的密码进行比较 |
| | | if (!this.passwordEncoder.matches(password, encryptedPassword)) { |
| | | throw new BadCredentialsException("密码错误"); |
| | | } |
| | | // [5] 成功登陆,把用户信息提交给 Spring Security |
| | | // 把 userDetails 作为 principal 的好处是可以放自定义的 UserDetails,这样可以存储更多有用的信息,而不只是 username, |
| | | // 默认只有 username,这里的密码使用数据库中保存的密码,而不是用户输入的明文密码,否则就暴露了密码的明文 |
| | | // 不暴露密码 |
| | | userDetails.setPassword(null); |
| | | UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken(userDetails.getUsername(), null, null); |
| | | // 设置详情 |
| | | //String userInfo = JsonUtils.toJsonString(userDetails); |
| | | usernamePasswordAuthenticationToken.setDetails(userDetails); |
| | | return usernamePasswordAuthenticationToken; |
| | | } |
| | | |
| | | @Override |
| | | protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) |
| | | throws AuthenticationException { |
| | | // 可以在此处覆写密码验证逻辑 |
| | | super.additionalAuthenticationChecks(userDetails, authentication); |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.security; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.security.JwtTokenUtils; |
| | | import com.jilongda.optometrist.authority.mapper.SecResourcesMapper; |
| | | import com.jilongda.optometrist.authority.model.SecResources; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.web.util.matcher.AntPathRequestMatcher; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName RbacAuthorityService |
| | | * @Description |
| | | * @date 2020-09-23 11:32 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class RbacAuthorityService { |
| | | private final SysUserDetailsService loadUserDetailsService; |
| | | private final SecResourcesMapper secResourcesMapper; |
| | | |
| | | @Autowired |
| | | public RbacAuthorityService(SysUserDetailsService loadUserDetailsService, SecResourcesMapper secResourcesMapper) { |
| | | this.loadUserDetailsService = loadUserDetailsService; |
| | | this.secResourcesMapper = secResourcesMapper; |
| | | } |
| | | |
| | | /** |
| | | * 校验权限 |
| | | * |
| | | * @param request |
| | | * @param authentication |
| | | * @return |
| | | */ |
| | | public boolean hasPermission(HttpServletRequest request, Authentication authentication) { |
| | | String userName = JwtTokenUtils.getUsername(authentication); |
| | | boolean hasPermission = false; |
| | | if (StringUtils.isNotBlank(userName)) { |
| | | SecurityUserDetails sysUserDetails = loadUserDetailsService.loadUserByUsername(userName); |
| | | //获取资源,前后端分离,所以过滤页面权限,只保留按钮权限 |
| | | List<SecResources> resources = sysUserDetails.getResources().stream() |
| | | // 过滤页面权限 1页面 2按钮 |
| | | .filter(resource -> resource.getCate().intValue() != 1) |
| | | // 不允许通过的请求地址 |
| | | .filter(resource -> !resource.getPermit()) |
| | | // 过滤 URL 为空 |
| | | .filter(resource -> StringUtils.isNotBlank(resource.getPath())) |
| | | // 过滤 METHOD 为空,METHOD不可能为空 |
| | | .collect(Collectors.toList()); |
| | | List<SecResources> sysResources; |
| | | List<AntPathRequestMatcher> antPathRequestMatchers = new ArrayList<>(); |
| | | Long uid = sysUserDetails.getId(); |
| | | // 超管 |
| | | if (uid.equals(1)) { |
| | | sysResources = secResourcesMapper.selectList(Wrappers.lambdaQuery(SecResources.class)); |
| | | } else { |
| | | // 其他管理员 |
| | | sysResources = secResourcesMapper.selectResourceByUid(uid); |
| | | } |
| | | // 过滤页面权限 1页面 2按钮 |
| | | List<SecResources> resourcesList = sysResources.stream().filter(resource -> resource.getCate().intValue() != 1) |
| | | // 过滤 URL 为空 |
| | | .filter(resource -> StringUtils.isNotBlank(resource.getPath())) |
| | | // 过滤 METHOD 为空,METHOD不可能为空 |
| | | .collect(Collectors.toList()); |
| | | resourcesList.forEach(item -> { |
| | | antPathRequestMatchers.add(new AntPathRequestMatcher(item.getPath())); |
| | | }); |
| | | AntPathRequestMatcher antPathMatcher; |
| | | for (SecResources btnPerm : resources) { |
| | | antPathMatcher = new AntPathRequestMatcher(btnPerm.getPath()); |
| | | if (antPathMatcher.matches(request)) { |
| | | hasPermission = true; |
| | | break; |
| | | } |
| | | } |
| | | return hasPermission; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.security; |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.swagger.GlobalResultEnum; |
| | | import com.jilongda.common.utils.ResponseUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.security.access.AccessDeniedException; |
| | | import org.springframework.security.web.access.AccessDeniedHandler; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 认证过的用户访问没有权限资源的处理 |
| | | * |
| | | * @author xiaochen |
| | | * @date |
| | | */ |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class SecurityAccessDeniedHandler implements AccessDeniedHandler { |
| | | @Override |
| | | public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) { |
| | | log.info(request.getRequestURL() + "没有权限"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | response.setContentType(MediaType.APPLICATION_JSON_VALUE); |
| | | ResponseUtils.renderJson(response, ApiResult.status(GlobalResultEnum.FORBIDDEN)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.security; |
| | | |
| | | import lombok.Data; |
| | | import lombok.Setter; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName DinePeopleDetails |
| | | * @Description |
| | | * @date 2020-08-20 20:36 |
| | | */ |
| | | @Data |
| | | public class SecurityUserDetails extends SecurityUserRoleResouce implements UserDetails, Serializable { |
| | | private static final long serialVersionUID = 8154896751339152731L; |
| | | @Setter |
| | | private Boolean accountNonExpired = true; |
| | | @Setter |
| | | private Boolean accountNonLocked = true; |
| | | @Setter |
| | | private Boolean credentialsNonExpired = true; |
| | | @Setter |
| | | private Boolean enabled = true; |
| | | |
| | | |
| | | /** |
| | | * 不在此处做权限校验 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Collection<? extends GrantedAuthority> getAuthorities() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String getPassword() { |
| | | return super.getPassword(); |
| | | } |
| | | |
| | | @Override |
| | | public String getUsername() { |
| | | return super.getAccount(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isAccountNonExpired() { |
| | | return this.accountNonExpired; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isAccountNonLocked() { |
| | | return this.accountNonLocked; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isCredentialsNonExpired() { |
| | | return this.credentialsNonExpired; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isEnabled() { |
| | | return this.enabled; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.security; |
| | | |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName SysUserRoleResouce |
| | | * @Description |
| | | * @date 2021-05-20 15:10 |
| | | */ |
| | | @Data |
| | | public class SecurityUserRoleResouce extends SecUser implements Serializable { |
| | | /** |
| | | * 角色 |
| | | */ |
| | | List<SecRole> roles; |
| | | |
| | | /** |
| | | * 资源 |
| | | */ |
| | | List<SecResourceVO> resources; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.security; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.optometrist.authority.mapper.SecResourcesMapper; |
| | | import com.jilongda.optometrist.authority.mapper.SecRoleMapper; |
| | | import com.jilongda.optometrist.authority.mapper.SecUserMapper; |
| | | import com.jilongda.optometrist.authority.model.SecRole; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.service.SecUserService; |
| | | import com.jilongda.optometrist.authority.vo.SecResourceVO; |
| | | import com.jilongda.common.basic.Constant; |
| | | import com.jilongda.common.utils.SpringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.userdetails.UserDetailsService; |
| | | import org.springframework.security.core.userdetails.UsernameNotFoundException; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * 用户登录认证信息查询 |
| | | * |
| | | * @author xiaochen |
| | | * @date Jun 29, 2019 |
| | | */ |
| | | @Component("loadUserDetailsService") |
| | | public class SysUserDetailsService implements UserDetailsService { |
| | | @Autowired |
| | | private SecUserMapper secUserMapper; |
| | | @Autowired |
| | | private SecRoleMapper secRoleMapper; |
| | | @Autowired |
| | | private SecResourcesMapper secResourcesMapper; |
| | | @Autowired |
| | | private SecUserService secUserService; |
| | | |
| | | |
| | | @Override |
| | | public SecurityUserDetails loadUserByUsername(String username) throws UsernameNotFoundException { |
| | | SecUser user = secUserMapper.selectOne(Wrappers.lambdaQuery(SecUser.class).eq(SecUser::getAccount, username).last(" LIMIT 1")); |
| | | |
| | | if (Objects.isNull(user)) { |
| | | throw new UsernameNotFoundException("该用户不存在"); |
| | | } |
| | | |
| | | SecurityUserDetails vo = SpringUtils.beanCopy(user, SecurityUserDetails.class); |
| | | if (user.getAccount().equals(Constant.ADMIN)) { |
| | | getAdminPermission(vo); |
| | | } else { |
| | | List<SecRole> roles = secRoleMapper.selectRolesByUid(user.getId()); |
| | | List<Long> roleIds = roles.stream().map(SecRole::getId).collect(Collectors.toList()); |
| | | List<SecResourceVO> resources; |
| | | if (CollectionUtils.isEmpty(roleIds)) { |
| | | resources = new ArrayList<>(); |
| | | } else { |
| | | resources = secUserService.getResourceTag(user.getId()); |
| | | } |
| | | vo.setRoles(roles); |
| | | vo.setResources(resources); |
| | | } |
| | | // 更新登录时间 |
| | | SecurityUserDetails securityUserDetails = new SecurityUserDetails(); |
| | | securityUserDetails.setId(user.getId()); |
| | | securityUserDetails.setLastLoginTime(LocalDateTime.now()); |
| | | secUserMapper.updateById(securityUserDetails); |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 为管理员赋所有权限 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | private SecurityUserDetails getAdminPermission(SecurityUserDetails details) { |
| | | List<SecRole> roles = secRoleMapper.selectList(Wrappers.emptyWrapper()); |
| | | List<SecResourceVO> resources = secUserService.selectUserResourcesTag(details.getId()); |
| | | details.setRoles(roles); |
| | | details.setResources(resources); |
| | | return details; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.Region; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市区三级联动 服务类 |
| | | * </p> |
| | | * |
| | | * @author 吕雪 |
| | | * @since 2020-06-02 |
| | | */ |
| | | public interface ITRegionService extends IService<Region> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.model.LoginLog; |
| | | import com.jilongda.optometrist.query.LoginLogQuery; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * <p> |
| | | * 登录日志 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-09-21 |
| | | */ |
| | | public interface LoginLogService extends IService<LoginLog> { |
| | | |
| | | /** |
| | | * 登录日志分页列表查询 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<LoginLog> pageList(LoginLogQuery query); |
| | | |
| | | Long countToday(LocalDate today); |
| | | |
| | | Long countYesterday(LocalDate yesterday); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.model.OperLog; |
| | | import com.jilongda.optometrist.query.OperLogQuery; |
| | | |
| | | /** |
| | | * <p> |
| | | * 操作日志 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-09-21 |
| | | */ |
| | | public interface OperLogService extends IService<OperLog> { |
| | | |
| | | /** |
| | | * 操作日志分页列表查询 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<OperLog> pageList(OperLogQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.SecFeeItems; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置-收费项设置 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface SecFeeItemsService extends IService<SecFeeItems> { |
| | | |
| | | /** |
| | | * |
| | | * @param id |
| | | * @param status |
| | | * @return |
| | | */ |
| | | Boolean upAndDown(Long id, Integer status); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.SecSetting; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface SecSettingService extends IService<SecSetting> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.query.TAppUserQuery; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TAppUserService extends IService<TAppUser> { |
| | | |
| | | PageInfo<TAppUserVO> pageList(TAppUserQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TBrand; |
| | | import com.jilongda.optometrist.query.TBrandQuery; |
| | | import com.jilongda.optometrist.vo.TBrandVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片品牌表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TBrandService extends IService<TBrand> { |
| | | |
| | | /** |
| | | * 获取镜架/镜片品牌分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TBrandVO> pageList(TBrandQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TCouponReceive; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.query.TAppUserCouponQuery; |
| | | import com.jilongda.optometrist.vo.TAppUserCouponVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TCouponReceiveService extends IService<TCouponReceive> { |
| | | |
| | | PageInfo<TAppUserCouponVO> pageList(TAppUserCouponQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TCoupon; |
| | | import com.jilongda.optometrist.query.TCouponQuery; |
| | | import com.jilongda.optometrist.vo.TCouponVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TCouponService extends IService<TCoupon> { |
| | | |
| | | PageInfo<TCouponVO> pageList(TCouponQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TFrameGoods; |
| | | import com.jilongda.optometrist.query.TFrameGoodsQuery; |
| | | import com.jilongda.optometrist.vo.TFrameGoodsVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TFrameGoodsService extends IService<TFrameGoods> { |
| | | |
| | | PageInfo<TFrameGoodsVO> lensReceiptList(TFrameGoodsQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架出库入库详细表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TFrameWarehousingDetailService extends IService<TFrameWarehousingDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.optometrist.model.TInventoryFrameDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 材质表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TInventoryFrameDetailService extends IService<TInventoryFrameDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.optometrist.model.TInventoryLensDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架盘点详细表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TInventoryLensDetailService extends IService<TInventoryLensDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TInventory; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.query.TInventoryQuery; |
| | | import com.jilongda.optometrist.vo.TInventoryVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 盘点表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TInventoryService extends IService<TInventory> { |
| | | |
| | | PageInfo<TInventoryVO> pageList(TInventoryQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TLensGoods; |
| | | import com.jilongda.optometrist.query.TLensGoodsQuery; |
| | | import com.jilongda.optometrist.vo.TLensGoodsVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLensGoodsService extends IService<TLensGoods> { |
| | | |
| | | PageInfo<TLensGoodsVO> lensReceiptList(TLensGoodsQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TLensSeries; |
| | | import com.jilongda.optometrist.query.TLensSeriesQuery; |
| | | import com.jilongda.optometrist.vo.TLensSeriesVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片系列表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLensSeriesService extends IService<TLensSeries> { |
| | | |
| | | PageInfo<TLensSeriesVO> pageList(TLensSeriesQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片出库入库明细表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLensWarehousingDetailService extends IService<TLensWarehousingDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TLineUp; |
| | | import com.jilongda.optometrist.query.TLineUpQuery; |
| | | |
| | | /** |
| | | * <p> |
| | | * 排号管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TLineUpService extends IService<TLineUp> { |
| | | |
| | | PageInfo<TLineUp> pageList(TLineUpQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TMaterial; |
| | | import com.jilongda.optometrist.query.TMaterialQuery; |
| | | import com.jilongda.optometrist.vo.TMaterialVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 材质表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TMaterialService extends IService<TMaterial> { |
| | | |
| | | /** |
| | | * 判断材质是否存在 |
| | | * @param id |
| | | * @param name |
| | | * @return |
| | | */ |
| | | Boolean isExit(Integer id, String name); |
| | | |
| | | /** |
| | | * 材质启用禁用 |
| | | * @param id |
| | | * @param status |
| | | * @return |
| | | */ |
| | | Boolean upAndDown(Long id, Integer status); |
| | | |
| | | /** |
| | | * 获取材质分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TMaterialVO> pageList(TMaterialQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import com.jilongda.optometrist.query.TModelQuery; |
| | | import com.jilongda.optometrist.vo.TModelVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架型号表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TModelService extends IService<TModel> { |
| | | |
| | | /** |
| | | * 镜架型号上下架 |
| | | * @param name |
| | | * @param status |
| | | * @return |
| | | */ |
| | | Boolean upAndDown(String name, Integer status); |
| | | |
| | | /** |
| | | * 镜架型号颜色上下架 |
| | | * @param name |
| | | * @param color |
| | | * @param status |
| | | * @return |
| | | */ |
| | | Boolean upAndDownColor(String name, String color, Integer status); |
| | | |
| | | /** |
| | | * 获取镜架型号分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TModelVO> pageList(TModelQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.query.TOptometryQuery; |
| | | import com.jilongda.optometrist.vo.TOptometryVO; |
| | | import com.jilongda.optometrist.query.TOptometristQuery; |
| | | import com.jilongda.optometrist.vo.TOptometristVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光师表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOptometristService extends IService<TOptometrist> { |
| | | |
| | | PageInfo<TOptometryVO> pageList(TOptometryQuery query); |
| | | |
| | | PageInfo<TOptometristVO> pageList1(TOptometristQuery query); |
| | | |
| | | Boolean upAndDown(Integer id, Integer status); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.TOptometryDetail; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单详情 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOptometryDetailService extends IService<TOptometryDetail> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.TOptometry; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOptometryService extends IService<TOptometry> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.TOrderAccounting; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单核算表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOrderAccountingService extends IService<TOrderAccounting> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TOrderAftersales; |
| | | import com.jilongda.optometrist.query.TOrderAftersalesQuery; |
| | | import com.jilongda.optometrist.vo.TOrderAftersalesVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单售后表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOrderAftersalesService extends IService<TOrderAftersales> { |
| | | |
| | | /** |
| | | * 订单售后列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TOrderAftersalesVO> pageList(TOrderAftersalesQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.model.TOrder; |
| | | |
| | | /** |
| | | * <p> |
| | | * 销售订单表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TOrderService extends IService<TOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.query.TStoreQuery; |
| | | import com.jilongda.optometrist.vo.TStoreVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 门店表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TStoreService extends IService<TStore> { |
| | | |
| | | /** |
| | | * 获取门店分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TStoreVO> pageList(TStoreQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import com.jilongda.optometrist.query.TSupplierQuery; |
| | | import com.jilongda.optometrist.vo.TSupplierVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TSupplierService extends IService<TSupplier> { |
| | | |
| | | /** |
| | | * 获取供应商分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TSupplierVO> pageList(TSupplierQuery query); |
| | | |
| | | /** |
| | | * 判断供应商是否存在 |
| | | * @param id |
| | | * @param name |
| | | * @return |
| | | */ |
| | | Boolean isExit(Integer id, String name); |
| | | |
| | | /** |
| | | * 启用禁用供应商 |
| | | * @param id |
| | | * @param status |
| | | * @return |
| | | */ |
| | | Boolean upAndDown(Long id, Integer status); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TTicket; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.query.TicketQuery; |
| | | import com.jilongda.optometrist.vo.TTicketVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 小票机 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TTicketService extends IService<TTicket> { |
| | | |
| | | /** |
| | | * 小票机上下架 |
| | | * @param id |
| | | * @param status |
| | | * @return |
| | | */ |
| | | Boolean upAndDown(Integer id, Integer status); |
| | | |
| | | /** |
| | | * 小票机列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TTicketVO> pageList(TicketQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.common.model.TUser; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-04-15 |
| | | */ |
| | | public interface TUserService extends IService<TUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailLensQuery; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailQuery; |
| | | import com.jilongda.optometrist.vo.TFrameWarehousingDetailVO; |
| | | import com.jilongda.optometrist.vo.TLensWarehousingDetailVO; |
| | | import com.jilongda.optometrist.vo.TWarehousingLensVO; |
| | | import com.jilongda.optometrist.vo.TWarehousingVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片出库入库表 服务类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | public interface TWarehousingService extends IService<TWarehousing> { |
| | | |
| | | /** |
| | | * 库存明细记录列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TFrameWarehousingDetailVO> detailList(TWarehousingDetailQuery query); |
| | | |
| | | /** |
| | | * 出入库单列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TWarehousingVO> inventoryReceiptList(TWarehousingDetailQuery query); |
| | | |
| | | PageInfo<TWarehousingLensVO> inventoryReceiptLensList(TWarehousingDetailLensQuery query); |
| | | |
| | | PageInfo<TLensWarehousingDetailVO> detailListLens(TWarehousingDetailLensQuery query); |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.model.LoginLog; |
| | | import com.jilongda.optometrist.mapper.LoginLogMapper; |
| | | import com.jilongda.optometrist.query.LoginLogQuery; |
| | | import com.jilongda.optometrist.service.LoginLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 登录日志 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-09-21 |
| | | */ |
| | | @Service |
| | | public class LoginLogServiceImpl extends ServiceImpl<LoginLogMapper, LoginLog> implements LoginLogService { |
| | | |
| | | @Autowired |
| | | private LoginLogMapper loginLogMapper; |
| | | |
| | | @Override |
| | | public PageInfo<LoginLog> pageList(LoginLogQuery query) { |
| | | PageInfo<LoginLog> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<LoginLog> loginLogs = loginLogMapper.pageList(query, pageInfo); |
| | | pageInfo.setRecords(loginLogs); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public Long countToday(LocalDate today) { |
| | | return loginLogMapper.countToday(today); |
| | | } |
| | | |
| | | @Override |
| | | public Long countYesterday(LocalDate yesterday) { |
| | | return loginLogMapper.countYesterday(yesterday); |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.model.OperLog; |
| | | import com.jilongda.optometrist.mapper.OperLogMapper; |
| | | import com.jilongda.optometrist.query.OperLogQuery; |
| | | import com.jilongda.optometrist.service.OperLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 操作日志 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2022-09-21 |
| | | */ |
| | | @Service |
| | | public class OperLogServiceImpl extends ServiceImpl<OperLogMapper, OperLog> implements OperLogService { |
| | | |
| | | @Autowired |
| | | private OperLogMapper operLogMapper; |
| | | |
| | | @Override |
| | | public PageInfo<OperLog> pageList(OperLogQuery query) { |
| | | PageInfo<OperLog> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<OperLog> operLogs = operLogMapper.pageList(query, pageInfo); |
| | | pageInfo.setRecords(operLogs); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.SecFeeItemsMapper; |
| | | import com.jilongda.optometrist.model.SecFeeItems; |
| | | import com.jilongda.optometrist.service.SecFeeItemsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置-收费项设置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class SecFeeItemsServiceImpl extends ServiceImpl<SecFeeItemsMapper, SecFeeItems> implements SecFeeItemsService { |
| | | |
| | | @Override |
| | | public Boolean upAndDown(Long id, Integer status) { |
| | | SecFeeItems secFeeItems = this.baseMapper.selectById(id); |
| | | secFeeItems.setStatus(status); |
| | | return this.updateById(secFeeItems); |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.SecSettingMapper; |
| | | import com.jilongda.optometrist.model.SecSetting; |
| | | import com.jilongda.optometrist.service.SecSettingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统设置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class SecSettingServiceImpl extends ServiceImpl<SecSettingMapper, SecSetting> implements SecSettingService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TAppUserMapper; |
| | | import com.jilongda.optometrist.mapper.TOrderMapper; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TOrder; |
| | | import com.jilongda.optometrist.query.TAppUserQuery; |
| | | import com.jilongda.optometrist.service.TAppUserService; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TAppUserServiceImpl extends ServiceImpl<TAppUserMapper, TAppUser> implements TAppUserService { |
| | | |
| | | @Autowired |
| | | private TOrderMapper orderMapper; |
| | | @Override |
| | | public PageInfo<TAppUserVO> pageList(TAppUserQuery query) { |
| | | PageInfo<TAppUserVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TAppUserVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (TAppUserVO tAppUserVO : list) { |
| | | Long l = orderMapper.selectCount(new LambdaQueryWrapper<TOrder>() |
| | | .eq(TOrder::getUserId, tAppUserVO.getId())); |
| | | tAppUserVO.setSalesCount(l.intValue()); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.TBrand; |
| | | import com.jilongda.optometrist.mapper.TBrandMapper; |
| | | import com.jilongda.optometrist.query.TBrandQuery; |
| | | import com.jilongda.optometrist.service.TBrandService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.vo.TBrandVO; |
| | | import com.jilongda.optometrist.vo.TStoreVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片品牌表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TBrandServiceImpl extends ServiceImpl<TBrandMapper, TBrand> implements TBrandService { |
| | | |
| | | @Override |
| | | public PageInfo<TBrandVO> pageList(TBrandQuery query) { |
| | | PageInfo<TBrandVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TBrandVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TCouponMapper; |
| | | import com.jilongda.optometrist.mapper.TStoreMapper; |
| | | import com.jilongda.optometrist.model.TCouponReceive; |
| | | import com.jilongda.optometrist.mapper.TCouponReceiveMapper; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.query.TAppUserCouponQuery; |
| | | import com.jilongda.optometrist.service.TCouponReceiveService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.service.TCouponService; |
| | | import com.jilongda.optometrist.service.TStoreService; |
| | | import com.jilongda.optometrist.vo.TAppUserCouponVO; |
| | | import com.jilongda.optometrist.vo.TStoreVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TCouponReceiveServiceImpl extends ServiceImpl<TCouponReceiveMapper, TCouponReceive> implements TCouponReceiveService { |
| | | |
| | | @Resource |
| | | private TCouponMapper couponMapper; |
| | | @Resource |
| | | private TStoreMapper storeMapper; |
| | | @Resource |
| | | private TCouponReceiveMapper couponReceiveMapper; |
| | | @Override |
| | | public PageInfo<TAppUserCouponVO> pageList(TAppUserCouponQuery query) { |
| | | PageInfo<TAppUserCouponVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TAppUserCouponVO> list = couponReceiveMapper.pageList(query,pageInfo); |
| | | for (TAppUserCouponVO tAppUserCouponVO : list) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | if (StringUtils.hasLength(tAppUserCouponVO.getStoreId())) { |
| | | List<TStore> tStores = storeMapper.selectList(new LambdaQueryWrapper<TStore>() |
| | | .in(TStore::getId, Arrays.asList(tAppUserCouponVO.getStoreId().split(",")))); |
| | | for (TStore tStoreVO : tStores) { |
| | | stringBuilder.append(tStoreVO.getName()).append(","); |
| | | } |
| | | tAppUserCouponVO.setStoreName(stringBuilder.substring(0, stringBuilder.length() - 1)); |
| | | } else { |
| | | tAppUserCouponVO.setStoreName("不限"); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TCouponReceiveMapper; |
| | | import com.jilongda.optometrist.mapper.TStoreMapper; |
| | | import com.jilongda.optometrist.model.TCoupon; |
| | | import com.jilongda.optometrist.mapper.TCouponMapper; |
| | | import com.jilongda.optometrist.model.TCouponReceive; |
| | | import com.jilongda.optometrist.model.TOrder; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.query.TCouponQuery; |
| | | import com.jilongda.optometrist.service.TCouponService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | import com.jilongda.optometrist.vo.TCouponVO; |
| | | import org.apache.ibatis.annotations.ResultType; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券领取记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TCouponServiceImpl extends ServiceImpl<TCouponMapper, TCoupon> implements TCouponService { |
| | | |
| | | @Resource |
| | | private TStoreMapper storeMapper; |
| | | @Resource |
| | | private TCouponReceiveMapper couponReceiveMapper; |
| | | @Override |
| | | public PageInfo<TCouponVO> pageList(TCouponQuery query) { |
| | | PageInfo<TCouponVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCouponVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TCouponVO tAppUserCouponVO : list) { |
| | | if (StringUtils.hasLength(tAppUserCouponVO.getStoreId())) { |
| | | List<TStore> tStores = storeMapper.selectList(new LambdaQueryWrapper<TStore>() |
| | | .in(TStore::getId, Arrays.asList(tAppUserCouponVO.getStoreId().split(",")))); |
| | | for (TStore tStoreVO : tStores) { |
| | | stringBuilder.append(tStoreVO.getName()).append(","); |
| | | } |
| | | tAppUserCouponVO.setStoreName(stringBuilder.substring(0, stringBuilder.length() - 1)); |
| | | } else { |
| | | tAppUserCouponVO.setStoreName("不限"); |
| | | } |
| | | // 查询发放数量和使用数量 |
| | | int size = couponReceiveMapper.selectList(new LambdaQueryWrapper<TCouponReceive>() |
| | | .eq(TCouponReceive::getCouponId, tAppUserCouponVO.getId())).size(); |
| | | tAppUserCouponVO.setGrantCout(size); |
| | | int size1 = couponReceiveMapper.selectList(new LambdaQueryWrapper<TCouponReceive>() |
| | | .eq(TCouponReceive::getCouponId, tAppUserCouponVO.getId()) |
| | | .eq(TCouponReceive::getStatus, 2)).size(); |
| | | tAppUserCouponVO.setUseCount(size1); |
| | | } |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.SecSettingMapper; |
| | | import com.jilongda.optometrist.mapper.TAppUserMapper; |
| | | import com.jilongda.optometrist.mapper.TFrameGoodsMapper; |
| | | import com.jilongda.optometrist.mapper.TOrderMapper; |
| | | import com.jilongda.optometrist.model.SecSetting; |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TFrameGoods; |
| | | import com.jilongda.optometrist.model.TOrder; |
| | | import com.jilongda.optometrist.query.TAppUserQuery; |
| | | import com.jilongda.optometrist.query.TFrameGoodsQuery; |
| | | import com.jilongda.optometrist.service.TAppUserService; |
| | | import com.jilongda.optometrist.service.TFrameGoodsService; |
| | | import com.jilongda.optometrist.vo.TAppUserVO; |
| | | import com.jilongda.optometrist.vo.TFrameGoodsVO; |
| | | import com.jilongda.optometrist.vo.TOptometryVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TFrameGoodsServiceImpl extends ServiceImpl<TFrameGoodsMapper, TFrameGoods> implements TFrameGoodsService { |
| | | |
| | | |
| | | @Resource |
| | | private SecSettingMapper secSettingMapper; |
| | | @Override |
| | | public PageInfo<TFrameGoodsVO> lensReceiptList(TFrameGoodsQuery query) { |
| | | PageInfo<TFrameGoodsVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TFrameGoodsVO> list = this.baseMapper.lensReceiptList(query,pageInfo); |
| | | SecSetting secSetting = secSettingMapper.selectOne(null); |
| | | for (TFrameGoodsVO tFrameGoodsVO : list) { |
| | | if (tFrameGoodsVO.getTotal()<secSetting.getFrameThreshold()){ |
| | | tFrameGoodsVO.setIsWarning(1); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import com.jilongda.optometrist.mapper.TFrameWarehousingDetailMapper; |
| | | import com.jilongda.optometrist.service.TFrameWarehousingDetailService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架出库入库详细表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TFrameWarehousingDetailServiceImpl extends ServiceImpl<TFrameWarehousingDetailMapper, TFrameWarehousingDetail> implements TFrameWarehousingDetailService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.TInventoryFrameDetailMapper; |
| | | import com.jilongda.optometrist.model.TInventoryFrameDetail; |
| | | import com.jilongda.optometrist.service.TInventoryFrameDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 材质表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TInventoryFrameDetailServiceImpl extends ServiceImpl<TInventoryFrameDetailMapper, TInventoryFrameDetail> implements TInventoryFrameDetailService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.TInventoryLensDetailMapper; |
| | | import com.jilongda.optometrist.model.TInventoryLensDetail; |
| | | import com.jilongda.optometrist.service.TInventoryLensDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架盘点详细表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TInventoryLensDetailServiceImpl extends ServiceImpl<TInventoryLensDetailMapper, TInventoryLensDetail> implements TInventoryLensDetailService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.SecSetting; |
| | | import com.jilongda.optometrist.model.TInventory; |
| | | import com.jilongda.optometrist.mapper.TInventoryMapper; |
| | | import com.jilongda.optometrist.query.TInventoryQuery; |
| | | import com.jilongda.optometrist.service.TInventoryService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.vo.TInventoryVO; |
| | | import com.jilongda.optometrist.vo.TLensGoodsVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 盘点表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TInventoryServiceImpl extends ServiceImpl<TInventoryMapper, TInventory> implements TInventoryService { |
| | | |
| | | @Override |
| | | public PageInfo<TInventoryVO> pageList(TInventoryQuery query) { |
| | | PageInfo<TInventoryVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TInventoryVO> list = this.baseMapper.pageList(query, pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.SecSettingMapper; |
| | | import com.jilongda.optometrist.mapper.TLensGoodsMapper; |
| | | import com.jilongda.optometrist.model.SecSetting; |
| | | import com.jilongda.optometrist.model.TLensGoods; |
| | | import com.jilongda.optometrist.query.TLensGoodsQuery; |
| | | import com.jilongda.optometrist.service.TLensGoodsService; |
| | | import com.jilongda.optometrist.vo.TLensGoodsVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TLensGoodsServiceImpl extends ServiceImpl<TLensGoodsMapper, TLensGoods> implements TLensGoodsService { |
| | | |
| | | |
| | | @Resource |
| | | private SecSettingMapper secSettingMapper; |
| | | @Override |
| | | public PageInfo<TLensGoodsVO> lensReceiptList(TLensGoodsQuery query) { |
| | | PageInfo<TLensGoodsVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TLensGoodsVO> list = this.baseMapper.lensReceiptList(query, pageInfo); |
| | | SecSetting secSetting = secSettingMapper.selectOne(null); |
| | | for (TLensGoodsVO tFrameGoodsVO : list) { |
| | | if (tFrameGoodsVO.getTotal() < secSetting.getLensThreshold()) { |
| | | tFrameGoodsVO.setIsWarning(1); |
| | | } |
| | | switch (tFrameGoodsVO.getLensType()){ |
| | | case 1: |
| | | String sphere = tFrameGoodsVO.getSphere(); |
| | | if (sphere.contains("cost")){ |
| | | JSONArray objects = JSONObject.parseArray(sphere); |
| | | // 遍历这个数组 |
| | | for (Object object : objects) { |
| | | JSONObject jsonObject = (JSONObject) object; |
| | | String cost = jsonObject.getString("refractiveIndex"); |
| | | if (tFrameGoodsVO.getRefractiveIndex().equals(cost)){ |
| | | tFrameGoodsVO.setSale(jsonObject.getString("sale")); |
| | | tFrameGoodsVO.setCost(jsonObject.getString("cost")); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case 2: |
| | | String sphere1 = tFrameGoodsVO.getAsphericSurface(); |
| | | if (sphere1.contains("cost")){ |
| | | JSONArray objects = JSONObject.parseArray(sphere1); |
| | | // 遍历这个数组 |
| | | for (Object object : objects) { |
| | | JSONObject jsonObject = (JSONObject) object; |
| | | String cost = jsonObject.getString("refractiveIndex"); |
| | | if (tFrameGoodsVO.getRefractiveIndex().equals(cost)){ |
| | | tFrameGoodsVO.setSale(jsonObject.getString("sale")); |
| | | tFrameGoodsVO.setCost(jsonObject.getString("cost")); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case 3: |
| | | String sphere2 = tFrameGoodsVO.getDoubleNon(); |
| | | if (sphere2.contains("cost")){ |
| | | JSONArray objects = JSONObject.parseArray(sphere2); |
| | | // 遍历这个数组 |
| | | for (Object object : objects) { |
| | | JSONObject jsonObject = (JSONObject) object; |
| | | String cost = jsonObject.getString("refractiveIndex"); |
| | | if (tFrameGoodsVO.getRefractiveIndex().equals(cost)){ |
| | | tFrameGoodsVO.setSale(jsonObject.getString("sale")); |
| | | tFrameGoodsVO.setCost(jsonObject.getString("cost")); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TLensSeriesMapper; |
| | | import com.jilongda.optometrist.mapper.TSupplierMapper; |
| | | import com.jilongda.optometrist.model.TLensSeries; |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import com.jilongda.optometrist.query.TLensSeriesQuery; |
| | | import com.jilongda.optometrist.service.TLensSeriesService; |
| | | import com.jilongda.optometrist.vo.TLensSeriesVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片系列表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TLensSeriesServiceImpl extends ServiceImpl<TLensSeriesMapper, TLensSeries> implements TLensSeriesService { |
| | | |
| | | @Resource |
| | | private TSupplierMapper supplierMapper; |
| | | @Override |
| | | public PageInfo<TLensSeriesVO> pageList(TLensSeriesQuery query) { |
| | | PageInfo<TLensSeriesVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TLensSeriesVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (TLensSeriesVO tLensSeriesVO : list) { |
| | | TSupplier tSupplier = supplierMapper.selectById(tLensSeriesVO.getSupplierId()); |
| | | if (tSupplier!=null)tLensSeriesVO.setSupplier(tSupplier.getName()); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.TLensWarehousingDetailMapper; |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import com.jilongda.optometrist.service.TLensWarehousingDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜片出库入库明细表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TLensWarehousingDetailServiceImpl extends ServiceImpl<TLensWarehousingDetailMapper, TLensWarehousingDetail> implements TLensWarehousingDetailService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TLineUpMapper; |
| | | import com.jilongda.optometrist.model.TLineUp; |
| | | import com.jilongda.optometrist.query.TLineUpQuery; |
| | | import com.jilongda.optometrist.service.TLineUpService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 排号管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TLineUpServiceImpl extends ServiceImpl<TLineUpMapper, TLineUp> implements TLineUpService { |
| | | |
| | | @Override |
| | | public PageInfo<TLineUp> pageList(TLineUpQuery query) { |
| | | PageInfo<TLineUp> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TLineUp> list=this.baseMapper.pageList(query, pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TMaterialMapper; |
| | | import com.jilongda.optometrist.model.TMaterial; |
| | | import com.jilongda.optometrist.query.TMaterialQuery; |
| | | import com.jilongda.optometrist.service.TMaterialService; |
| | | import com.jilongda.optometrist.vo.TMaterialVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片品牌表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TMaterialServiceImpl extends ServiceImpl<TMaterialMapper, TMaterial> implements TMaterialService { |
| | | |
| | | @Override |
| | | public Boolean isExit(Integer id, String name) { |
| | | if(Objects.nonNull(id)){ |
| | | return this.lambdaQuery().ne(TMaterial::getId, id).eq(TMaterial::getName, name).count() > 0; |
| | | }else { |
| | | // 如果是新增,则判断名称是否存在 |
| | | return count(new LambdaQueryChainWrapper<>(getBaseMapper()).eq(TMaterial::getName, name)) > 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean upAndDown(Long id, Integer status) { |
| | | TMaterial material = this.baseMapper.selectById(id); |
| | | material.setStatus(status); |
| | | return this.updateById(material); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TMaterialVO> pageList(TMaterialQuery query) { |
| | | PageInfo<TMaterialVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TMaterialVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TBrandMapper; |
| | | import com.jilongda.optometrist.mapper.TMaterialMapper; |
| | | import com.jilongda.optometrist.mapper.TSupplierMapper; |
| | | import com.jilongda.optometrist.model.TBrand; |
| | | import com.jilongda.optometrist.model.TMaterial; |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import com.jilongda.optometrist.mapper.TModelMapper; |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import com.jilongda.optometrist.query.TModelQuery; |
| | | import com.jilongda.optometrist.service.TModelService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.vo.TBrandVO; |
| | | import com.jilongda.optometrist.vo.TModelVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架型号表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TModelServiceImpl extends ServiceImpl<TModelMapper, TModel> implements TModelService { |
| | | |
| | | @Autowired |
| | | private TBrandMapper brandMapper; |
| | | @Autowired |
| | | private TSupplierMapper supplierMapper; |
| | | @Autowired |
| | | private TMaterialMapper materialMapper; |
| | | |
| | | @Override |
| | | public Boolean upAndDown(String name, Integer status) { |
| | | List<TModel> models = this.baseMapper.selectList(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getName,name)); |
| | | models.stream().filter(Objects::nonNull).forEach(model -> model.setStatus(status)); |
| | | return this.updateBatchById(models); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean upAndDownColor(String name, String color, Integer status) { |
| | | TModel model = this.baseMapper.selectOne(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getName,name) |
| | | .eq(TModel::getColor,color) |
| | | .last("LIMIT1 ")); |
| | | if (Objects.nonNull(model)){ |
| | | model.setStatus(status); |
| | | return this.updateById(model); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TModelVO> pageList(TModelQuery query) { |
| | | PageInfo<TModelVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TModelVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | List<Integer> brandIds = list.stream().map(TModel::getBrandId).collect(Collectors.toList()); |
| | | List<Integer> supplierIds= list.stream().map(TModel::getSupplierId).collect(Collectors.toList()); |
| | | List<Integer> materialIds= list.stream().map(TModel::getMaterialId).collect(Collectors.toList()); |
| | | List<TBrand> tBrands = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(brandIds)){ |
| | | tBrands = brandMapper.selectList(Wrappers.lambdaQuery(TBrand.class) |
| | | .in(TBrand::getId, brandIds)); |
| | | } |
| | | List<TSupplier> tSuppliers = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(supplierIds)){ |
| | | tSuppliers = supplierMapper.selectList(Wrappers.lambdaQuery(TSupplier.class) |
| | | .in(TSupplier::getId, supplierIds)); |
| | | } |
| | | List<TMaterial> materials = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(materialIds)){ |
| | | materials = materialMapper.selectList(Wrappers.lambdaQuery(TMaterial.class) |
| | | .in(TMaterial::getId, materialIds)); |
| | | } |
| | | for (TModelVO modelVO : list) { |
| | | TBrand tBrand = tBrands.stream().filter(brand -> brand.getId().equals(modelVO.getBrandId())).findFirst().orElse(null); |
| | | if(Objects.nonNull(tBrand)){ |
| | | modelVO.setBrandName(tBrand.getName()); |
| | | } |
| | | TSupplier tSupplier = tSuppliers.stream().filter(supplier -> supplier.getId().equals(modelVO.getSupplierId())).findFirst().orElse(null); |
| | | if(Objects.nonNull(tSupplier)){ |
| | | modelVO.setSupplierName(tSupplier.getName()); |
| | | } |
| | | TMaterial tMaterial = materials.stream().filter(material -> material.getId().equals(modelVO.getMaterialId())).findFirst().orElse(null); |
| | | if(Objects.nonNull(tMaterial)){ |
| | | modelVO.setMaterialName(tMaterial.getName()); |
| | | } |
| | | // 查询型号的色号 |
| | | List<TModel> colorList = this.list(Wrappers.lambdaQuery(TModel.class) |
| | | .eq(TModel::getName,modelVO.getName())); |
| | | String color = colorList.stream().map(TModel::getColor).collect(Collectors.joining(",")); |
| | | modelVO.setColor(color); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TOptometryMapper; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.model.SecFeeItems; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import com.jilongda.optometrist.mapper.TOptometristMapper; |
| | | import com.jilongda.optometrist.query.TOptometryQuery; |
| | | import com.jilongda.optometrist.query.TOptometristQuery; |
| | | import com.jilongda.optometrist.service.TOptometristService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.vo.TOptometryVO; |
| | | import com.jilongda.optometrist.vo.TSupplierVO; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import com.jilongda.optometrist.vo.TOptometristVO; |
| | | import com.jilongda.optometrist.vo.TStoreVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光师表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TOptometristServiceImpl extends ServiceImpl<TOptometristMapper, TOptometrist> implements TOptometristService { |
| | | |
| | | @Override |
| | | public Boolean upAndDown(Integer id, Integer status) { |
| | | TOptometrist optometrist = this.baseMapper.selectById(id); |
| | | optometrist.setStatus(status); |
| | | return this.updateById(optometrist); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TOptometryVO> pageList(TOptometryQuery query) { |
| | | PageInfo<TOptometryVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TOptometryVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TOptometristVO> pageList1(TOptometristQuery query) { |
| | | PageInfo<TOptometristVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TOptometristVO> list = this.baseMapper.pageList1(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.jilongda.optometrist.model.TOptometryDetail; |
| | | import com.jilongda.optometrist.mapper.TOptometryDetailMapper; |
| | | import com.jilongda.optometrist.service.TOptometryDetailService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单详情 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TOptometryDetailServiceImpl extends ServiceImpl<TOptometryDetailMapper, TOptometryDetail> implements TOptometryDetailService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.TOptometryMapper; |
| | | import com.jilongda.optometrist.model.TOptometry; |
| | | import com.jilongda.optometrist.service.TOptometryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TOptometryServiceImpl extends ServiceImpl<TOptometryMapper, TOptometry> implements TOptometryService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.TOrderAccountingMapper; |
| | | import com.jilongda.optometrist.model.TOrderAccounting; |
| | | import com.jilongda.optometrist.service.TOrderAccountingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单核算表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TOrderAccountingServiceImpl extends ServiceImpl<TOrderAccountingMapper, TOrderAccounting> implements TOrderAccountingService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TOrderAftersalesMapper; |
| | | import com.jilongda.optometrist.model.TOrderAftersales; |
| | | import com.jilongda.optometrist.query.TOrderAftersalesQuery; |
| | | import com.jilongda.optometrist.service.TOrderAftersalesService; |
| | | import com.jilongda.optometrist.vo.TOrderAftersalesVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单售后表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TOrderAftersalesServiceImpl extends ServiceImpl<TOrderAftersalesMapper, TOrderAftersales> implements TOrderAftersalesService { |
| | | |
| | | @Override |
| | | public PageInfo<TOrderAftersalesVO> pageList(TOrderAftersalesQuery query) { |
| | | PageInfo<TOrderAftersalesVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TOrderAftersalesVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.jilongda.optometrist.model.TOrder; |
| | | import com.jilongda.optometrist.mapper.TOrderMapper; |
| | | import com.jilongda.optometrist.service.TOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 销售订单表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.mapper.RegionMapper; |
| | | import com.jilongda.optometrist.model.Region; |
| | | import com.jilongda.optometrist.service.ITRegionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市区三级联动 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 吕雪 |
| | | * @since 2020-06-02 |
| | | */ |
| | | @Service |
| | | public class TRegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements ITRegionService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TStoreMapper; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.query.TStoreQuery; |
| | | import com.jilongda.optometrist.service.TStoreService; |
| | | import com.jilongda.optometrist.vo.TStoreVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 门店表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TStoreServiceImpl extends ServiceImpl<TStoreMapper, TStore> implements TStoreService { |
| | | |
| | | @Override |
| | | public PageInfo<TStoreVO> pageList(TStoreQuery query) { |
| | | PageInfo<TStoreVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TStoreVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TSupplierMapper; |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import com.jilongda.optometrist.query.TSupplierQuery; |
| | | import com.jilongda.optometrist.service.TSupplierService; |
| | | import com.jilongda.optometrist.vo.TSupplierVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TSupplierServiceImpl extends ServiceImpl<TSupplierMapper, TSupplier> implements TSupplierService { |
| | | |
| | | @Override |
| | | public PageInfo<TSupplierVO> pageList(TSupplierQuery query) { |
| | | PageInfo<TSupplierVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TSupplierVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean isExit(Integer id, String name) { |
| | | if(Objects.nonNull(id)){ |
| | | return this.count(Wrappers.lambdaQuery(TSupplier.class) |
| | | .ne(TSupplier::getId, id).eq(TSupplier::getName, name)) > 0; |
| | | }else { |
| | | // 如果是新增,则判断名称是否存在 |
| | | return count(Wrappers.lambdaQuery(TSupplier.class).eq(TSupplier::getName, name)) > 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean upAndDown(Long id, Integer status) { |
| | | TSupplier supplier = this.baseMapper.selectById(id); |
| | | supplier.setStatus(status); |
| | | return this.updateById(supplier); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.authority.vo.SecUserVO; |
| | | import com.jilongda.optometrist.mapper.TStoreMapper; |
| | | import com.jilongda.optometrist.model.TMaterial; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.model.TTicket; |
| | | import com.jilongda.optometrist.mapper.TTicketMapper; |
| | | import com.jilongda.optometrist.query.TicketQuery; |
| | | import com.jilongda.optometrist.service.TTicketService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.optometrist.vo.TTicketVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * 小票机 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TTicketServiceImpl extends ServiceImpl<TTicketMapper, TTicket> implements TTicketService { |
| | | |
| | | @Autowired |
| | | private TStoreMapper storeMapper; |
| | | @Override |
| | | public Boolean upAndDown(Integer id, Integer status) { |
| | | TTicket ticket = this.baseMapper.selectById(id); |
| | | ticket.setStatus(status); |
| | | return this.updateById(ticket); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TTicketVO> pageList(TicketQuery query) { |
| | | PageInfo<TTicketVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TTicketVO> list = this.baseMapper.pageList(query, pageInfo); |
| | | for (TTicketVO tTicketVO : list) { |
| | | TStore tStore = storeMapper.selectById(tTicketVO.getStoreId()); |
| | | if(Objects.nonNull(tStore)){ |
| | | tTicketVO.setStoreName(tTicketVO.getStoreName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | // 获取列表 |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.model.TUser; |
| | | import com.jilongda.optometrist.mapper.TUserMapper; |
| | | import com.jilongda.optometrist.service.TUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-04-15 |
| | | */ |
| | | @Service |
| | | public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements TUserService { |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.optometrist.mapper.TFrameWarehousingDetailMapper; |
| | | import com.jilongda.optometrist.mapper.TLensWarehousingDetailMapper; |
| | | import com.jilongda.optometrist.mapper.TStoreMapper; |
| | | import com.jilongda.optometrist.mapper.TWarehousingMapper; |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailLensQuery; |
| | | import com.jilongda.optometrist.query.TWarehousingDetailQuery; |
| | | import com.jilongda.optometrist.service.TWarehousingService; |
| | | import com.jilongda.optometrist.vo.TFrameWarehousingDetailVO; |
| | | import com.jilongda.optometrist.vo.TLensWarehousingDetailVO; |
| | | import com.jilongda.optometrist.vo.TWarehousingLensVO; |
| | | import com.jilongda.optometrist.vo.TWarehousingVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片出库入库表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Service |
| | | public class TWarehousingServiceImpl extends ServiceImpl<TWarehousingMapper, TWarehousing> implements TWarehousingService { |
| | | |
| | | @Autowired |
| | | private TStoreMapper storeMapper; |
| | | @Autowired |
| | | private TFrameWarehousingDetailMapper frameWarehousingDetailMapper; |
| | | @Autowired |
| | | private TLensWarehousingDetailMapper lensWarehousingDetailMapper; |
| | | |
| | | @Override |
| | | public PageInfo<TFrameWarehousingDetailVO> detailList(TWarehousingDetailQuery query) { |
| | | PageInfo<TFrameWarehousingDetailVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TFrameWarehousingDetailVO> list = frameWarehousingDetailMapper.pageList(query,pageInfo); |
| | | for (TFrameWarehousingDetailVO tFrameWarehousingDetailVO : list) { |
| | | TStore tStore = storeMapper.selectById(tFrameWarehousingDetailVO.getStoreId()); |
| | | if(Objects.nonNull(tStore)){ |
| | | tFrameWarehousingDetailVO.setStoreName(tStore.getName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | @Override |
| | | public PageInfo<TLensWarehousingDetailVO> detailListLens(TWarehousingDetailLensQuery query) { |
| | | PageInfo<TLensWarehousingDetailVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TLensWarehousingDetailVO> list = lensWarehousingDetailMapper.pageLensList(query,pageInfo); |
| | | for (TLensWarehousingDetailVO tFrameWarehousingDetailVO : list) { |
| | | TStore tStore = storeMapper.selectById(tFrameWarehousingDetailVO.getStoreId()); |
| | | if(Objects.nonNull(tStore)){ |
| | | tFrameWarehousingDetailVO.setStoreName(tStore.getName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | @Override |
| | | public PageInfo<TWarehousingVO> inventoryReceiptList(TWarehousingDetailQuery query) { |
| | | PageInfo<TWarehousingVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TWarehousingVO> list = this.baseMapper.inventoryReceiptList(query,pageInfo); |
| | | for (TWarehousingVO tWarehousingVO : list) { |
| | | List<TFrameWarehousingDetail> tFrameWarehousingDetails = frameWarehousingDetailMapper.selectList(Wrappers.lambdaQuery(TFrameWarehousingDetail.class) |
| | | .eq(TFrameWarehousingDetail::getWarehousingId, tWarehousingVO.getId())); |
| | | if(CollectionUtils.isNotEmpty(tFrameWarehousingDetails)){ |
| | | tWarehousingVO.setTotalNum(tFrameWarehousingDetails.stream().mapToInt(TFrameWarehousingDetail::getTotal).sum()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TWarehousingLensVO> inventoryReceiptLensList(TWarehousingDetailLensQuery query) { |
| | | PageInfo<TWarehousingLensVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TWarehousingLensVO> list = this.baseMapper.inventoryReceiptLensList(query,pageInfo); |
| | | for (TWarehousingLensVO tWarehousingVO : list) { |
| | | List<TLensWarehousingDetail> lensWarehousingDetails = lensWarehousingDetailMapper.selectList(Wrappers.lambdaQuery(TLensWarehousingDetail.class) |
| | | .eq(TLensWarehousingDetail::getWarehousingId, tWarehousingVO.getId())); |
| | | if(CollectionUtils.isNotEmpty(lensWarehousingDetails)){ |
| | | tWarehousingVO.setTotalNum(lensWarehousingDetails.stream().mapToInt(TLensWarehousingDetail::getTotal).sum()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | public class FileUtils { |
| | | |
| | | public static final int cache = 10 * 1024; |
| | | /** |
| | | * 根据url下载文件,保存到filepath中 |
| | | * |
| | | * @param url 文件的url |
| | | * @param diskUrl 本地存储路径 |
| | | * @return |
| | | */ |
| | | public static String download(String url, String diskUrl) { |
| | | String filepath = ""; |
| | | String filename = ""; |
| | | try { |
| | | HttpClient client = HttpClients.createDefault(); |
| | | HttpGet httpget = new HttpGet(url); |
| | | // 加入Referer,防止防盗链 |
| | | httpget.setHeader("Referer", url); |
| | | HttpResponse response = client.execute(httpget); |
| | | HttpEntity entity = response.getEntity(); |
| | | InputStream is = entity.getContent(); |
| | | if (StringUtils.isBlank(filepath)){ |
| | | Map<String,String> map = getFilePath(response,url,diskUrl); |
| | | filepath = map.get("filepath"); |
| | | filename = map.get("filename"); |
| | | } |
| | | File file = new File(filepath); |
| | | file.getParentFile().mkdirs(); |
| | | FileOutputStream fileout = new FileOutputStream(file); |
| | | byte[] buffer = new byte[cache]; |
| | | int ch = 0; |
| | | while ((ch = is.read(buffer)) != -1) { |
| | | fileout.write(buffer, 0, ch); |
| | | } |
| | | is.close(); |
| | | fileout.flush(); |
| | | fileout.close(); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return filename; |
| | | } |
| | | |
| | | /** |
| | | * 根据contentType 获取对应的后缀 (列出常用的ContentType对应的后缀) |
| | | * |
| | | * @param contentType |
| | | * @return |
| | | */ |
| | | static String getContentType(String contentType){ |
| | | HashMap<String, String> map = new HashMap<String, String>() { |
| | | { |
| | | put("application/msword", ".doc"); |
| | | put("image/jpeg", ".jpeg"); |
| | | put("application/x-jpg", ".jpg"); |
| | | put("video/mpeg4", ".mp4"); |
| | | put("application/pdf", ".pdf"); |
| | | put("application/x-png", ".png"); |
| | | put("application/x-ppt", ".ppt"); |
| | | put("application/postscript", ".ps"); |
| | | put("application/vnd.android.package-archive", ".apk"); |
| | | put("video/avi", ".avi"); |
| | | put("text/html", ".htm"); |
| | | put("image/png", ".png"); |
| | | put("application/x-png", ".png"); |
| | | put("audio/mpeg", ".mp3"); |
| | | put("image/gif", ".gif"); |
| | | } |
| | | }; |
| | | return map.get(contentType); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取response要下载的文件的默认路径 |
| | | * |
| | | * @param response |
| | | * @return |
| | | */ |
| | | public static Map<String,String> getFilePath(HttpResponse response, String url, String diskUrl) { |
| | | Map<String,String> map = new HashMap<>(); |
| | | String filepath = diskUrl; |
| | | String filename = getFileName(response, url); |
| | | String contentType = response.getEntity().getContentType().getValue(); |
| | | if(StringUtils.isNotEmpty(contentType)){ |
| | | // 获取后缀 |
| | | String suffix = getContentType(contentType); |
| | | String regEx = ".+(.+)$"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(filename); |
| | | if (!m.find()) { |
| | | // 如果正则匹配后没有后缀,则需要通过response中的ContentType的值进行匹配 |
| | | if(StringUtils.isNotBlank(suffix)){ |
| | | filename = filename + suffix; |
| | | } |
| | | }else{ |
| | | if(filename.length()>20){ |
| | | filename = getRandomFileName() + suffix; |
| | | } |
| | | } |
| | | } |
| | | if (filename != null) { |
| | | filepath += filename; |
| | | } else { |
| | | filepath += getRandomFileName(); |
| | | } |
| | | map.put("filename", filename); |
| | | map.put("filepath", filepath); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 获取response header中Content-Disposition中的filename值 |
| | | * @param response |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public static String getFileName(HttpResponse response,String url) { |
| | | Header contentHeader = response.getFirstHeader("Content-Disposition"); |
| | | String filename = null; |
| | | if (contentHeader != null) { |
| | | // 如果contentHeader存在 |
| | | HeaderElement[] values = contentHeader.getElements(); |
| | | if (values.length == 1) { |
| | | NameValuePair param = values[0].getParameterByName("filename"); |
| | | if (param != null) { |
| | | try { |
| | | filename = param.getValue(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | // 正则匹配后缀 |
| | | filename = getSuffix(url); |
| | | } |
| | | |
| | | return filename; |
| | | } |
| | | |
| | | /** |
| | | * 获取随机文件名 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomFileName() { |
| | | return String.valueOf(System.currentTimeMillis()); |
| | | } |
| | | |
| | | /** |
| | | * 获取文件名后缀 |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public static String getSuffix(String url) { |
| | | // 正则表达式“.+/(.+)$”的含义就是:被匹配的字符串以任意字符序列开始,后边紧跟着字符“/”, |
| | | // 最后以任意字符序列结尾,“()”代表分组操作,这里就是把文件名做为分组,匹配完毕我们就可以通过Matcher |
| | | // 类的group方法取到我们所定义的分组了。需要注意的这里的分组的索引值是从1开始的,所以取第一个分组的方法是m.group(1)而不是m.group(0)。 |
| | | String regEx = ".+/(.+)$"; |
| | | Pattern p = Pattern.compile(regEx); |
| | | Matcher m = p.matcher(url); |
| | | if (!m.find()) { |
| | | // 格式错误,则随机生成个文件名 |
| | | return String.valueOf(System.currentTimeMillis()); |
| | | } |
| | | return m.group(1); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 下载ZIP压缩包(会对下载后的压缩包进行删除) |
| | | * |
| | | * @param file zip压缩包文件 |
| | | * @param response 响应 |
| | | * @author liukai |
| | | */ |
| | | public static void downloadZip(File file, HttpServletResponse response) { |
| | | OutputStream toClient = null; |
| | | try { |
| | | // 以流的形式下载文件。 |
| | | BufferedInputStream fis = new BufferedInputStream(new FileInputStream(file.getPath())); |
| | | byte[] buffer = new byte[fis.available()]; |
| | | fis.read(buffer); |
| | | fis.close(); |
| | | // 清空response |
| | | response.reset(); |
| | | toClient = new BufferedOutputStream(response.getOutputStream()); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("application/octet-stream"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + file.getName()); |
| | | toClient.write(buffer); |
| | | toClient.flush(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (toClient != null) { |
| | | try { |
| | | toClient.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | //删除改临时zip包(此zip包任何时候都不需要保留,因为源文件随时可以再次进行压缩生成zip包) |
| | | // file.delete(); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static Boolean deleteFile(File file) { |
| | | //判断文件不为null或文件目录存在 |
| | | if (file == null || !file.exists()) { |
| | | System.out.println("文件删除失败,请检查文件是否存在以及文件路径是否正确"); |
| | | return false; |
| | | } |
| | | //获取目录下子文件 |
| | | File[] files = file.listFiles(); |
| | | //遍历该目录下的文件对象 |
| | | for (File f : files) { |
| | | //判断子目录是否存在子目录,如果是文件则删除 |
| | | if (f.isDirectory()) { |
| | | //递归删除目录下的文件 |
| | | deleteFile(f); |
| | | } else { |
| | | //文件删除 |
| | | f.delete(); |
| | | //打印文件名 |
| | | System.out.println("文件名:" + f.getName()); |
| | | } |
| | | } |
| | | //文件夹删除 |
| | | file.delete(); |
| | | System.out.println("目录名:" + file.getName()); |
| | | return true; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.utils; |
| | | |
| | | import com.jilongda.common.model.TCustomers; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Objects; |
| | | @Slf4j |
| | | public class GoodsImportValidator { |
| | | |
| | | public static boolean validateCustomers(TCustomers customers) { |
| | | try { |
| | | return !isValidCustomers(customers); |
| | | } catch (Exception e) { |
| | | // 记录日志,提供详细的错误信息 |
| | | log.error("Validation error in GoodsImportExcel: {}", e.getMessage()); |
| | | // 可以根据具体情况决定是否需要抛出异常或如何处理这些异常 |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 校验客户导入Excel数据 |
| | | * |
| | | * @param customers 客户导入Excel数据 |
| | | * @return 校验结果 |
| | | */ |
| | | private static boolean isValidCustomers(TCustomers customers) { |
| | | return hasLength(customers.getCustomerName()) |
| | | && hasLength(customers.getRecipientPhone()) |
| | | && hasLength(customers.getCompanyName()) |
| | | && hasLength(customers.getRecipientName()) |
| | | && hasLength(customers.getSubsidiaryName()) |
| | | && hasLength(customers.getRecipientAddress()); |
| | | } |
| | | |
| | | private static boolean hasLength(String str) { |
| | | return StringUtils.hasLength(str); |
| | | } |
| | | |
| | | private static boolean isNotNull(Object obj) { |
| | | return Objects.nonNull(obj); |
| | | } |
| | | |
| | | private static boolean isNotNullAndNonNegative(Integer value) { |
| | | return Objects.nonNull(value) && value >= 0; |
| | | } |
| | | |
| | | // 自定义异常类 |
| | | class GoodsImportException extends RuntimeException { |
| | | public GoodsImportException(String message) { |
| | | super(message); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.security.JwtTokenUtils; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.service.SecUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class LoginInfoUtil { |
| | | |
| | | @Autowired |
| | | private SecUserService secUserService; |
| | | |
| | | |
| | | |
| | | public Long getUserId(){ |
| | | String username = JwtTokenUtils.getUsername(); |
| | | SecUser userName = secUserService.getOne(new QueryWrapper<SecUser>().eq("phone", username).eq("isDelete",0)); |
| | | return userName.getId(); |
| | | |
| | | } |
| | | |
| | | public SecUser getLoginUser(){ |
| | | String username = JwtTokenUtils.getUsername(); |
| | | if("admin".equals(username)){ |
| | | return secUserService.getOne(Wrappers.lambdaQuery(SecUser.class).eq(SecUser::getAccount,username).eq(SecUser::getIsDelete,0)); |
| | | }else { |
| | | return secUserService.getOne(Wrappers.lambdaQuery(SecUser.class).eq(SecUser::getPhone,username).eq(SecUser::getIsDelete,0)); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.utils; |
| | | |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsRequest; |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsResponse; |
| | | import com.aliyun.tea.TeaException; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.aliyun.teautil.models.RuntimeOptions; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class MsgUtils { |
| | | |
| | | @Value("${oss.config.accessKeyId}") |
| | | private String accessKeyId; |
| | | @Value("${oss.config.accessKeySecret}") |
| | | private String accessKeySecret; |
| | | @Value("${oss.config.signName}") |
| | | private String signName; |
| | | @Value("${oss.config.templateCode}") |
| | | private String templateCode; |
| | | @Value("${oss.config.signNameTest}") |
| | | private String signNameTest; |
| | | @Value("${oss.config.templateCodeTest}") |
| | | private String templateCodeTest; |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | | * @param accessKeyId |
| | | * @param accessKeySecret |
| | | * @return Client |
| | | * @throws Exception |
| | | */ |
| | | public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { |
| | | Config config = new Config() |
| | | // 您的 AccessKey ID |
| | | .setAccessKeyId(accessKeyId) |
| | | // 您的 AccessKey Secret |
| | | .setAccessKeySecret(accessKeySecret); |
| | | // 访问的域名 |
| | | config.endpoint = "dysmsapi.aliyuncs.com"; |
| | | return new com.aliyun.dysmsapi20170525.Client(config); |
| | | } |
| | | |
| | | public void sendMsg(String phone,String code) throws Exception { |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); |
| | | SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | .setSignName(signName) |
| | | .setTemplateCode(templateCode) |
| | | .setPhoneNumbers(phone) |
| | | .setTemplateParam("{\"code\":\""+code+"\"}"); |
| | | RuntimeOptions runtime = new RuntimeOptions(); |
| | | try { |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime); |
| | | log.info("短信发送成功:{},{}",sendSmsResponse.getBody().getMessage(),sendSmsResponse.getStatusCode()); |
| | | } catch (TeaException error) { |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } catch (Exception _error) { |
| | | TeaException error = new TeaException(_error.getMessage(), _error); |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.utils; |
| | | |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.MultiFormatWriter; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | |
| | | import java.awt.image.BufferedImage; |
| | | import java.util.Hashtable; |
| | | |
| | | /** |
| | | * @author chengst |
| | | * @date 2019/11/4 |
| | | **/ |
| | | public class QRCodeUtil { |
| | | |
| | | private final static String CHARSET = "utf-8"; |
| | | |
| | | private final static int QRSIZEE = 300; |
| | | |
| | | // 二维码颜色 |
| | | private static final int BLACK = 0xFF000000; |
| | | // 二维码颜色 |
| | | private static final int WHITE = 0xFFFFFFFF; |
| | | |
| | | public static BufferedImage createImage(String content){ |
| | | Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>(); |
| | | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); |
| | | hints.put(EncodeHintType.CHARACTER_SET, CHARSET); |
| | | hints.put(EncodeHintType.MARGIN, 1); |
| | | BitMatrix bitMatrix = null; |
| | | try { |
| | | bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRSIZEE, QRSIZEE,hints); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | int width = bitMatrix.getWidth(); |
| | | int height = bitMatrix.getHeight(); |
| | | BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
| | | |
| | | for (int x = 0; x < width; x++) { |
| | | for (int y = 0; y < height; y++) { |
| | | image.setRGB(x, y, bitMatrix.get(x, y) ? BLACK : WHITE); |
| | | } |
| | | } |
| | | return image; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.optometrist.utils; |
| | | |
| | | |
| | | import com.jilongda.optometrist.model.TLineUp; |
| | | import com.jilongda.optometrist.service.TLineUpService; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 定时任务工具类 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Resource |
| | | private TLineUpService lineUpService; |
| | | |
| | | // 每天晚上9点执行的定时任务 |
| | | @Scheduled(cron = "0 0 23 * * ?") |
| | | public void taskNineDay() { |
| | | try { |
| | | System.err.println("执行每天晚上定时任务 排号修改状态"); |
| | | List<TLineUp> list = lineUpService.lambdaQuery().eq(TLineUp::getStatus, 1).list(); |
| | | for (TLineUp tLineUp : list) { |
| | | tLineUp.setStatus(5); |
| | | } |
| | | lineUpService.updateBatchById(list); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.security.JwtTokenUtils; |
| | | import com.jilongda.optometrist.authority.mapper.SecUserMapper; |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2022/5/6/00618:48 |
| | | */ |
| | | @Data |
| | | @Slf4j |
| | | @Component |
| | | public class UserUtil implements Serializable { |
| | | |
| | | @Autowired |
| | | private SecUserMapper secUserMapper; |
| | | |
| | | /** |
| | | * 获取后台用户信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public SecUser getSecUser() { |
| | | String username = JwtTokenUtils.getUsername(); |
| | | log.info("用户账号名:{}", username); |
| | | SecUser secUser = secUserMapper.selectOne(Wrappers.lambdaQuery(SecUser.class) |
| | | .eq(SecUser::getAccount, username)); |
| | | return secUser; |
| | | } |
| | | |
| | | /** |
| | | * 获取h5用户信息 |
| | | * @return |
| | | */ |
| | | /*public WxUserInfo getWxUser(HttpServletRequest request){ |
| | | String openid = JwtTokenUtils.getUsername(); |
| | | WxUserInfo wxUserInfo = wxUserInfoMapper.selectOne(Wrappers.lambdaQuery(WxUserInfo.class) |
| | | .eq(WxUserInfo::getOpenid, openid) |
| | | .last("LIMIT 1")); |
| | | log.info("token取出的用户信息为:{}",wxUserInfo); |
| | | return wxUserInfo; |
| | | }*/ |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TCouponReceive; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "用户VO") |
| | | public class TAppUserCouponVO extends TCouponReceive { |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String couponName; |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TAppUser; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel(value = "用户VO") |
| | | public class TAppUserVO extends TAppUser { |
| | | |
| | | @ApiModelProperty(value = "消费次数") |
| | | private Integer salesCount; |
| | | @ApiModelProperty(value = "验光次数") |
| | | private Integer optometryCount; |
| | | @ApiModelProperty(value = "最后消费时间") |
| | | private LocalDateTime salesTime; |
| | | @ApiModelProperty(value = "最后验光时间") |
| | | private LocalDateTime optometryTime; |
| | | @ApiModelProperty(value = "消费总金额") |
| | | private BigDecimal salesAmount; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import com.jilongda.optometrist.model.TBrand; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架/镜片品牌VO") |
| | | public class TBrandVO extends TBrand { |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TCoupon; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "优惠券详情VO") |
| | | public class TCouponInfoVO extends TCoupon { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "领取数量") |
| | | private Integer grantCout; |
| | | @ApiModelProperty(value = "使用数量") |
| | | private Integer useCount; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TCoupon; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "优惠券VO") |
| | | public class TCouponVO extends TCoupon { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "发放数量") |
| | | private Integer grantCout; |
| | | @ApiModelProperty(value = "使用数量") |
| | | private Integer useCount; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TFrameGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架库存VO") |
| | | public class TFrameGoodsVO extends TFrameGoods { |
| | | |
| | | @ApiModelProperty(value = "品牌名称") |
| | | private String brand; |
| | | @ApiModelProperty(value = "供应商名称") |
| | | private String supplier; |
| | | @ApiModelProperty(value = "材质名称") |
| | | private String material; |
| | | @ApiModelProperty(value = "型号名称") |
| | | private String model; |
| | | @ApiModelProperty(value = "单价/副") |
| | | private String sales; |
| | | @ApiModelProperty(value = "成本价/副") |
| | | private String cost; |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String store; |
| | | @ApiModelProperty(value = "是否低库存") |
| | | private Integer isWarning; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架出库入库明细VO") |
| | | public class TFrameWarehousingDetailVO extends TFrameWarehousingDetail { |
| | | |
| | | @ApiModelProperty(value = "类型 1=出库,2=入库,3=作废,4=退货") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TInventory; |
| | | import com.jilongda.optometrist.model.TInventoryFrameDetail; |
| | | import com.jilongda.optometrist.model.TInventoryLensDetail; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "盘点详情VO") |
| | | public class TInventoryInfoVO extends TInventory { |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String store; |
| | | @ApiModelProperty(value = "镜片盘点明细") |
| | | private List<TInventoryLensDetail> lensList; |
| | | @ApiModelProperty(value = "镜片盘点明细") |
| | | private List<TInventoryFrameDetail> frameList; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TFrameGoods; |
| | | import com.jilongda.optometrist.model.TInventory; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "盘点VO") |
| | | public class TInventoryVO extends TInventory { |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String store; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片库存详情VO") |
| | | public class TLensGoodsDetailVO{ |
| | | @ApiModelProperty(value = "品牌名称+系列名称+球/飞球+折射率") |
| | | private String title; |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "库存数据") |
| | | private List<TLensWarehousingDetail> list; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TLensGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片库存VO") |
| | | public class TLensGoodsVO extends TLensGoods { |
| | | |
| | | @ApiModelProperty(value = "品牌名称") |
| | | private String brand; |
| | | @ApiModelProperty(value = "系列名称") |
| | | private String series; |
| | | @ApiModelProperty(value = "单价/片") |
| | | private String sale; |
| | | @ApiModelProperty(value = "成本/片") |
| | | private String cost; |
| | | @ApiModelProperty(value = "前端忽略json球") |
| | | private String sphere; |
| | | @ApiModelProperty(value = "前端忽略json非球") |
| | | private String asphericSurface; |
| | | @ApiModelProperty(value = "前端忽略json成本双非") |
| | | private String doubleNon; |
| | | |
| | | |
| | | @ApiModelProperty(value = "库存类型 1库存 2非库存") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "是否低库存") |
| | | private Integer isWarning; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TLensSeries; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片系列VO") |
| | | public class TLensSeriesVO extends TLensSeries { |
| | | |
| | | @ApiModelProperty(value = "品牌名称") |
| | | private String brandName; |
| | | @ApiModelProperty(value = "球/非") |
| | | private String typeName; |
| | | @ApiModelProperty(value = "折射率") |
| | | private String refractiveIndex; |
| | | @ApiModelProperty(value = "供应商名称") |
| | | private String supplier; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架出库入库明细VO") |
| | | public class TLensWarehousingDetailVO extends TLensWarehousingDetail { |
| | | |
| | | @ApiModelProperty(value = "类型 1=出库,2=入库,3=作废,4=退货") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TMaterial; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "材质VO") |
| | | public class TMaterialVO extends TMaterial { |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架型号VO") |
| | | public class TModelVO extends TModel { |
| | | |
| | | @ApiModelProperty(value = "色号集合") |
| | | private List<String> colorList; |
| | | @ApiModelProperty(value = "品牌名称") |
| | | private String brandName; |
| | | @ApiModelProperty(value = "供应商") |
| | | private String supplierName; |
| | | @ApiModelProperty(value = "材质") |
| | | private String materialName; |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光师VO") |
| | | public class TOptometristVO extends TOptometrist { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TOptometry; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光单VO") |
| | | public class TOptometryVO extends TOptometry { |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "微信名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "R值") |
| | | private String rValue; |
| | | @ApiModelProperty(value = "L值") |
| | | private String lValue; |
| | | @ApiModelProperty(value = "瞳距") |
| | | private String pupilDistance; |
| | | @ApiModelProperty(value = "验光师名称") |
| | | private String optometristName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TOrderAftersales; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "售后列表VO") |
| | | public class TOrderAftersalesVO extends TOrderAftersales { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private BigDecimal orderMoney; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "门店管理分页显示") |
| | | public class TStoreVO extends TStore { |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TSupplier; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "供应商VO") |
| | | public class TSupplierVO extends TSupplier { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TTicket; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "小票机VO") |
| | | public class TTicketVO extends TTicket { |
| | | |
| | | |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String storeName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TLensWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜片出库入库VO") |
| | | public class TWarehousingLensVO extends TWarehousing { |
| | | |
| | | @ApiModelProperty(value = "出库/入库合计数量") |
| | | private Integer totalNum=0; |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "出库/入库明细") |
| | | private List<TLensWarehousingDetail> lensWarehousingDetails; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import com.jilongda.optometrist.model.TFrameWarehousingDetail; |
| | | import com.jilongda.optometrist.model.TWarehousing; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "镜架/镜片出库入库VO") |
| | | public class TWarehousingVO extends TWarehousing { |
| | | |
| | | @ApiModelProperty(value = "出库/入库合计数量") |
| | | private Integer totalNum=0; |
| | | |
| | | @ApiModelProperty(value = "出库/入库明细") |
| | | private List<TFrameWarehousingDetail> frameWarehousingDetails; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "人员新增借用列表返回") |
| | | public class UserAddListVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "人员新增借用层级列表") |
| | | private List<UserLevelVO> userLevelVOS = new ArrayList<>(); |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.optometrist.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "用户层级返回") |
| | | public class UserLevelVO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long key; |
| | | |
| | | @ApiModelProperty(value = "value") |
| | | private String value; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "是否为人员") |
| | | private Boolean flag = false; |
| | | |
| | | @ApiModelProperty(value = "子集") |
| | | private List<UserLevelVO> children = new ArrayList<>(); |
| | | |
| | | } |
| | |
| | | <module>common</module> |
| | | <module>applet</module> |
| | | <module>manage</module> |
| | | <module>optometrist</module> |
| | | </modules> |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |