refactor:导入项目运营基础管理模块初始工程
This commit is contained in:
parent
b80cbfae49
commit
253eeece86
9
yunlan-backend/jzo2o-foundations/Dockerfile
Normal file
9
yunlan-backend/jzo2o-foundations/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM openjdk:11-jdk
|
||||
LABEL maintainer="研究院研发组 <research-maint@itcast.cn>"
|
||||
RUN echo "Asia/Shanghai" > /etc/timezone
|
||||
ARG PACKAGE_PATH=./target/jzo2o-foundations.jar
|
||||
|
||||
ADD ${PACKAGE_PATH:-./} app.jar
|
||||
EXPOSE 8080
|
||||
EXPOSE 9999
|
||||
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS app.jar"]
|
||||
104
yunlan-backend/jzo2o-foundations/pom.xml
Normal file
104
yunlan-backend/jzo2o-foundations/pom.xml
Normal file
@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jzo2o-foundations</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<artifactId>jzo2o-parent</artifactId>
|
||||
<groupId>com.jzo2o</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jzo2o</groupId>
|
||||
<artifactId>jzo2o-mvc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jzo2o</groupId>
|
||||
<artifactId>jzo2o-knife4j-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.jzo2o</groupId>-->
|
||||
<!-- <artifactId>jzo2o-es</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!--单元测试-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jzo2o</groupId>
|
||||
<artifactId>jzo2o-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jzo2o</groupId>
|
||||
<artifactId>jzo2o-redis</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.jzo2o</groupId>-->
|
||||
<!-- <artifactId>jzo2o-canal-sync</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jzo2o</groupId>
|
||||
<artifactId>jzo2o-mysql</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.jzo2o</groupId>-->
|
||||
<!-- <artifactId>jzo2o-xxl-job</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>build-info</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<mainClass>com.jzo2o.foundations.FoundationsApplication</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -0,0 +1,25 @@
|
||||
package com.jzo2o.foundations;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
|
||||
/**
|
||||
* @author itcast
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableCaching
|
||||
@MapperScan("com.jzo2o.foundations.mapper")
|
||||
@SpringBootApplication
|
||||
@EnableAspectJAutoProxy
|
||||
public class FoundationsApplication {
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(FoundationsApplication.class)
|
||||
.build(args)
|
||||
.run(args);
|
||||
log.info("家政服务-运营基础服务启动");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.jzo2o.foundations.config;
|
||||
|
||||
import com.jzo2o.common.utils.JwtTool;
|
||||
import com.jzo2o.foundations.properties.ApplicaitonProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author itcast
|
||||
*/
|
||||
@Configuration
|
||||
public class JwtConfiguration {
|
||||
|
||||
@Resource
|
||||
private ApplicaitonProperties applicaitonProperties;
|
||||
|
||||
@Bean
|
||||
public JwtTool jwtTool() {
|
||||
return new JwtTool(applicaitonProperties.getJwtKey());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.jzo2o.foundations.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
/**
|
||||
* @author itcast
|
||||
*/
|
||||
@Configuration
|
||||
public class SecurityConfig {
|
||||
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.jzo2o.foundations.constants;
|
||||
|
||||
public class IndexConstants {
|
||||
/**
|
||||
* 服务信息索引
|
||||
*/
|
||||
public static final String SERVE = "serve_aggregation";
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.jzo2o.foundations.constants;
|
||||
|
||||
/**
|
||||
* redis相关常量
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/8/15 14:58
|
||||
**/
|
||||
public class RedisConstants {
|
||||
|
||||
public static final class CacheName {
|
||||
/**
|
||||
* 家政服务缓存
|
||||
*/
|
||||
public static final String JZ_CACHE = "JZ_CACHE";
|
||||
|
||||
/**
|
||||
* 用户端首页服务图标
|
||||
*/
|
||||
public static final String SERVE_ICON = "JZ_CACHE:SERVE_ICON";
|
||||
|
||||
/**
|
||||
* 用户端首页热门服务
|
||||
*/
|
||||
public static final String HOT_SERVE = "JZ_CACHE:HOT_SERVE";
|
||||
|
||||
/**
|
||||
* 用户端已开通服务分类
|
||||
*/
|
||||
public static final String SERVE_TYPE = "JZ_CACHE:SERVE_TYPE";
|
||||
|
||||
/**
|
||||
* 服务项
|
||||
*/
|
||||
public static final String SERVE_ITEM = "JZ_CACHE:SERVE_ITEM";
|
||||
|
||||
/**
|
||||
* 服务
|
||||
*/
|
||||
public static final String SERVE = "JZ_CACHE:SERVE_RECORD";
|
||||
}
|
||||
|
||||
public static final class CacheManager {
|
||||
/**
|
||||
* 缓存时间永久
|
||||
*/
|
||||
public static final String FOREVER = "cacheManagerForever";
|
||||
|
||||
/**
|
||||
* 缓存时间永久
|
||||
*/
|
||||
public static final String THIRTY_MINUTES = "cacheManager30Minutes";
|
||||
|
||||
/**
|
||||
* 缓存时间1天
|
||||
*/
|
||||
public static final String ONE_DAY = "cacheManagerOneDay";
|
||||
}
|
||||
|
||||
public static final class Ttl {
|
||||
/**
|
||||
* 缓存时间30分钟
|
||||
*/
|
||||
public static final int THIRTY = 30;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.jzo2o.foundations.controller.agency;
|
||||
|
||||
|
||||
import com.jzo2o.api.foundations.dto.response.RegionSimpleResDTO;
|
||||
import com.jzo2o.foundations.service.IRegionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@RestController("agencyRegionController")
|
||||
@RequestMapping("/agency/region")
|
||||
@Api(tags = "机构端 - 区域相关接口")
|
||||
public class RegionController {
|
||||
@Resource
|
||||
private IRegionService regionService;
|
||||
|
||||
@GetMapping("/activeRegionList")
|
||||
@ApiOperation("已开通服务区域列表")
|
||||
public List<RegionSimpleResDTO> activeRegionList() {
|
||||
return regionService.queryActiveRegionList();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.jzo2o.foundations.controller.consumer;
|
||||
|
||||
|
||||
import com.jzo2o.api.foundations.dto.response.RegionSimpleResDTO;
|
||||
import com.jzo2o.foundations.service.IRegionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@RestController("consumerRegionController")
|
||||
@RequestMapping("/consumer/region")
|
||||
@Api(tags = "用户端 - 区域相关接口")
|
||||
public class RegionController {
|
||||
@Resource
|
||||
private IRegionService regionService;
|
||||
|
||||
@GetMapping("/activeRegionList")
|
||||
@ApiOperation("已开通服务区域列表")
|
||||
public List<RegionSimpleResDTO> activeRegionList() {
|
||||
return regionService.queryActiveRegionListCache();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.jzo2o.foundations.controller.inner;
|
||||
|
||||
|
||||
import com.jzo2o.api.foundations.RegionApi;
|
||||
import com.jzo2o.api.foundations.dto.response.ConfigRegionInnerResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.RegionServeInfoResDTO;
|
||||
import com.jzo2o.common.utils.BeanUtils;
|
||||
import com.jzo2o.foundations.model.dto.response.ConfigRegionResDTO;
|
||||
import com.jzo2o.foundations.service.IConfigRegionService;
|
||||
import com.jzo2o.foundations.service.IRegionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inner/region")
|
||||
@Api(tags = "内部接口 - 区域相关接口")
|
||||
public class InnerRegionController implements RegionApi {
|
||||
@Resource
|
||||
private IConfigRegionService configRegionService;
|
||||
|
||||
@Override
|
||||
@GetMapping("/findAllConfigRegion")
|
||||
@ApiOperation("查询所有区域配置")
|
||||
public List<ConfigRegionInnerResDTO> findAll() {
|
||||
return configRegionService.queryAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("/findConfigRegionById/{id}")
|
||||
@ApiOperation("根据区域id查询区域配置")
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class)
|
||||
public ConfigRegionInnerResDTO findConfigRegionById(@PathVariable("id") Long id) {
|
||||
ConfigRegionResDTO configRegionResDTO = configRegionService.queryById(id);
|
||||
return BeanUtils.toBean(configRegionResDTO, ConfigRegionInnerResDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("/findConfigRegionByCityCode")
|
||||
@ApiOperation("根据城市编码获取区域配置信息")
|
||||
@ApiImplicitParam(name = "cityCode", value = "城市编码", required = true, dataTypeClass = String.class)
|
||||
public ConfigRegionInnerResDTO findConfigRegionByCityCode(@RequestParam("cityCode") String cityCode) {
|
||||
return configRegionService.queryByCityCode(cityCode);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.jzo2o.foundations.controller.inner;
|
||||
|
||||
|
||||
import com.jzo2o.api.foundations.ServeItemApi;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemSimpleResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeCategoryResDTO;
|
||||
import com.jzo2o.foundations.service.IServeItemService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 内部接口 - 服务项相关接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inner/serve-item")
|
||||
@Api(tags = "内部接口 - 服务项相关接口")
|
||||
public class InnerServeItemController implements ServeItemApi {
|
||||
@Resource
|
||||
private IServeItemService serveItemService;
|
||||
|
||||
@Override
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("根据id查询服务项")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务项id", required = true, dataTypeClass = Long.class)
|
||||
})
|
||||
public ServeItemResDTO findById(@PathVariable("id") Long id) {
|
||||
return serveItemService.queryServeItemAndTypeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("/listByIds")
|
||||
@ApiOperation("根据id列表查询服务项")
|
||||
public List<ServeItemSimpleResDTO> listByIds(@RequestParam("ids") List<Long> ids) {
|
||||
return serveItemService.queryServeItemListByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("/queryActiveServeItemCategory")
|
||||
@ApiOperation("查询启用状态的服务项目录")
|
||||
public List<ServeTypeCategoryResDTO> queryActiveServeItemCategory() {
|
||||
return serveItemService.queryActiveServeItemCategory();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.jzo2o.foundations.controller.inner;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.jzo2o.api.foundations.ServeTypeApi;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeSimpleResDTO;
|
||||
import com.jzo2o.foundations.enums.FoundationStatusEnum;
|
||||
import com.jzo2o.foundations.service.IServeTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 内部接口 - 服务类型相关接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inner/serve-type")
|
||||
@Api(tags = "内部接口 - 服务类型相关接口")
|
||||
public class InnerServeTypeController implements ServeTypeApi {
|
||||
@Resource
|
||||
private IServeTypeService serveTypeService;
|
||||
|
||||
@Override
|
||||
@GetMapping("/listByIds")
|
||||
@ApiOperation("根据id列表查询服务类型")
|
||||
public List<ServeTypeSimpleResDTO> listByIds(@RequestParam("ids") List<Long> ids) {
|
||||
return BeanUtil.copyToList(serveTypeService.listByIds(ids), ServeTypeSimpleResDTO.class);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.jzo2o.foundations.controller.open;
|
||||
|
||||
import com.jzo2o.foundations.model.dto.request.LoginReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.LoginResDTO;
|
||||
import com.jzo2o.foundations.service.ILoginService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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 javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author itcast
|
||||
*/
|
||||
@RestController("openLoginController")
|
||||
@RequestMapping("/open/login")
|
||||
@Api(tags = "白名单接口 - 运营人员登录相关接口")
|
||||
public class LoginController {
|
||||
|
||||
@Resource
|
||||
private ILoginService loginService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("运营人员登录")
|
||||
public LoginResDTO login(@RequestBody LoginReqDTO loginReqDTO) {
|
||||
String token = loginService.login(loginReqDTO);
|
||||
return new LoginResDTO(token);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.jzo2o.foundations.controller.operation;
|
||||
|
||||
|
||||
import com.jzo2o.foundations.model.dto.request.ConfigRegionSetReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ConfigRegionResDTO;
|
||||
import com.jzo2o.foundations.service.IConfigRegionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Validated
|
||||
@RestController("operationConfigRegionController")
|
||||
@RequestMapping("/operation/config-region")
|
||||
@Api(tags = "运营端 - 区域配置相关接口")
|
||||
public class ConfigRegionController {
|
||||
@Resource
|
||||
private IConfigRegionService configRegionService;
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("获取区域配置")
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class)
|
||||
public ConfigRegionResDTO queryById(@PathVariable(value = "id") Long id) {
|
||||
return configRegionService.queryById(id);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("区域配置设置")
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class)
|
||||
public void putById(@PathVariable(value = "id") Long id, @Validated @RequestBody ConfigRegionSetReqDTO configRegionSetReqDTO) {
|
||||
configRegionService.setConfigRegionById(id, configRegionSetReqDTO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.jzo2o.foundations.controller.operation;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.jzo2o.api.foundations.dto.response.RegionSimpleResDTO;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.domain.Region;
|
||||
import com.jzo2o.foundations.model.dto.request.RegionPageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.RegionUpsertReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.RegionResDTO;
|
||||
import com.jzo2o.foundations.service.IRegionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Validated
|
||||
@RestController("operationRegionController")
|
||||
@RequestMapping("/operation/region")
|
||||
@Api(tags = "运营端 - 区域相关接口")
|
||||
public class RegionController {
|
||||
@Resource
|
||||
private IRegionService regionService;
|
||||
|
||||
@GetMapping("/activeRegionList")
|
||||
@ApiOperation("已开通服务区域列表")
|
||||
public List<RegionSimpleResDTO> activeRegionList() {
|
||||
return regionService.queryActiveRegionList();
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("区域新增")
|
||||
public void add(@RequestBody RegionUpsertReqDTO regionUpsertReqDTO) {
|
||||
regionService.add(regionUpsertReqDTO);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("区域修改")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "managerName", value = "负责人名称", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "managerPhone", value = "负责人电话", required = true, dataTypeClass = String.class)
|
||||
})
|
||||
public void update(@NotNull(message = "id不能为空") @PathVariable("id") Long id,
|
||||
@RequestParam("managerName") String managerName,
|
||||
@RequestParam("managerPhone") String managerPhone) {
|
||||
regionService.update(id, managerName, managerPhone);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@ApiOperation("区域删除")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class)
|
||||
})
|
||||
public void delete(@NotNull(message = "id不能为空") @PathVariable("id") Long id) {
|
||||
regionService.deleteById(id);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("区域分页查询")
|
||||
public PageResult<RegionResDTO> page(RegionPageQueryReqDTO regionPageQueryReqDTO) {
|
||||
return regionService.page(regionPageQueryReqDTO);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("根据id查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class)
|
||||
})
|
||||
public RegionResDTO findById(@NotNull(message = "id不能为空") @PathVariable("id") Long id) {
|
||||
Region region = regionService.getById(id);
|
||||
return BeanUtil.toBean(region, RegionResDTO.class);
|
||||
}
|
||||
|
||||
@PutMapping("/activate/{id}")
|
||||
@ApiOperation("区域启用")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class),
|
||||
})
|
||||
public void activate(@PathVariable("id") Long id) {
|
||||
regionService.active(id);
|
||||
}
|
||||
|
||||
@PutMapping("/deactivate/{id}")
|
||||
@ApiOperation("区域禁用")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = true, dataTypeClass = Long.class),
|
||||
})
|
||||
public void deactivate(@PathVariable("id") Long id) {
|
||||
regionService.deactivate(id);
|
||||
}
|
||||
|
||||
@PutMapping("/refreshRegionRelateCaches/{id}")
|
||||
@ApiOperation("刷新区域相关缓存")
|
||||
public void refreshRegionRelateCaches(@PathVariable("id") Long id) {
|
||||
//todo
|
||||
// homeService.refreshRegionRelateCaches(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.jzo2o.foundations.controller.operation;
|
||||
|
||||
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemResDTO;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeItemPageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeItemUpsertReqDTO;
|
||||
import com.jzo2o.foundations.service.IServeItemService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Validated
|
||||
@RestController("operationServeItemController")
|
||||
@RequestMapping("/operation/serve-item")
|
||||
@Api(tags = "运营端 - 服务项相关接口")
|
||||
public class ServeItemController {
|
||||
@Resource
|
||||
private IServeItemService serveItemService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("服务项新增")
|
||||
public void add(@RequestBody ServeItemUpsertReqDTO serveItemUpsertReqDTO) {
|
||||
serveItemService.add(serveItemUpsertReqDTO);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("服务项修改")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务项id", required = true, dataTypeClass = Long.class)
|
||||
})
|
||||
public void update(@NotNull(message = "id不能为空") @PathVariable("id") Long id, @RequestBody ServeItemUpsertReqDTO serveItemUpsertReqDTO) {
|
||||
serveItemService.update(id, serveItemUpsertReqDTO);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/activate/{id}") //启用状态,1:禁用,:2:启用
|
||||
@ApiOperation("服务项启用")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务id", required = true, dataTypeClass = Long.class),
|
||||
})
|
||||
public void activate(@PathVariable("id") Long id) {
|
||||
serveItemService.activate(id);
|
||||
}
|
||||
|
||||
@PutMapping("/deactivate/{id}")
|
||||
@ApiOperation("服务项禁用")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务id", required = true, dataTypeClass = Long.class),
|
||||
})
|
||||
public void deactivate(@PathVariable("id") Long id) {
|
||||
serveItemService.deactivate(id);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@ApiOperation("服务项删除")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务项id", required = true, dataTypeClass = Long.class),
|
||||
})
|
||||
public void delete(@NotNull(message = "id不能为空") @PathVariable("id") Long id) {
|
||||
serveItemService.deleteById(id);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("服务项分页查询")
|
||||
public PageResult<ServeItemResDTO> page(ServeItemPageQueryReqDTO serveItemPageQueryReqDTO) {
|
||||
return serveItemService.page(serveItemPageQueryReqDTO);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("根据id查询服务项")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务项id", required = true, dataTypeClass = Long.class)
|
||||
})
|
||||
public ServeItemResDTO findById(@NotNull(message = "id不能为空") @PathVariable("id") Long id) {
|
||||
return serveItemService.queryServeItemAndTypeById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.jzo2o.foundations.controller.operation;
|
||||
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeSimpleResDTO;
|
||||
import com.jzo2o.common.enums.EnableStatusEnum;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeTypePageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeTypeUpsertReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeTypeResDTO;
|
||||
import com.jzo2o.foundations.service.IServeTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务类型相关接口
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/26 14:16
|
||||
**/
|
||||
@RestController("operationServeTypeController")
|
||||
@RequestMapping("/operation/serve-type")
|
||||
@Api(tags = "运营端 - 服务类型相关接口")
|
||||
public class ServeTypeController {
|
||||
@Resource
|
||||
private IServeTypeService serveTypeService;
|
||||
|
||||
@GetMapping("/queryServeTypeListByActiveStatus")
|
||||
@ApiOperation("根据活动状态查询服务类型")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "activeStatus", value = "活动状态,0:草稿,1:禁用,:2:启用", dataTypeClass = Integer.class)
|
||||
})
|
||||
public List<ServeTypeSimpleResDTO> queryServeTypeListByActiveStatus(@RequestParam(value = "activeStatus", required = false) Integer activeStatus) {
|
||||
return serveTypeService.queryServeTypeListByActiveStatus(activeStatus);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("服务类型新增")
|
||||
public void add(@RequestBody ServeTypeUpsertReqDTO serveTypeUpsertReqDTO) {
|
||||
serveTypeService.add(serveTypeUpsertReqDTO);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("服务类型修改")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务类型id", required = true, dataTypeClass = Long.class)
|
||||
})
|
||||
public void update(@NotNull(message = "id不能为空") @PathVariable("id") Long id,
|
||||
@RequestBody ServeTypeUpsertReqDTO serveTypeUpsertReqDTO) {
|
||||
serveTypeService.update(id, serveTypeUpsertReqDTO);
|
||||
}
|
||||
|
||||
@PutMapping("/activate/{id}")
|
||||
@ApiOperation("服务类型启用")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务类型id", required = true, dataTypeClass = Long.class),
|
||||
})
|
||||
public void activate(@PathVariable("id") Long id) {
|
||||
serveTypeService.activate(id);
|
||||
}
|
||||
|
||||
@PutMapping("/deactivate/{id}")
|
||||
@ApiOperation("服务类型禁用")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务类型id", required = true, dataTypeClass = Long.class),
|
||||
})
|
||||
public void deactivate(@PathVariable("id") Long id) {
|
||||
serveTypeService.deactivate(id);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@ApiOperation("服务类型删除")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "服务类型id", required = true, dataTypeClass = Long.class)
|
||||
})
|
||||
public void delete(@NotNull(message = "id不能为空") @PathVariable("id") Long id) {
|
||||
serveTypeService.deleteById(id);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("服务类型分页查询")
|
||||
public PageResult<ServeTypeResDTO> page(ServeTypePageQueryReqDTO serveTypePageQueryReqDTO) {
|
||||
return serveTypeService.page(serveTypePageQueryReqDTO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.jzo2o.foundations.controller.worker;
|
||||
|
||||
|
||||
import com.jzo2o.api.foundations.dto.response.RegionSimpleResDTO;
|
||||
import com.jzo2o.foundations.service.IRegionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@RestController("workerRegionController")
|
||||
@RequestMapping("/worker/region")
|
||||
@Api(tags = "服务端 - 区域相关接口")
|
||||
public class RegionController {
|
||||
@Resource
|
||||
private IRegionService regionService;
|
||||
|
||||
@GetMapping("/activeRegionList")
|
||||
@ApiOperation("已开通服务区域列表")
|
||||
public List<RegionSimpleResDTO> activeRegionList() {
|
||||
return regionService.queryActiveRegionList();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.jzo2o.foundations.controller.worker;
|
||||
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeSimpleResDTO;
|
||||
import com.jzo2o.foundations.service.IServeTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务类型相关接口
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/26 14:16
|
||||
**/
|
||||
@RestController("workerServeTypeController")
|
||||
@RequestMapping("/worker/serve-type")
|
||||
@Api(tags = "服务端 - 服务类型相关接口")
|
||||
public class ServeTypeController {
|
||||
@Resource
|
||||
private IServeTypeService serveTypeService;
|
||||
|
||||
@GetMapping("/queryServeTypeListByActiveStatus")
|
||||
@ApiOperation("根据活动状态查询服务类型")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "activeStatus", value = "活动状态,0:草稿,1:禁用,:2:启用", dataTypeClass = Integer.class)
|
||||
})
|
||||
public List<ServeTypeSimpleResDTO> queryServeTypeListByActiveStatus(@RequestParam(value = "activeStatus", required = false) Integer activeStatus) {
|
||||
return serveTypeService.queryServeTypeListByActiveStatus(activeStatus);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.jzo2o.foundations.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum FoundationStatusEnum {
|
||||
INIT(0,"草稿"),
|
||||
ENABLE(2,"启用"),
|
||||
DISABLE(1, "禁用");
|
||||
private int status;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.status == status;
|
||||
}
|
||||
|
||||
public boolean equals(FoundationStatusEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.status == this.getStatus();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jzo2o.foundations.model.domain.CityDirectory;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 城市编码表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-04
|
||||
*/
|
||||
public interface CityDirectoryMapper extends BaseMapper<CityDirectory> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.jzo2o.foundations.model.domain.ConfigRegion;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域业务配置 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-08-21
|
||||
*/
|
||||
public interface ConfigRegionMapper extends BaseMapper<ConfigRegion> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jzo2o.foundations.model.domain.Operator;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营人员 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
public interface OperatorMapper extends BaseMapper<Operator> {
|
||||
|
||||
@Select("select * from operator")
|
||||
List<Operator> queryAll();
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.jzo2o.foundations.model.domain.Region;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
public interface RegionMapper extends BaseMapper<Region> {
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeCategoryResDTO;
|
||||
import com.jzo2o.foundations.model.domain.ServeItem;
|
||||
import com.jzo2o.foundations.model.domain.ServeType;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
public interface ServeItemMapper extends BaseMapper<ServeItem> {
|
||||
|
||||
// @Select("SELECT type.* FROM serve_type AS type \n" +
|
||||
// "LEFT JOIN serve_item AS item ON type.id = item.serve_type_id \n" +
|
||||
// "WHERE item.id = #{id}")
|
||||
// ServeType findServeTypeById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询服务项列表
|
||||
*
|
||||
* @param serveTypeId 服务类型id
|
||||
* @param name 服务项名称
|
||||
* @param activeStatus 活动状态,0:草稿,1禁用,2启用
|
||||
* @return 服务项列表
|
||||
*/
|
||||
List<ServeItemResDTO> queryList(@Param("serveTypeId") Long serveTypeId, @Param("name") String name, @Param("activeStatus") Integer activeStatus);
|
||||
|
||||
/**
|
||||
* 根据id查询服务项和服务类型信息
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @return 服务项和服务类型信息
|
||||
*/
|
||||
ServeItemResDTO queryServeItemAndTypeById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据服务id查询服务项
|
||||
*
|
||||
* @param id 服务id
|
||||
* @return 服务项
|
||||
*/
|
||||
ServeItem queryServeItemByServeId(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 查询启用状态的服务项目录
|
||||
*
|
||||
* @return 服务项目录
|
||||
*/
|
||||
List<ServeTypeCategoryResDTO> queryActiveServeItemCategory();
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeAggregationResDTO;
|
||||
import com.jzo2o.foundations.model.domain.Serve;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeAggregationSimpleResDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeAggregationTypeSimpleResDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeCategoryResDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeResDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
public interface ServeMapper extends BaseMapper<Serve> {
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.jzo2o.foundations.model.domain.ServeSync;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务同步表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-10
|
||||
*/
|
||||
public interface ServeSyncMapper extends BaseMapper<ServeSync> {
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jzo2o.foundations.mapper;
|
||||
|
||||
import com.jzo2o.foundations.model.domain.ServeType;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类型表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
public interface ServeTypeMapper extends BaseMapper<ServeType> {
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 城市编码表
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("city_directory")
|
||||
public class CityDirectory implements Serializable {
|
||||
private static final long serialVersionUID = -1543919563486396187L;
|
||||
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父级城市编码
|
||||
*/
|
||||
private String parentCode;
|
||||
|
||||
/**
|
||||
* 城市类型,1:省份。2:市级
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 城市名称拼音首字母
|
||||
*/
|
||||
private String pinyinInitial;
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域业务配置
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-08-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ConfigRegion implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.NONE)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* (个体)接单量限制
|
||||
*/
|
||||
private Integer staffReceiveOrderMax;
|
||||
|
||||
/**
|
||||
* (企业)接单量限制值
|
||||
*/
|
||||
private Integer institutionReceiveOrderMax;
|
||||
|
||||
/**
|
||||
* (个体)服务范围半径
|
||||
*/
|
||||
private Integer staffServeRadius;
|
||||
|
||||
/**
|
||||
* (企业)服务范围半径
|
||||
*/
|
||||
private Integer institutionServeRadius;
|
||||
|
||||
/**
|
||||
* 分流间隔(单位分钟),即下单时间与服务预计开始时间的间隔
|
||||
*/
|
||||
private Integer diversionInterval;
|
||||
|
||||
/**
|
||||
* 抢单超时时间间隔(单位分钟),从支付成功进入抢单后超过当前时间抢单派单同步进行
|
||||
*/
|
||||
private Integer seizeTimeoutInterval;
|
||||
|
||||
/**
|
||||
* 派单策略,1:距离优先策略,2:评分优先策略,3:接单量优先策略
|
||||
*/
|
||||
private Integer dispatchStrategy;
|
||||
|
||||
/**
|
||||
* 派单每轮时间间隔
|
||||
*/
|
||||
private Integer dispatchPerRoundInterval;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private Long createBy;
|
||||
|
||||
private Long updateBy;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营人员
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("operator")
|
||||
public class Operator implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.NONE)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 运营人员姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 账户状态:0-禁用 1-正常
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 创建者id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新者id
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 逻辑删除,默认0
|
||||
*/
|
||||
private Integer isDeleted;
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域表
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("region")
|
||||
public class Region implements Serializable {
|
||||
private static final long serialVersionUID = -6475795569304770481L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
private String managerName;
|
||||
|
||||
/**
|
||||
* 负责人电话
|
||||
*/
|
||||
private String managerPhone;
|
||||
|
||||
/**
|
||||
* 活动状态,0:草稿,1:禁用,:2:启用
|
||||
*/
|
||||
private Integer activeStatus;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updateBy;
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("serve")
|
||||
public class Serve implements Serializable {
|
||||
private static final long serialVersionUID = -283112689446411326L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
private Long serveItemId;
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 售卖状态,0:草稿,1下架,2上架
|
||||
*/
|
||||
private Integer saleStatus;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 是否为热门,0非热门,1热门
|
||||
*/
|
||||
private Integer isHot;
|
||||
|
||||
/**
|
||||
* 更新为热门的时间戳
|
||||
*/
|
||||
private Long hotTimeStamp;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updateBy;
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ServeAggregation implements Serializable {
|
||||
private static final long serialVersionUID = -1655955421320957958L;
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务项名称
|
||||
*/
|
||||
private String serveItemName;
|
||||
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
private Long serveTypeId;
|
||||
|
||||
/**
|
||||
* 服务项id
|
||||
*/
|
||||
private Long serveItemId;
|
||||
|
||||
/**
|
||||
* 城市代码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 是否是热门
|
||||
*/
|
||||
private Integer isHot;
|
||||
|
||||
/**
|
||||
* 更新为热门的时间戳
|
||||
*/
|
||||
private Long hotTimeStamp;
|
||||
|
||||
/**
|
||||
* 服务项排序字段
|
||||
*/
|
||||
private Integer serveItemSortNum;
|
||||
|
||||
/**
|
||||
* 服务类型排序字段
|
||||
*/
|
||||
private Integer serveTypeSortNum;
|
||||
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
private String serveTypeName;
|
||||
|
||||
/**
|
||||
* 服务类型图片
|
||||
*/
|
||||
private String serveTypeImg;
|
||||
|
||||
/**
|
||||
* 服务类型icon
|
||||
*/
|
||||
private String serveTypeIcon;
|
||||
|
||||
/**
|
||||
* 服务收费价格单位
|
||||
*/
|
||||
private Integer unit;
|
||||
|
||||
/**
|
||||
* 服务详情图片
|
||||
*/
|
||||
private String detailImg;
|
||||
|
||||
/**
|
||||
* 服务项图片
|
||||
*/
|
||||
private String serveItemImg;
|
||||
|
||||
/**
|
||||
* 服务图标
|
||||
*/
|
||||
private String serveItemIcon;
|
||||
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务表
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("serve_item")
|
||||
public class ServeItem implements Serializable {
|
||||
private static final long serialVersionUID = -6558310077509611789L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
private Long serveTypeId;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 服务图标
|
||||
*/
|
||||
private String serveItemIcon;
|
||||
|
||||
/**
|
||||
* 服务图片
|
||||
*/
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 服务单位
|
||||
*/
|
||||
private Integer unit;
|
||||
|
||||
/**
|
||||
* 服务描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 服务详图
|
||||
*/
|
||||
private String detailImg;
|
||||
|
||||
/**
|
||||
* 参考价格
|
||||
*/
|
||||
private BigDecimal referencePrice;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 活动状态,0:草稿,1禁用,2启用
|
||||
*/
|
||||
private Integer activeStatus;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updateBy;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务同步表
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("serve_sync")
|
||||
public class ServeSync implements Serializable {
|
||||
private static final long serialVersionUID = 7506867018480258143L;
|
||||
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务项名称
|
||||
*/
|
||||
private String serveItemName;
|
||||
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
private Long serveTypeId;
|
||||
|
||||
/**
|
||||
* 服务项id
|
||||
*/
|
||||
private Long serveItemId;
|
||||
|
||||
/**
|
||||
* 城市代码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 是否是热门
|
||||
*/
|
||||
private Integer isHot;
|
||||
|
||||
/**
|
||||
* 更新为热门的时间戳
|
||||
*/
|
||||
private Long hotTimeStamp;
|
||||
|
||||
/**
|
||||
* 服务项排序字段
|
||||
*/
|
||||
private Integer serveItemSortNum;
|
||||
|
||||
/**
|
||||
* 服务类型排序字段
|
||||
*/
|
||||
private Integer serveTypeSortNum;
|
||||
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
private String serveTypeName;
|
||||
|
||||
/**
|
||||
* 服务类型图片
|
||||
*/
|
||||
private String serveTypeImg;
|
||||
|
||||
/**
|
||||
* 服务类型icon
|
||||
*/
|
||||
private String serveTypeIcon;
|
||||
|
||||
/**
|
||||
* 服务收费价格单位
|
||||
*/
|
||||
private Integer unit;
|
||||
|
||||
/**
|
||||
* 服务详情图片
|
||||
*/
|
||||
private String detailImg;
|
||||
|
||||
/**
|
||||
* 服务项图片
|
||||
*/
|
||||
private String serveItemImg;
|
||||
|
||||
/**
|
||||
* 服务图标
|
||||
*/
|
||||
private String serveItemIcon;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.jzo2o.foundations.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类型表
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("serve_type")
|
||||
public class ServeType implements Serializable {
|
||||
private static final long serialVersionUID = 9096692500357281141L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务类型编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 服务类型图标
|
||||
*/
|
||||
private String serveTypeIcon;
|
||||
|
||||
/**
|
||||
* 服务类型图片
|
||||
*/
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 活动状态,0:草稿,1:禁用,:2:启用
|
||||
*/
|
||||
private Integer activeStatus;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updateBy;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.jzo2o.foundations.model.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author itcast
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("运营人员新增模型")
|
||||
public class OperatorAddDTO {
|
||||
@ApiModelProperty("账号")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("运营人员姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("密码")
|
||||
private String password;
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("区域配置")
|
||||
@Data
|
||||
public class ConfigRegionSetReqDTO {
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@ApiModelProperty(value = "区域id",required = true)
|
||||
private Long id;
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
@ApiModelProperty(value = "区域编码",required = true)
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* (个体)接单量限制
|
||||
*/
|
||||
@ApiModelProperty(value = "区域个人接单数量限制(单位个)",required = true)
|
||||
private Integer staffReceiveOrderMax;
|
||||
|
||||
/**
|
||||
* (企业)接单量限制值
|
||||
*/
|
||||
@ApiModelProperty(value = "区域企业接单数量限制,(单位个)",required = true)
|
||||
private Integer institutionReceiveOrderMax;
|
||||
|
||||
/**
|
||||
* (个体)服务范围半径
|
||||
*/
|
||||
@ApiModelProperty(value = "个人服务半径,(单位km)",required = true)
|
||||
private Integer staffServeRadius;
|
||||
|
||||
/**
|
||||
* (企业)服务范围半径
|
||||
*/
|
||||
@ApiModelProperty(value = "企业服务半径(单位km)",required = true)
|
||||
private Integer institutionServeRadius;
|
||||
|
||||
/**
|
||||
* 分流间隔(单位分钟),即下单时间与服务预计开始时间的间隔
|
||||
*/
|
||||
@ApiModelProperty(value = "分流间隔(单位分钟),即下单时间与服务预计开始时间的间隔",required = true)
|
||||
private Integer diversionInterval;
|
||||
|
||||
/**
|
||||
* 抢单超时时间间隔(单位分钟),从支付成功进入抢单后超过当前时间抢单派单同步进行
|
||||
*/
|
||||
@ApiModelProperty(value = "抢单超时时间间隔(单位分钟)",required = true)
|
||||
private Integer seizeTimeoutInterval;
|
||||
|
||||
/**
|
||||
* 派单策略,1:距离优先策略,2:评分优先策略,3:接单量优先策略
|
||||
*/
|
||||
@ApiModelProperty(value = "派单策略,1:距离优先策略,2:评分优先策略,3:接单量优先策略",required = true)
|
||||
private Integer dispatchStrategy;
|
||||
|
||||
/**
|
||||
* 派单每轮时间间隔,(单位s)
|
||||
*/
|
||||
@ApiModelProperty(value = "派单每轮时间间隔,(单位s)",required = true)
|
||||
private Integer dispatchPerRoundInterval;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("运营人员登录模型")
|
||||
@Data
|
||||
public class LoginReqDTO {
|
||||
|
||||
/**
|
||||
* 运营人员账号
|
||||
*/
|
||||
@ApiModelProperty("运营人员账号")
|
||||
private String username;
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
@ApiModelProperty("登录密码")
|
||||
private String password;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import com.jzo2o.common.model.dto.PageQueryDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 区域分页查询类
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 12:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("区域分页查询类")
|
||||
public class RegionPageQueryReqDTO extends PageQueryDTO {
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 区域新增更新
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/3 14:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("区域新增更新")
|
||||
public class RegionUpsertReqDTO {
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
@ApiModelProperty(value = "城市编码", required = true)
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@ApiModelProperty(value = "区域名称", required = true)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
@ApiModelProperty(value = "负责人名称", required = true)
|
||||
private String managerName;
|
||||
|
||||
/**
|
||||
* 负责人电话
|
||||
*/
|
||||
@ApiModelProperty(value = "负责人电话", required = true)
|
||||
private String managerPhone;
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import com.jzo2o.common.model.dto.PageQueryDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务项分页查询类
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 12:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务项分页查询类")
|
||||
public class ServeItemPageQueryReqDTO extends PageQueryDTO {
|
||||
|
||||
@ApiModelProperty("服务项名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("服务类型id")
|
||||
private Long serveTypeId;
|
||||
|
||||
@ApiModelProperty("活动状态,0:草稿,1禁用,2启用")
|
||||
private Integer activeStatus;
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 服务项新增更新
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/3 14:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务项新增更新")
|
||||
public class ServeItemUpsertReqDTO {
|
||||
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
@ApiModelProperty(value = "服务类型id", required = true)
|
||||
private Long serveTypeId;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
@ApiModelProperty(value = "服务名称", required = true)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 服务图标
|
||||
*/
|
||||
@ApiModelProperty(value = "服务图标", required = true)
|
||||
private String serveItemIcon;
|
||||
|
||||
/**
|
||||
* 服务图片
|
||||
*/
|
||||
@ApiModelProperty(value = "服务图片", required = true)
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 服务单位
|
||||
*/
|
||||
@ApiModelProperty(value = "服务单位", required = true)
|
||||
private Integer unit;
|
||||
|
||||
/**
|
||||
* 服务描述
|
||||
*/
|
||||
@ApiModelProperty(value = "服务描述", required = true)
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 服务详图
|
||||
*/
|
||||
@ApiModelProperty(value = "服务详图", required = true)
|
||||
private String detailImg;
|
||||
|
||||
/**
|
||||
* 参考价格
|
||||
*/
|
||||
@ApiModelProperty(value = "参考价格", required = true)
|
||||
private BigDecimal referencePrice;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@ApiModelProperty(value = "排序字段", required = true)
|
||||
private Integer sortNum;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import com.jzo2o.common.model.dto.PageQueryDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务分页查询类
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 12:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务分页查询类")
|
||||
public class ServePageQueryReqDTO extends PageQueryDTO {
|
||||
@ApiModelProperty(value = "区域id", required = true)
|
||||
private Long regionId;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务同步表更新
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/8/1 19:06
|
||||
**/
|
||||
@Data
|
||||
public class ServeSyncUpdateReqDTO {
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
private String serveTypeName;
|
||||
|
||||
/**
|
||||
* 服务类型图片
|
||||
*/
|
||||
private String serveTypeImg;
|
||||
|
||||
/**
|
||||
* 服务类型图标
|
||||
*/
|
||||
private String serveTypeIcon;
|
||||
|
||||
/**
|
||||
* 服务类型排序
|
||||
*/
|
||||
private Integer serveTypeSortNum;
|
||||
|
||||
/**
|
||||
* 服务项名称
|
||||
*/
|
||||
private String serveItemName;
|
||||
|
||||
/**
|
||||
* 服务项图片
|
||||
*/
|
||||
private String serveItemImg;
|
||||
|
||||
/**
|
||||
* 服务项图标
|
||||
*/
|
||||
private String serveItemIcon;
|
||||
|
||||
/**
|
||||
* 服务项排序
|
||||
*/
|
||||
private Integer serveItemSortNum;
|
||||
|
||||
/**
|
||||
* 服务收费价格单位
|
||||
*/
|
||||
private Integer unit;
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import com.jzo2o.common.model.dto.PageQueryDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务类型分页查询类
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 12:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务类型分页查询类")
|
||||
public class ServeTypePageQueryReqDTO extends PageQueryDTO {
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 服务类型新增更新
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/3 14:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务类型新增更新")
|
||||
public class ServeTypeUpsertReqDTO {
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
@ApiModelProperty(value = "服务类型名称", required = true)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 服务类型图标
|
||||
*/
|
||||
@ApiModelProperty(value = "服务类型图标", required = true)
|
||||
private String serveTypeIcon;
|
||||
|
||||
/**
|
||||
* 服务类型图片
|
||||
*/
|
||||
@ApiModelProperty(value = "服务类型图片", required = true)
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@ApiModelProperty(value = "排序字段", required = true)
|
||||
private Integer sortNum;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.jzo2o.foundations.model.dto.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 服务新增更新
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/3 14:43
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务新增更新")
|
||||
public class ServeUpsertReqDTO {
|
||||
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
@ApiModelProperty(value = "服务id", required = true)
|
||||
private Long serveItemId;
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@ApiModelProperty(value = "区域id", required = true)
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ApiModelProperty(value = "价格", required = true)
|
||||
private BigDecimal price;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 城市响应信息
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/12 10:12
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("城市响应信息")
|
||||
public class CityResDTO {
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
@ApiModelProperty("城市名称")
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
@ApiModelProperty("城市编码")
|
||||
private String cityCode;
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("区域配置")
|
||||
@Data
|
||||
public class ConfigRegionResDTO {
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@ApiModelProperty(value = "区域id",required = true)
|
||||
private Long id;
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
@ApiModelProperty(value = "区域编码",required = true)
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* (个体)接单量限制
|
||||
*/
|
||||
@ApiModelProperty(value = "区域个人接单数量限制(单位个)",required = true)
|
||||
private Integer staffReceiveOrderMax;
|
||||
|
||||
/**
|
||||
* (企业)接单量限制值
|
||||
*/
|
||||
@ApiModelProperty(value = "区域企业接单数量限制,(单位个)",required = true)
|
||||
private Integer institutionReceiveOrderMax;
|
||||
|
||||
/**
|
||||
* (个体)服务范围半径
|
||||
*/
|
||||
@ApiModelProperty(value = "个人服务半径,(单位km)",required = true)
|
||||
private Integer staffServeRadius;
|
||||
|
||||
/**
|
||||
* (企业)服务范围半径
|
||||
*/
|
||||
@ApiModelProperty(value = "企业服务半径(单位km)",required = true)
|
||||
private Integer institutionServeRadius;
|
||||
|
||||
/**
|
||||
* 分流间隔(单位分钟),即下单时间与服务预计开始时间的间隔
|
||||
*/
|
||||
@ApiModelProperty(value = "分流间隔(单位分钟),即下单时间与服务预计开始时间的间隔",required = true)
|
||||
private Integer diversionInterval;
|
||||
|
||||
/**
|
||||
* 抢单超时时间间隔(单位分钟),从支付成功进入抢单后超过当前时间抢单派单同步进行
|
||||
*/
|
||||
@ApiModelProperty(value = "抢单超时时间间隔(单位分钟)",required = true)
|
||||
private Integer seizeTimeoutInterval;
|
||||
|
||||
/**
|
||||
* 派单策略,1:距离优先策略,2:评分优先策略,3:接单量优先策略
|
||||
*/
|
||||
@ApiModelProperty(value = "派单策略,1:距离优先策略,2:评分优先策略,3:接单量优先策略",required = true)
|
||||
private Integer dispatchStrategy;
|
||||
|
||||
/**
|
||||
* 派单每轮时间间隔,(单位s)
|
||||
*/
|
||||
@ApiModelProperty(value = "派单每轮时间间隔,(单位s)",required = true)
|
||||
private Integer dispatchPerRoundInterval;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@ApiModel("登录结果")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LoginResDTO {
|
||||
|
||||
@ApiModelProperty("运营端访问token")
|
||||
private String token;
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 用户端-区域展示响应模型
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/8/28 15:54
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("区域展示响应模型")
|
||||
public class RegionDisplayResDTO {
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@ApiModelProperty("区域id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
@ApiModelProperty("区域编码")
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@ApiModelProperty("区域名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 活动状态,0:草稿,1:禁用,:2:启用
|
||||
*/
|
||||
@ApiModelProperty("活动状态,0:草稿,1:禁用,:2:启用")
|
||||
private Integer activeStatus;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 区域响应值
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 11:53
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("区域响应值")
|
||||
public class RegionResDTO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
@ApiModelProperty("城市编码")
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@ApiModelProperty("区域名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 负责人名称
|
||||
*/
|
||||
@ApiModelProperty("负责人名称")
|
||||
private String managerName;
|
||||
|
||||
/**
|
||||
* 负责人电话
|
||||
*/
|
||||
@ApiModelProperty("负责人电话")
|
||||
private String managerPhone;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 活动状态,0:草稿,1:禁用,:2:启用
|
||||
*/
|
||||
@ApiModelProperty("活动状态,0:草稿,1:禁用,:2:启用")
|
||||
private Integer activeStatus;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 区域简略响应值
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 11:53
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("区域简略响应值")
|
||||
public class RegionSimpleResDTO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@ApiModelProperty("区域名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
@ApiModelProperty("城市编码")
|
||||
private String cityCode;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 服务响应值
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 11:53
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ServeAggregationSimpleResDTO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
@ApiModelProperty("服务项id")
|
||||
private Long serveItemId;
|
||||
|
||||
/**
|
||||
* 服务项名称
|
||||
*/
|
||||
@ApiModelProperty("服务项名称")
|
||||
private String serveItemName;
|
||||
|
||||
/**
|
||||
* 服务项图片
|
||||
*/
|
||||
@ApiModelProperty("服务项图片")
|
||||
private String serveItemImg;
|
||||
|
||||
/**
|
||||
* 服务单位
|
||||
*/
|
||||
@ApiModelProperty("服务单位")
|
||||
private Integer unit;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ApiModelProperty("价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 服务详图
|
||||
*/
|
||||
@ApiModelProperty("服务详图")
|
||||
private String detailImg;
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
@ApiModelProperty("城市编码")
|
||||
private String cityCode;
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 服务分类响应信息
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/7 14:50
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("服务分类响应信息")
|
||||
public class ServeAggregationTypeSimpleResDTO {
|
||||
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
@ApiModelProperty("服务类型id")
|
||||
private Long serveTypeId;
|
||||
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
@ApiModelProperty("服务类型名称")
|
||||
private String serveTypeName;
|
||||
|
||||
/**
|
||||
* 服务类型图片
|
||||
*/
|
||||
@ApiModelProperty("服务类型图片")
|
||||
private String serveTypeImg;
|
||||
|
||||
/**
|
||||
* 服务类型排序字段
|
||||
*/
|
||||
@ApiModelProperty("服务类型排序字段")
|
||||
private Integer serveTypeSortNum;
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页服务图标
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/7 14:50
|
||||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel("首页服务图标")
|
||||
public class ServeCategoryResDTO {
|
||||
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
@ApiModelProperty("服务类型id")
|
||||
private Long serveTypeId;
|
||||
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
@ApiModelProperty("服务类型名称")
|
||||
private String serveTypeName;
|
||||
|
||||
/**
|
||||
* 服务类型图标
|
||||
*/
|
||||
@ApiModelProperty("服务类型图标")
|
||||
private String serveTypeIcon;
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 服务类型排序字段
|
||||
*/
|
||||
@ApiModelProperty("服务类型排序字段")
|
||||
private Integer serveTypeSortNum;
|
||||
|
||||
/**
|
||||
* 服务项图标列表
|
||||
*/
|
||||
@ApiModelProperty("服务项图标列表")
|
||||
private List<ServeSimpleResDTO> serveResDTOList;
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 服务响应值
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 11:53
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务响应值")
|
||||
public class ServeResDTO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 售卖状态,0:草稿,1下架,2上架
|
||||
*/
|
||||
@ApiModelProperty("售卖状态,0:草稿,1下架,2上架")
|
||||
private Integer saleStatus;
|
||||
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
@ApiModelProperty("服务项id")
|
||||
private Long serveItemId;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
@ApiModelProperty("服务项名称")
|
||||
private String serveItemName;
|
||||
|
||||
/**
|
||||
* 服务类型id
|
||||
*/
|
||||
@ApiModelProperty("服务类型id")
|
||||
private Long serveTypeId;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
@ApiModelProperty("服务类型名称")
|
||||
private String serveTypeName;
|
||||
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@ApiModelProperty("区域id")
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 参考价格
|
||||
*/
|
||||
@ApiModelProperty("参考价格")
|
||||
private BigDecimal referencePrice;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ApiModelProperty("价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 是否为热门,0非热门,1热门
|
||||
*/
|
||||
@ApiModelProperty("是否为热门,0非热门,1热门")
|
||||
private Integer isHot;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务简略响应信息
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/7 14:50
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务简略响应信息")
|
||||
public class ServeSimpleResDTO {
|
||||
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
@ApiModelProperty("服务id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务项id
|
||||
*/
|
||||
@ApiModelProperty("服务项id")
|
||||
private Long serveItemId;
|
||||
|
||||
/**
|
||||
* 服务项名称
|
||||
*/
|
||||
@ApiModelProperty("服务项名称")
|
||||
private String serveItemName;
|
||||
|
||||
/**
|
||||
* 服务项图标
|
||||
*/
|
||||
@ApiModelProperty("服务项图标")
|
||||
private String serveItemIcon;
|
||||
|
||||
/**
|
||||
* 服务项排序字段
|
||||
*/
|
||||
@ApiModelProperty("服务项排序字段")
|
||||
private Integer serveItemSortNum;
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.jzo2o.foundations.model.dto.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 服务类型响应值
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/4 11:53
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务类型响应值")
|
||||
public class ServeTypeResDTO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务类型编码
|
||||
*/
|
||||
@ApiModelProperty("服务类型编码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 服务类型名称
|
||||
*/
|
||||
@ApiModelProperty("服务类型名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 服务类型图标
|
||||
*/
|
||||
@ApiModelProperty("服务类型图标")
|
||||
private String serveTypeIcon;
|
||||
|
||||
/**
|
||||
* 服务类型图片
|
||||
*/
|
||||
@ApiModelProperty("服务类型图片")
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@ApiModelProperty("排序字段")
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 活动状态,0:草稿,1:禁用,:2:启用
|
||||
*/
|
||||
@ApiModelProperty("活动状态,0:草稿,1:禁用,:2:启用")
|
||||
private Integer activeStatus;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.jzo2o.foundations.properties;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 应用配置,没有明确分类的系统配置
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "jzo2o")
|
||||
@Data
|
||||
public class ApplicaitonProperties {
|
||||
|
||||
/**
|
||||
* jwt 加密秘钥
|
||||
*/
|
||||
private String jwtKey;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.jzo2o.api.foundations.dto.response.ConfigRegionInnerResDTO;
|
||||
import com.jzo2o.foundations.model.domain.ConfigRegion;
|
||||
import com.jzo2o.foundations.model.dto.request.ConfigRegionSetReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ConfigRegionResDTO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域业务配置 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-08-21
|
||||
*/
|
||||
public interface IConfigRegionService extends IService<ConfigRegion> {
|
||||
|
||||
/**
|
||||
* 获取区域配置
|
||||
*
|
||||
* @param id 区域id
|
||||
* @return 区域配置信息
|
||||
*/
|
||||
ConfigRegionResDTO queryById(Long id);
|
||||
|
||||
/**
|
||||
* 设置区域业务配置
|
||||
*
|
||||
* @param id 区域id
|
||||
* @param configRegionSetReqDTO 区域配置
|
||||
*/
|
||||
void setConfigRegionById(Long id, ConfigRegionSetReqDTO configRegionSetReqDTO);
|
||||
|
||||
/**
|
||||
* 初始化区域配置
|
||||
* @param id
|
||||
* @param cityCode
|
||||
*/
|
||||
void init(Long id, String cityCode);
|
||||
|
||||
/**
|
||||
* 查询所有的区域配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ConfigRegionInnerResDTO> queryAll();
|
||||
|
||||
/**
|
||||
* 根据城市编码获取区域配置
|
||||
*
|
||||
* @param cityCode 城市编码
|
||||
* @return 区域配置
|
||||
*/
|
||||
ConfigRegionInnerResDTO queryByCityCode(String cityCode);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.jzo2o.foundations.model.dto.request.LoginReqDTO;
|
||||
|
||||
/**
|
||||
* 登录相关业务
|
||||
* @author itcast
|
||||
*/
|
||||
public interface ILoginService {
|
||||
/**
|
||||
* 运营员登录
|
||||
*
|
||||
* @param loginReqDTO 运营人员登录请求模型
|
||||
* @return token
|
||||
*/
|
||||
String login(LoginReqDTO loginReqDTO);
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jzo2o.foundations.model.domain.Operator;
|
||||
import com.jzo2o.foundations.model.dto.OperatorAddDTO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营人员 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2023-06-29
|
||||
*/
|
||||
public interface IOperatorService extends IService<Operator> {
|
||||
|
||||
/**
|
||||
* 根据名称查询运营人员
|
||||
*
|
||||
* @param username 名称
|
||||
* @return 运营人员
|
||||
*/
|
||||
Operator findByUsername(String username);
|
||||
|
||||
/**
|
||||
* 新增运营人员
|
||||
*
|
||||
* @param operatorAddDTO 运营人员新增模型
|
||||
*/
|
||||
void add(OperatorAddDTO operatorAddDTO);
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jzo2o.api.foundations.dto.response.RegionSimpleResDTO;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.domain.Region;
|
||||
import com.jzo2o.foundations.model.dto.request.RegionPageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.RegionUpsertReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.RegionDisplayResDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.RegionResDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 区域管理
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/17 16:49
|
||||
**/
|
||||
public interface IRegionService extends IService<Region> {
|
||||
|
||||
/**
|
||||
* 区域新增
|
||||
*
|
||||
* @param regionUpsertReqDTO 插入更新区域
|
||||
*/
|
||||
void add(RegionUpsertReqDTO regionUpsertReqDTO);
|
||||
|
||||
/**
|
||||
* 区域修改
|
||||
*
|
||||
* @param id 区域id
|
||||
* @param managerName 负责人姓名
|
||||
* @param managerPhone 负责人电话
|
||||
*/
|
||||
void update(Long id, String managerName, String managerPhone);
|
||||
|
||||
/**
|
||||
* 区域删除
|
||||
*
|
||||
* @param id 区域id
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param regionPageQueryReqDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
PageResult<RegionResDTO> page(RegionPageQueryReqDTO regionPageQueryReqDTO);
|
||||
|
||||
/**
|
||||
* 已开通服务区域列表
|
||||
*
|
||||
* @return 区域列表
|
||||
*/
|
||||
List<RegionSimpleResDTO> queryActiveRegionList();
|
||||
|
||||
/**
|
||||
* 区域启用
|
||||
*
|
||||
* @param id 区域id
|
||||
*/
|
||||
void active(Long id);
|
||||
|
||||
/**
|
||||
* 区域禁用
|
||||
*
|
||||
* @param id 区域id
|
||||
*/
|
||||
void deactivate(Long id);
|
||||
|
||||
/**
|
||||
* 已开通服务区域列表
|
||||
*
|
||||
* @return 区域简略列表
|
||||
*/
|
||||
List<RegionSimpleResDTO> queryActiveRegionListCache();
|
||||
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemSimpleResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeCategoryResDTO;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.domain.ServeItem;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeItemPageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeItemUpsertReqDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
public interface IServeItemService extends IService<ServeItem> {
|
||||
/**
|
||||
* 服务项新增
|
||||
*
|
||||
* @param serveItemUpsertReqDTO 插入更新服务项
|
||||
*/
|
||||
void add(ServeItemUpsertReqDTO serveItemUpsertReqDTO);
|
||||
|
||||
/**
|
||||
* 服务项修改
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @param serveItemUpsertReqDTO 插入更新服务项
|
||||
* @return 服务项
|
||||
*/
|
||||
ServeItem update(Long id, ServeItemUpsertReqDTO serveItemUpsertReqDTO);
|
||||
|
||||
/**
|
||||
* 启用服务项
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @return
|
||||
*/
|
||||
ServeItem activate(Long id);
|
||||
|
||||
/**
|
||||
* 禁用服务项
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @return
|
||||
*/
|
||||
void deactivate(Long id);
|
||||
|
||||
/**
|
||||
* 服务项删除
|
||||
*
|
||||
* @param id 服务项id
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据服务类型id查询关联的启用状态服务项数量
|
||||
*
|
||||
* @param serveTypeId 服务类型id
|
||||
* @return 服务项数量
|
||||
*/
|
||||
int queryActiveServeItemCountByServeTypeId(Long serveTypeId);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param serveItemPageQueryReqDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
PageResult<ServeItemResDTO> page(ServeItemPageQueryReqDTO serveItemPageQueryReqDTO);
|
||||
|
||||
/**
|
||||
* 根据id查询详情
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @return 服务项详细信息
|
||||
*/
|
||||
ServeItemResDTO queryServeItemAndTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 根据id列表批量查询
|
||||
*
|
||||
* @param ids 服务项id列表
|
||||
* @return 服务项简略列表
|
||||
*/
|
||||
List<ServeItemSimpleResDTO> queryServeItemListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询启用状态的服务项目录
|
||||
*
|
||||
* @return 服务项目录
|
||||
*/
|
||||
List<ServeTypeCategoryResDTO> queryActiveServeItemCategory();
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.jzo2o.foundations.model.domain.ServeSync;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeSyncUpdateReqDTO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务同步表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-10
|
||||
*/
|
||||
public interface IServeSyncService extends IService<ServeSync> {
|
||||
/**
|
||||
* 根据服务项id更新
|
||||
*
|
||||
* @param serveItemId 服务项id
|
||||
* @param serveSyncUpdateReqDTO 服务同步更新数据
|
||||
*/
|
||||
void updateByServeItemId(Long serveItemId, ServeSyncUpdateReqDTO serveSyncUpdateReqDTO);
|
||||
|
||||
/**
|
||||
* 根据服务类型id更新
|
||||
*
|
||||
* @param serveTypeId 服务类型id
|
||||
* @param serveSyncUpdateReqDTO 服务同步更新数据
|
||||
*/
|
||||
void updateByServeTypeId(Long serveTypeId, ServeSyncUpdateReqDTO serveSyncUpdateReqDTO);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.jzo2o.foundations.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeSimpleResDTO;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.model.domain.ServeType;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeTypePageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeTypeUpsertReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeTypeResDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author itcast
|
||||
*/
|
||||
public interface IServeTypeService extends IService<ServeType> {
|
||||
|
||||
/**
|
||||
* 服务类型新增
|
||||
*
|
||||
* @param serveTypeUpsertReqDTO 插入更新服务类型
|
||||
*/
|
||||
void add(ServeTypeUpsertReqDTO serveTypeUpsertReqDTO);
|
||||
|
||||
/**
|
||||
* 服务类型修改
|
||||
*
|
||||
* @param id 服务类型id
|
||||
* @param serveTypeUpsertReqDTO 插入更新服务类型
|
||||
*/
|
||||
void update(Long id, ServeTypeUpsertReqDTO serveTypeUpsertReqDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 服务类型启用/禁用
|
||||
*
|
||||
* @param id 服务类型id
|
||||
*/
|
||||
void activate(Long id);
|
||||
|
||||
/**
|
||||
* 服务类型启用/禁用
|
||||
*
|
||||
* @param id 服务类型id
|
||||
*/
|
||||
void deactivate(Long id);
|
||||
|
||||
/**
|
||||
* 根据id删除服务类型
|
||||
*
|
||||
* @param id 服务类型id
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param serveTypePageQueryReqDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
PageResult<ServeTypeResDTO> page(ServeTypePageQueryReqDTO serveTypePageQueryReqDTO);
|
||||
|
||||
/**
|
||||
* 根据活动状态查询简略列表
|
||||
*
|
||||
* @param activeStatus 活动状态,0:草稿,1:禁用,:2:启用
|
||||
* @return 服务类型列表
|
||||
*/
|
||||
List<ServeTypeSimpleResDTO> queryServeTypeListByActiveStatus(Integer activeStatus);
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jzo2o.api.foundations.dto.response.ConfigRegionInnerResDTO;
|
||||
import com.jzo2o.common.utils.BeanUtils;
|
||||
import com.jzo2o.foundations.mapper.ConfigRegionMapper;
|
||||
import com.jzo2o.foundations.model.domain.ConfigRegion;
|
||||
import com.jzo2o.foundations.model.dto.request.ConfigRegionSetReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ConfigRegionResDTO;
|
||||
import com.jzo2o.foundations.service.IConfigRegionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 区域业务配置 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-08-21
|
||||
*/
|
||||
@Service
|
||||
public class ConfigRegionServiceImpl extends ServiceImpl<ConfigRegionMapper, ConfigRegion> implements IConfigRegionService {
|
||||
|
||||
@Override
|
||||
public ConfigRegionResDTO queryById(Long id) {
|
||||
ConfigRegion configRegion = baseMapper.selectById(id);
|
||||
return BeanUtils.toBean(configRegion, ConfigRegionResDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigRegionById(Long id, ConfigRegionSetReqDTO configRegionSetReqDTO) {
|
||||
ConfigRegion configRegion = BeanUtils.toBean(configRegionSetReqDTO, ConfigRegion.class);
|
||||
configRegion.setId(id);
|
||||
baseMapper.updateById(configRegion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Long id, String cityCode) {
|
||||
ConfigRegion configRegion = ConfigRegion.builder()
|
||||
.id(id)
|
||||
.cityCode(cityCode)
|
||||
// 个人接单数量限制,默认10个
|
||||
.staffReceiveOrderMax(10)
|
||||
// 机构接单数量限制,默认100个
|
||||
.institutionReceiveOrderMax(100)
|
||||
// 个人接单范围半径 50公里
|
||||
.staffServeRadius(50)
|
||||
// 机构接单范围半径200公里
|
||||
.institutionServeRadius(200)
|
||||
// 分流时间间隔120分钟,即下单时间与服务预计开始时间的间隔
|
||||
.diversionInterval(120)
|
||||
// 抢单超时时间,默认60分钟
|
||||
.seizeTimeoutInterval(60)
|
||||
// 派单策略默认距离优先策略
|
||||
.dispatchStrategy(1)
|
||||
// 派单每轮时间间隔,默认180s
|
||||
.dispatchPerRoundInterval(180)
|
||||
.build();
|
||||
baseMapper.insert(configRegion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConfigRegionInnerResDTO> queryAll() {
|
||||
List<ConfigRegion> list = lambdaQuery().list();
|
||||
return BeanUtils.copyToList(list, ConfigRegionInnerResDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigRegionInnerResDTO queryByCityCode(String cityCode) {
|
||||
ConfigRegion configRegion = lambdaQuery()
|
||||
.eq(ConfigRegion::getCityCode, cityCode)
|
||||
.one();
|
||||
return BeanUtils.toBean(configRegion, ConfigRegionInnerResDTO.class);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import com.jzo2o.common.constants.UserType;
|
||||
import com.jzo2o.common.expcetions.RequestForbiddenException;
|
||||
import com.jzo2o.common.utils.JwtTool;
|
||||
import com.jzo2o.foundations.model.domain.Operator;
|
||||
import com.jzo2o.foundations.model.dto.request.LoginReqDTO;
|
||||
import com.jzo2o.foundations.service.ILoginService;
|
||||
import com.jzo2o.foundations.service.IOperatorService;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author itcast
|
||||
*/
|
||||
@Service
|
||||
public class LoginServiceImpl implements ILoginService {
|
||||
|
||||
@Resource
|
||||
private IOperatorService operatorService;
|
||||
@Resource
|
||||
private JwtTool jwtTool;
|
||||
@Resource
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 运营员登录
|
||||
*
|
||||
* @param loginReqDTO 运营人员登录请求模型
|
||||
* @return token
|
||||
*/
|
||||
@Override
|
||||
public String login(LoginReqDTO loginReqDTO) {
|
||||
|
||||
Operator operator = operatorService.findByUsername(loginReqDTO.getUsername());
|
||||
if (operator == null) {
|
||||
throw new RequestForbiddenException("账号或密码错误,请重新输入");
|
||||
}
|
||||
// 比对密码
|
||||
if (!passwordEncoder.matches(loginReqDTO.getPassword(), operator.getPassword())) {
|
||||
throw new RequestForbiddenException("账号或密码错误,请重新输入");
|
||||
}
|
||||
return jwtTool.createToken(operator.getId(), operator.getName(), operator.getAvatar(), UserType.OPERATION);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jzo2o.common.enums.EnableStatusEnum;
|
||||
import com.jzo2o.common.expcetions.BadRequestException;
|
||||
import com.jzo2o.common.utils.BeanUtils;
|
||||
import com.jzo2o.foundations.mapper.OperatorMapper;
|
||||
import com.jzo2o.foundations.model.domain.Operator;
|
||||
import com.jzo2o.foundations.model.dto.OperatorAddDTO;
|
||||
import com.jzo2o.foundations.service.IOperatorService;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 运营人员 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2023-06-29
|
||||
*/
|
||||
@Service
|
||||
public class OperatorServiceImpl extends ServiceImpl<OperatorMapper, Operator> implements IOperatorService {
|
||||
|
||||
@Resource
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 根据名称查询运营人员
|
||||
*
|
||||
* @param username 名称
|
||||
* @return 运营人员
|
||||
*/
|
||||
@Override
|
||||
public Operator findByUsername(String username) {
|
||||
return lambdaQuery().eq(Operator::getUsername, username).one();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增运营人员
|
||||
*
|
||||
* @param operatorAddDTO 运营人员新增模型
|
||||
*/
|
||||
@Override
|
||||
public void add(OperatorAddDTO operatorAddDTO) {
|
||||
Integer operatorNumExists = lambdaQuery().eq(Operator::getUsername, operatorAddDTO.getUsername())
|
||||
.count();
|
||||
if (operatorNumExists > 0) {
|
||||
throw new BadRequestException("账号已经存在,请勿重复添加");
|
||||
}
|
||||
Operator operator = BeanUtils.copyBean(operatorAddDTO, Operator.class);
|
||||
operator.setPassword(passwordEncoder.encode(operatorAddDTO.getPassword()));
|
||||
operator.setStatus(EnableStatusEnum.ENABLE.getStatus());
|
||||
baseMapper.insert(operator);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,222 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jzo2o.api.foundations.dto.response.RegionSimpleResDTO;
|
||||
import com.jzo2o.common.expcetions.ForbiddenOperationException;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.constants.RedisConstants;
|
||||
import com.jzo2o.foundations.enums.FoundationStatusEnum;
|
||||
import com.jzo2o.foundations.mapper.CityDirectoryMapper;
|
||||
import com.jzo2o.foundations.mapper.RegionMapper;
|
||||
import com.jzo2o.foundations.model.domain.CityDirectory;
|
||||
import com.jzo2o.foundations.model.domain.Region;
|
||||
import com.jzo2o.foundations.model.dto.request.RegionPageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.RegionUpsertReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.RegionResDTO;
|
||||
import com.jzo2o.foundations.service.IConfigRegionService;
|
||||
import com.jzo2o.foundations.service.IRegionService;
|
||||
import com.jzo2o.mysql.utils.PageUtils;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 区域管理
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/17 16:50
|
||||
**/
|
||||
@Service
|
||||
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements IRegionService {
|
||||
@Resource
|
||||
private IConfigRegionService configRegionService;
|
||||
@Resource
|
||||
private CityDirectoryMapper cityDirectoryMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 区域新增
|
||||
*
|
||||
* @param regionUpsertReqDTO 插入更新区域
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(RegionUpsertReqDTO regionUpsertReqDTO) {
|
||||
//1.校验城市编码是否重复
|
||||
LambdaQueryWrapper<Region> queryWrapper = Wrappers.<Region>lambdaQuery().eq(Region::getCityCode, regionUpsertReqDTO.getCityCode());
|
||||
Integer count = baseMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
throw new ForbiddenOperationException("城市提交重复");
|
||||
}
|
||||
|
||||
//查询城市
|
||||
CityDirectory cityDirectory = cityDirectoryMapper.selectById(regionUpsertReqDTO.getCityCode());
|
||||
//查询城市的排序位
|
||||
int sotNum = cityDirectory.getSortNum();
|
||||
|
||||
//2.新增区域
|
||||
Region region = BeanUtil.toBean(regionUpsertReqDTO, Region.class);
|
||||
region.setSortNum(sotNum);
|
||||
baseMapper.insert(region);
|
||||
|
||||
//3.初始化区域配置
|
||||
configRegionService.init(region.getId(), region.getCityCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域修改
|
||||
*
|
||||
* @param id 区域id
|
||||
* @param managerName 负责人姓名
|
||||
* @param managerPhone 负责人电话
|
||||
*/
|
||||
@Override
|
||||
public void update(Long id, String managerName, String managerPhone) {
|
||||
Region region = new Region();
|
||||
region.setId(id);
|
||||
region.setManagerName(managerName);
|
||||
region.setManagerPhone(managerPhone);
|
||||
baseMapper.updateById(region);
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域删除
|
||||
*
|
||||
* @param id 区域id
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteById(Long id) {
|
||||
//区域信息
|
||||
Region region = baseMapper.selectById(id);
|
||||
//启用状态
|
||||
Integer activeStatus = region.getActiveStatus();
|
||||
//草稿状态方可删除
|
||||
if (!(FoundationStatusEnum.INIT.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("草稿状态方可删除");
|
||||
}
|
||||
//删除
|
||||
baseMapper.deleteById(id);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param regionPageQueryReqDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
@Override
|
||||
public PageResult<RegionResDTO> page(RegionPageQueryReqDTO regionPageQueryReqDTO) {
|
||||
Page<Region> page = PageUtils.parsePageQuery(regionPageQueryReqDTO, Region.class);
|
||||
Page<Region> serveTypePage = baseMapper.selectPage(page, new QueryWrapper<>());
|
||||
return PageUtils.toPage(serveTypePage, RegionResDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已开通服务区域列表
|
||||
*
|
||||
* @return 区域列表
|
||||
*/
|
||||
@Override
|
||||
public List<RegionSimpleResDTO> queryActiveRegionList() {
|
||||
LambdaQueryWrapper<Region> queryWrapper = Wrappers.<Region>lambdaQuery()
|
||||
.eq(Region::getActiveStatus, FoundationStatusEnum.ENABLE.getStatus())
|
||||
.orderByAsc(Region::getSortNum);
|
||||
List<Region> regionList = baseMapper.selectList(queryWrapper);
|
||||
return BeanUtil.copyToList(regionList, RegionSimpleResDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域启用
|
||||
*
|
||||
* @param id 区域id
|
||||
*/
|
||||
@Override
|
||||
@Caching(evict = {
|
||||
@CacheEvict(value = RedisConstants.CacheName.JZ_CACHE, key = "'ACTIVE_REGIONS'", beforeInvocation = true),
|
||||
@CacheEvict(value = RedisConstants.CacheName.SERVE_ICON, key = "#id", beforeInvocation = true),
|
||||
@CacheEvict(value = RedisConstants.CacheName.HOT_SERVE, key = "#id", beforeInvocation = true),
|
||||
@CacheEvict(value = RedisConstants.CacheName.SERVE_TYPE, key = "#id", beforeInvocation = true)
|
||||
})
|
||||
public void active(Long id) {
|
||||
//区域信息
|
||||
Region region = baseMapper.selectById(id);
|
||||
//启用状态
|
||||
Integer activeStatus = region.getActiveStatus();
|
||||
//草稿或禁用状态方可启用
|
||||
if (!(FoundationStatusEnum.INIT.getStatus() == activeStatus || FoundationStatusEnum.DISABLE.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("草稿或禁用状态方可启用");
|
||||
}
|
||||
//如果需要启用区域,需要校验该区域下是否有上架的服务
|
||||
//todo
|
||||
|
||||
//更新启用状态
|
||||
LambdaUpdateWrapper<Region> updateWrapper = Wrappers.<Region>lambdaUpdate()
|
||||
.eq(Region::getId, id)
|
||||
.set(Region::getActiveStatus, FoundationStatusEnum.ENABLE.getStatus());
|
||||
update(updateWrapper);
|
||||
|
||||
//3.如果是启用操作,刷新缓存:启用区域列表、首页图标、热门服务、服务类型
|
||||
// todo
|
||||
}
|
||||
|
||||
/**
|
||||
* 区域禁用
|
||||
*
|
||||
* @param id 区域id
|
||||
*/
|
||||
@Override
|
||||
@Caching(evict = {
|
||||
@CacheEvict(value = RedisConstants.CacheName.JZ_CACHE, key = "'ACTIVE_REGIONS'", beforeInvocation = true),
|
||||
@CacheEvict(value = RedisConstants.CacheName.SERVE_ICON, key = "#id", beforeInvocation = true),
|
||||
@CacheEvict(value = RedisConstants.CacheName.HOT_SERVE, key = "#id", beforeInvocation = true),
|
||||
@CacheEvict(value = RedisConstants.CacheName.SERVE_TYPE, key = "#id", beforeInvocation = true)
|
||||
})
|
||||
public void deactivate(Long id) {
|
||||
//区域信息
|
||||
Region region = baseMapper.selectById(id);
|
||||
//启用状态
|
||||
Integer activeStatus = region.getActiveStatus();
|
||||
//启用状态方可禁用
|
||||
if (!(FoundationStatusEnum.ENABLE.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("启用状态方可禁用");
|
||||
}
|
||||
|
||||
//1.如果禁用区域下有上架的服务则无法禁用
|
||||
//todo
|
||||
// int count = serveService.queryServeCountByRegionIdAndSaleStatus(id, FoundationStatusEnum.ENABLE.getStatus());
|
||||
// if (count > 0) {
|
||||
// throw new ForbiddenOperationException("区域下有上架的服务无法禁用");
|
||||
// }
|
||||
|
||||
//更新禁用状态
|
||||
LambdaUpdateWrapper<Region> updateWrapper = Wrappers.<Region>lambdaUpdate()
|
||||
.eq(Region::getId, id)
|
||||
.set(Region::getActiveStatus, FoundationStatusEnum.DISABLE.getStatus());
|
||||
update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已开通服务区域列表
|
||||
*
|
||||
* @return 区域简略列表
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(value = RedisConstants.CacheName.JZ_CACHE, key = "'ACTIVE_REGIONS'", cacheManager = RedisConstants.CacheManager.FOREVER)
|
||||
public List<RegionSimpleResDTO> queryActiveRegionListCache() {
|
||||
return queryActiveRegionList();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,256 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeItemSimpleResDTO;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeCategoryResDTO;
|
||||
import com.jzo2o.common.expcetions.ForbiddenOperationException;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.constants.RedisConstants;
|
||||
import com.jzo2o.foundations.enums.FoundationStatusEnum;
|
||||
import com.jzo2o.foundations.mapper.ServeItemMapper;
|
||||
import com.jzo2o.foundations.mapper.ServeTypeMapper;
|
||||
import com.jzo2o.foundations.model.domain.ServeItem;
|
||||
import com.jzo2o.foundations.model.domain.ServeType;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeItemPageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeItemUpsertReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeSyncUpdateReqDTO;
|
||||
import com.jzo2o.foundations.service.IServeItemService;
|
||||
import com.jzo2o.foundations.service.IServeSyncService;
|
||||
import com.jzo2o.mysql.utils.PageHelperUtils;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-03
|
||||
*/
|
||||
@Service
|
||||
public class ServeItemServiceImpl extends ServiceImpl<ServeItemMapper, ServeItem> implements IServeItemService {
|
||||
@Resource
|
||||
private IServeSyncService serveSyncService;
|
||||
|
||||
@Resource
|
||||
private ServeTypeMapper serveTypeMapper;
|
||||
|
||||
/**
|
||||
* 服务项新增
|
||||
*
|
||||
* @param serveItemUpsertReqDTO 新增服务项
|
||||
*/
|
||||
@Override
|
||||
public void add(ServeItemUpsertReqDTO serveItemUpsertReqDTO) {
|
||||
//校验名称是否重复
|
||||
LambdaQueryWrapper<ServeItem> queryWrapper = Wrappers.<ServeItem>lambdaQuery().eq(ServeItem::getName, serveItemUpsertReqDTO.getName());
|
||||
Integer count = baseMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
throw new ForbiddenOperationException("服务项名称不可重复");
|
||||
}
|
||||
|
||||
ServeItem serveItem = BeanUtil.toBean(serveItemUpsertReqDTO, ServeItem.class);
|
||||
serveItem.setCode(IdUtil.getSnowflakeNextIdStr());
|
||||
baseMapper.insert(serveItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务项修改
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @param serveItemUpsertReqDTO 插入更新服务项
|
||||
* @return 服务项
|
||||
*/
|
||||
@Override
|
||||
@CachePut(value = RedisConstants.CacheName.SERVE_ITEM, key = "#id", unless = "#result.activeStatus != 2", cacheManager = RedisConstants.CacheManager.ONE_DAY)
|
||||
public ServeItem update(Long id, ServeItemUpsertReqDTO serveItemUpsertReqDTO) {
|
||||
//1.更新服务项
|
||||
ServeItem serveItem = BeanUtil.toBean(serveItemUpsertReqDTO, ServeItem.class);
|
||||
serveItem.setId(id);
|
||||
baseMapper.updateById(serveItem);
|
||||
|
||||
//2.同步数据到es
|
||||
ServeSyncUpdateReqDTO serveSyncUpdateReqDTO = BeanUtil.toBean(serveItemUpsertReqDTO, ServeSyncUpdateReqDTO.class);
|
||||
serveSyncUpdateReqDTO.setServeItemName(serveItemUpsertReqDTO.getName());
|
||||
serveSyncUpdateReqDTO.setServeItemImg(serveItemUpsertReqDTO.getImg());
|
||||
serveSyncUpdateReqDTO.setServeItemIcon(serveItemUpsertReqDTO.getServeItemIcon());
|
||||
serveSyncUpdateReqDTO.setServeItemSortNum(serveItemUpsertReqDTO.getSortNum());
|
||||
serveSyncService.updateByServeItemId(id, serveSyncUpdateReqDTO);
|
||||
|
||||
//用于更新缓存
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启用服务项
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@CachePut(value = RedisConstants.CacheName.SERVE_ITEM, key = "#id", cacheManager = RedisConstants.CacheManager.ONE_DAY)
|
||||
public ServeItem activate(Long id) {
|
||||
|
||||
//查询服务项
|
||||
ServeItem serveItem = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isNull(serveItem)) {
|
||||
throw new ForbiddenOperationException("服务项不存在");
|
||||
}
|
||||
//启用状态
|
||||
Integer activeStatus = serveItem.getActiveStatus();
|
||||
//草稿或禁用状态方可启用
|
||||
if (!(FoundationStatusEnum.INIT.getStatus() == activeStatus || FoundationStatusEnum.DISABLE.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("草稿或禁用状态方可启用");
|
||||
}
|
||||
//服务类型id
|
||||
Long serveTypeId = serveItem.getServeTypeId();
|
||||
//服务类型信息
|
||||
ServeType serveType = serveTypeMapper.selectById(serveTypeId);
|
||||
if (ObjectUtil.isNull(serveType)) {
|
||||
throw new ForbiddenOperationException("所属服务类型不存在");
|
||||
}
|
||||
//所属服务类型为启用状态时方可启用
|
||||
if (!(FoundationStatusEnum.ENABLE.getStatus() == serveType.getActiveStatus())) {
|
||||
throw new ForbiddenOperationException("所属服务类型为启用状态时方可启用");
|
||||
}
|
||||
|
||||
if (ObjectUtil.equal(FoundationStatusEnum.DISABLE.getStatus(), serveType.getActiveStatus())) {
|
||||
throw new ForbiddenOperationException("服务所属的服务类型已禁用,启用后方可操作。");
|
||||
}
|
||||
//更新启用状态
|
||||
LambdaUpdateWrapper<ServeItem> updateWrapper = Wrappers.<ServeItem>lambdaUpdate().eq(ServeItem::getId, id).set(ServeItem::getActiveStatus, FoundationStatusEnum.ENABLE.getStatus());
|
||||
update(updateWrapper);
|
||||
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用服务项
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@CacheEvict(value = RedisConstants.CacheName.SERVE_ITEM, key = "#id", beforeInvocation = true)
|
||||
public void deactivate(Long id) {
|
||||
//查询服务项
|
||||
ServeItem serveItem = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isNull(serveItem)) {
|
||||
throw new ForbiddenOperationException("服务项不存在");
|
||||
}
|
||||
//启用状态
|
||||
Integer activeStatus = serveItem.getActiveStatus();
|
||||
//启用状态方可禁用
|
||||
if (!(FoundationStatusEnum.ENABLE.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("启用状态方可禁用");
|
||||
}
|
||||
|
||||
//有区域在使用该服务将无法禁用(存在关联的区域服务且状态为上架表示有区域在使用该服务项)
|
||||
//todo
|
||||
|
||||
//更新禁用状态
|
||||
LambdaUpdateWrapper<ServeItem> updateWrapper = Wrappers.<ServeItem>lambdaUpdate().eq(ServeItem::getId, id).set(ServeItem::getActiveStatus, FoundationStatusEnum.DISABLE.getStatus());
|
||||
update(updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 服务项删除
|
||||
*
|
||||
* @param id 服务项id
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteById(Long id) {
|
||||
ServeItem serveItem = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isNull(serveItem)) {
|
||||
throw new ForbiddenOperationException("服务项不存在");
|
||||
}
|
||||
//启用状态
|
||||
Integer activeStatus = serveItem.getActiveStatus();
|
||||
|
||||
//1.删除校验:只有草稿状态方可删除
|
||||
if (!(FoundationStatusEnum.INIT.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("只有草稿状态方可删除");
|
||||
}
|
||||
|
||||
//2.根据id删除
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据服务类型id查询关联的启用状态服务项数量
|
||||
*
|
||||
* @param serveTypeId 服务类型id
|
||||
* @return 服务项数量
|
||||
*/
|
||||
@Override
|
||||
public int queryActiveServeItemCountByServeTypeId(Long serveTypeId) {
|
||||
LambdaQueryWrapper<ServeItem> queryWrapper = Wrappers.<ServeItem>lambdaQuery()
|
||||
.eq(ServeItem::getServeTypeId, serveTypeId)
|
||||
.eq(ServeItem::getActiveStatus, FoundationStatusEnum.ENABLE.getStatus());
|
||||
return baseMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param serveItemPageQueryReqDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
@Override
|
||||
public PageResult<ServeItemResDTO> page(ServeItemPageQueryReqDTO serveItemPageQueryReqDTO) {
|
||||
return PageHelperUtils.selectPage(serveItemPageQueryReqDTO,
|
||||
() -> baseMapper.queryList(serveItemPageQueryReqDTO.getServeTypeId(), serveItemPageQueryReqDTO.getName(), serveItemPageQueryReqDTO.getActiveStatus()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 服务项id
|
||||
* @return 服务项详细信息
|
||||
*/
|
||||
@Override
|
||||
public ServeItemResDTO queryServeItemAndTypeById(Long id) {
|
||||
return baseMapper.queryServeItemAndTypeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id列表批量查询
|
||||
*
|
||||
* @param ids 服务项id列表
|
||||
* @return 服务项简略列表
|
||||
*/
|
||||
@Override
|
||||
public List<ServeItemSimpleResDTO> queryServeItemListByIds(List<Long> ids) {
|
||||
List<ServeItem> list = lambdaQuery().in(ServeItem::getId, ids).orderByAsc(ServeItem::getCreateTime).list();
|
||||
return BeanUtil.copyToList(list, ServeItemSimpleResDTO.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询启用状态的服务项目录
|
||||
*
|
||||
* @return 服务项目录
|
||||
*/
|
||||
@Override
|
||||
public List<ServeTypeCategoryResDTO> queryActiveServeItemCategory() {
|
||||
return baseMapper.queryActiveServeItemCategory();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jzo2o.foundations.mapper.ServeSyncMapper;
|
||||
import com.jzo2o.foundations.model.domain.ServeSync;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeSyncUpdateReqDTO;
|
||||
import com.jzo2o.foundations.service.IServeSyncService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务同步表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author itcast
|
||||
* @since 2023-07-10
|
||||
*/
|
||||
@Service
|
||||
public class ServeSyncServiceImpl extends ServiceImpl<ServeSyncMapper, ServeSync> implements IServeSyncService {
|
||||
/**
|
||||
* 根据服务项id更新
|
||||
*
|
||||
* @param serveItemId 服务项id
|
||||
* @param serveSyncUpdateReqDTO 服务同步更新数据
|
||||
*/
|
||||
@Override
|
||||
public void updateByServeItemId(Long serveItemId, ServeSyncUpdateReqDTO serveSyncUpdateReqDTO) {
|
||||
LambdaUpdateWrapper<ServeSync> updateWrapper = Wrappers.<ServeSync>lambdaUpdate()
|
||||
.eq(ServeSync::getServeItemId, serveItemId)
|
||||
.set(ServeSync::getServeItemName, serveSyncUpdateReqDTO.getServeItemName())
|
||||
.set(ServeSync::getServeItemSortNum, serveSyncUpdateReqDTO.getServeItemSortNum())
|
||||
.set(ServeSync::getUnit, serveSyncUpdateReqDTO.getUnit())
|
||||
.set(ServeSync::getServeItemImg, serveSyncUpdateReqDTO.getServeItemImg())
|
||||
.set(ServeSync::getServeItemIcon, serveSyncUpdateReqDTO.getServeItemIcon());
|
||||
super.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据服务类型id更新
|
||||
*
|
||||
* @param serveTypeId 服务类型id
|
||||
* @param serveSyncUpdateReqDTO 服务同步更新数据
|
||||
*/
|
||||
@Override
|
||||
public void updateByServeTypeId(Long serveTypeId, ServeSyncUpdateReqDTO serveSyncUpdateReqDTO) {
|
||||
LambdaUpdateWrapper<ServeSync> updateWrapper = Wrappers.<ServeSync>lambdaUpdate()
|
||||
.eq(ServeSync::getServeTypeId, serveTypeId)
|
||||
.set(ServeSync::getServeTypeName, serveSyncUpdateReqDTO.getServeTypeName())
|
||||
.set(ServeSync::getServeTypeImg, serveSyncUpdateReqDTO.getServeTypeImg())
|
||||
.set(ServeSync::getServeTypeIcon, serveSyncUpdateReqDTO.getServeTypeIcon())
|
||||
.set(ServeSync::getServeTypeSortNum, serveSyncUpdateReqDTO.getServeTypeSortNum());
|
||||
super.update(updateWrapper);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,195 @@
|
||||
package com.jzo2o.foundations.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jzo2o.api.foundations.dto.response.ServeTypeSimpleResDTO;
|
||||
import com.jzo2o.common.expcetions.ForbiddenOperationException;
|
||||
import com.jzo2o.common.model.PageResult;
|
||||
import com.jzo2o.foundations.enums.FoundationStatusEnum;
|
||||
import com.jzo2o.foundations.mapper.ServeTypeMapper;
|
||||
import com.jzo2o.foundations.model.domain.ServeType;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeSyncUpdateReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeTypePageQueryReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.request.ServeTypeUpsertReqDTO;
|
||||
import com.jzo2o.foundations.model.dto.response.ServeTypeResDTO;
|
||||
import com.jzo2o.foundations.service.IServeItemService;
|
||||
import com.jzo2o.foundations.service.IServeSyncService;
|
||||
import com.jzo2o.foundations.service.IServeTypeService;
|
||||
import com.jzo2o.mysql.utils.PageUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务类型
|
||||
*
|
||||
* @author itcast
|
||||
* @create 2023/7/26 14:18
|
||||
**/
|
||||
@Service
|
||||
public class ServeTypeServiceImpl extends ServiceImpl<ServeTypeMapper, ServeType> implements IServeTypeService {
|
||||
@Resource
|
||||
private IServeItemService serveItemService;
|
||||
@Resource
|
||||
private IServeSyncService serveSyncService;
|
||||
|
||||
/**
|
||||
* 服务类型新增
|
||||
*
|
||||
* @param serveTypeUpsertReqDTO 插入更新服务类型
|
||||
*/
|
||||
@Override
|
||||
public void add(ServeTypeUpsertReqDTO serveTypeUpsertReqDTO) {
|
||||
//校验名称是否重复
|
||||
LambdaQueryWrapper<ServeType> queryWrapper = Wrappers.<ServeType>lambdaQuery().eq(ServeType::getName, serveTypeUpsertReqDTO.getName());
|
||||
Integer count = baseMapper.selectCount(queryWrapper);
|
||||
if(count>0){
|
||||
throw new ForbiddenOperationException("服务类型名称不可重复");
|
||||
}
|
||||
|
||||
//新增服务类型
|
||||
ServeType serveType = BeanUtil.toBean(serveTypeUpsertReqDTO, ServeType.class);
|
||||
serveType.setCode(IdUtil.getSnowflakeNextIdStr());
|
||||
baseMapper.insert(serveType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务类型修改
|
||||
*
|
||||
* @param id 服务类型id
|
||||
* @param serveTypeUpsertReqDTO 插入更新服务类型
|
||||
*/
|
||||
@Override
|
||||
public void update(Long id, ServeTypeUpsertReqDTO serveTypeUpsertReqDTO) {
|
||||
//1.更新服务类型
|
||||
ServeType serveType = BeanUtil.toBean(serveTypeUpsertReqDTO, ServeType.class);
|
||||
serveType.setId(id);
|
||||
baseMapper.updateById(serveType);
|
||||
|
||||
//2.同步数据到es
|
||||
ServeSyncUpdateReqDTO serveSyncUpdateReqDTO = new ServeSyncUpdateReqDTO();
|
||||
serveSyncUpdateReqDTO.setServeTypeName(serveTypeUpsertReqDTO.getName());
|
||||
serveSyncUpdateReqDTO.setServeTypeImg(serveTypeUpsertReqDTO.getImg());
|
||||
serveSyncUpdateReqDTO.setServeTypeIcon(serveTypeUpsertReqDTO.getServeTypeIcon());
|
||||
serveSyncUpdateReqDTO.setServeTypeSortNum(serveTypeUpsertReqDTO.getSortNum());
|
||||
serveSyncService.updateByServeTypeId(id, serveSyncUpdateReqDTO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 服务类型启用/禁用
|
||||
*
|
||||
* @param id 服务类型id
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void activate(Long id) {
|
||||
//查询服务类型
|
||||
ServeType serveType = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isNull(serveType)) {
|
||||
throw new ForbiddenOperationException("服务类型不存在");
|
||||
}
|
||||
//启用状态
|
||||
Integer activeStatus = serveType.getActiveStatus();
|
||||
//草稿或禁用状态方可启用
|
||||
if (!(FoundationStatusEnum.INIT.getStatus() == activeStatus || FoundationStatusEnum.DISABLE.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("草稿或禁用状态方可启用");
|
||||
}
|
||||
//更新状态为启用
|
||||
LambdaUpdateWrapper<ServeType> updateWrapper = Wrappers.<ServeType>lambdaUpdate()
|
||||
.eq(ServeType::getId, id)
|
||||
.set(ServeType::getActiveStatus, FoundationStatusEnum.ENABLE.getStatus());
|
||||
update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务类型启用/禁用
|
||||
*
|
||||
* @param id 服务类型id
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void deactivate(Long id) {
|
||||
//查询服务类型
|
||||
ServeType serveType = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isNull(serveType)) {
|
||||
throw new ForbiddenOperationException("服务类型不存在");
|
||||
}
|
||||
//启用状态
|
||||
Integer activeStatus = serveType.getActiveStatus();
|
||||
//启用状态方可禁用
|
||||
if (!(FoundationStatusEnum.ENABLE.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("启用状态方可禁用");
|
||||
}
|
||||
//下属服务项全部为非启用方可禁用
|
||||
int count = serveItemService.queryActiveServeItemCountByServeTypeId(id);
|
||||
if (count > 0) {
|
||||
throw new ForbiddenOperationException("禁用失败,该服务类型下有启用状态的服务项");
|
||||
}
|
||||
//更新状态为禁用
|
||||
LambdaUpdateWrapper<ServeType> updateWrapper = Wrappers.<ServeType>lambdaUpdate()
|
||||
.eq(ServeType::getId, id)
|
||||
.set(ServeType::getActiveStatus, FoundationStatusEnum.DISABLE.getStatus());
|
||||
update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除服务类型
|
||||
*
|
||||
* @param id 服务类型id
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteById(Long id) {
|
||||
//查询服务类型
|
||||
ServeType serveType = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isNull(serveType)) {
|
||||
throw new ForbiddenOperationException("服务类型不存在");
|
||||
}
|
||||
//启用状态
|
||||
Integer activeStatus = serveType.getActiveStatus();
|
||||
//草稿状态方可删除
|
||||
if (!(FoundationStatusEnum.INIT.getStatus() == activeStatus)) {
|
||||
throw new ForbiddenOperationException("草稿状态方可删除");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param serveTypePageQueryReqDTO 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
@Override
|
||||
public PageResult<ServeTypeResDTO> page(ServeTypePageQueryReqDTO serveTypePageQueryReqDTO) {
|
||||
Page<ServeType> page = PageUtils.parsePageQuery(serveTypePageQueryReqDTO, ServeType.class);
|
||||
Page<ServeType> serveTypePage = baseMapper.selectPage(page, new QueryWrapper<>());
|
||||
return PageUtils.toPage(serveTypePage, ServeTypeResDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据活动状态查询简略列表
|
||||
*
|
||||
* @param activeStatus 活动状态,0:草稿,1:禁用,:2:启用
|
||||
* @return 服务类型列表
|
||||
*/
|
||||
@Override
|
||||
public List<ServeTypeSimpleResDTO> queryServeTypeListByActiveStatus(Integer activeStatus) {
|
||||
LambdaQueryWrapper<ServeType> queryWrapper = Wrappers.<ServeType>lambdaQuery()
|
||||
.eq(ObjectUtil.isNotEmpty(activeStatus), ServeType::getActiveStatus, activeStatus)
|
||||
.orderByAsc(ServeType::getSortNum)
|
||||
.orderByDesc(ServeType::getUpdateTime);
|
||||
List<ServeType> serveTypeList = baseMapper.selectList(queryWrapper);
|
||||
return BeanUtil.copyToList(serveTypeList, ServeTypeSimpleResDTO.class);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: nacos
|
||||
password: nacos
|
||||
server-addr: 192.168.101.68:8848
|
||||
config:
|
||||
namespace: 75a593f5-33e6-4c65-b2a0-18c403d20f63
|
||||
file-extension: yaml
|
||||
discovery:
|
||||
namespace: 75a593f5-33e6-4c65-b2a0-18c403d20f63
|
||||
ip: ${ACCESS_IP:}
|
||||
|
||||
|
||||
################# 日志配置 #################
|
||||
logging:
|
||||
level:
|
||||
com.jzo2o: debug
|
||||
@ -0,0 +1,14 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
server-addr: ${NACOS_ADDR}
|
||||
config:
|
||||
namespace: ${NACOS_NAMESPACE}
|
||||
file-extension: yaml
|
||||
discovery:
|
||||
namespace: ${NACOS_NAMESPACE}
|
||||
logging:
|
||||
level:
|
||||
com.jzo2o: debug
|
||||
@ -0,0 +1,14 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
server-addr: ${NACOS_ADDR}
|
||||
config:
|
||||
namespace: ${NACOS_NAMESPACE}
|
||||
file-extension: yaml
|
||||
discovery:
|
||||
namespace: ${NACOS_NAMESPACE}
|
||||
logging:
|
||||
level:
|
||||
com.jzo2o: debug
|
||||
@ -0,0 +1,76 @@
|
||||
################# 服务器配置 #################
|
||||
server:
|
||||
port: 11509
|
||||
undertow:
|
||||
accesslog:
|
||||
enabled: true
|
||||
pattern: "%t %a "%r" %s (%D ms)"
|
||||
dir: /data/logs/undertow/${spring.application.name}/access-logs/
|
||||
servlet:
|
||||
context-path: /foundations
|
||||
|
||||
################# spring公共配置 #################
|
||||
spring:
|
||||
mvc:
|
||||
path-match:
|
||||
matching-strategy: ant_path_matcher
|
||||
format:
|
||||
date: yyyy-MM-dd HH:mm:ss
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
profiles:
|
||||
active: dev
|
||||
application:
|
||||
name: jzo2o-foundations
|
||||
main:
|
||||
# 支持循环依赖注入
|
||||
allow-circular-references: true
|
||||
# bean名相同覆盖
|
||||
allow-bean-definition-overriding: true
|
||||
cloud:
|
||||
nacos:
|
||||
username: ${NACOS_USERNAME}
|
||||
password: ${NACOS_PASSWORD}
|
||||
server-addr: ${NACOS_ADDR}
|
||||
discovery:
|
||||
namespace: ${NACOS_NAMESPACE}
|
||||
config:
|
||||
namespace: ${NACOS_NAMESPACE}
|
||||
file-extension: yaml
|
||||
shared-configs: # 共享配置
|
||||
- data-id: shared-redis-cluster.yaml # 共享redis配置
|
||||
refresh: false
|
||||
# - data-id: shared-xxl-job.yaml # xxl-job配置
|
||||
# refresh: false
|
||||
# - data-id: shared-rabbitmq.yaml # rabbitmq配置
|
||||
# refresh: false
|
||||
# - data-id: shared-es.yaml # rabbitmq配置
|
||||
# refresh: false
|
||||
- data-id: shared-mysql.yaml # mysql配置
|
||||
refresh: false
|
||||
|
||||
################# 项目独有配置 #################
|
||||
mysql:
|
||||
db-name: jzo2o-foundations
|
||||
mybatis:
|
||||
mapper-locations: mapper/*.xml
|
||||
type-aliases-package: com.jzo2o.foundations.mapper
|
||||
swagger:
|
||||
enable: true
|
||||
package-path: com.jzo2o.foundations.controller
|
||||
title: 家政服务-运营基础服务接口文档
|
||||
description: 用于服务、区域进行管理
|
||||
contact-name: 传智教育·研究院
|
||||
contact-url: http://www.itcast.cn/
|
||||
contact-email: yjy@itcast.cn
|
||||
version: v1.0
|
||||
|
||||
|
||||
################# 日志配置 #################
|
||||
logging:
|
||||
level:
|
||||
com.jzo2o: debug
|
||||
org.apache.http: info #es请求日志
|
||||
feign:
|
||||
enable: true
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.CityDirectoryMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.ConfigRegionMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.OperatorMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.jzo2o.foundations.model.domain.Operator">
|
||||
<id column="id" property="id" />
|
||||
<result column="username" property="username" />
|
||||
<result column="avatar" property="avatar" />
|
||||
<result column="name" property="name" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="password" property="password" />
|
||||
<result column="status" property="status" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="is_deleted" property="isDeleted" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.RegionMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.ServeItemMapper">
|
||||
|
||||
<select id="queryList" resultType="com.jzo2o.api.foundations.dto.response.ServeItemResDTO">
|
||||
SELECT
|
||||
item.id,
|
||||
item.code,
|
||||
item.serve_type_id,
|
||||
type.name AS serve_type_name,
|
||||
item.name,
|
||||
item.serve_item_icon,
|
||||
item.img,
|
||||
item.unit,
|
||||
item.description,
|
||||
item.detail_img,
|
||||
item.reference_price,
|
||||
item.sort_num,
|
||||
item.active_status,
|
||||
item.create_time,
|
||||
item.update_time
|
||||
FROM
|
||||
serve_item AS item
|
||||
LEFT JOIN serve_type AS type ON item.serve_type_id = type.id
|
||||
<where>
|
||||
<if test="serveTypeId != null">
|
||||
and item.serve_type_id=#{serveTypeId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and item.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="activeStatus != null">
|
||||
and item.active_status=#{activeStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryServeItemAndTypeById" resultType="com.jzo2o.api.foundations.dto.response.ServeItemResDTO">
|
||||
SELECT
|
||||
item.id,
|
||||
item.code,
|
||||
item.serve_type_id,
|
||||
type.name AS serve_type_name,
|
||||
item.name,
|
||||
item.serve_item_icon,
|
||||
item.img,
|
||||
item.unit,
|
||||
item.description,
|
||||
item.detail_img,
|
||||
item.reference_price,
|
||||
item.sort_num,
|
||||
item.active_status,
|
||||
item.create_time,
|
||||
item.update_time
|
||||
FROM
|
||||
serve_item AS item
|
||||
LEFT JOIN serve_type AS type ON item.serve_type_id = type.id
|
||||
WHERE
|
||||
item.id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="queryActiveServeItemCategory" resultMap="ServeItemCategoryMap">
|
||||
SELECT
|
||||
type.id AS serve_type_id,
|
||||
type.`name` AS serve_type_name,
|
||||
item.id AS serve_item_id,
|
||||
item.`name` AS serve_item_name
|
||||
FROM
|
||||
serve_item AS item
|
||||
LEFT JOIN serve_type AS type ON item.serve_type_id = type.id
|
||||
WHERE
|
||||
item.active_status = 2
|
||||
ORDER BY
|
||||
type.sort_num,
|
||||
item.sort_num
|
||||
</select>
|
||||
|
||||
<!--手动的映射-->
|
||||
<resultMap id="ServeItemCategoryMap" type="com.jzo2o.api.foundations.dto.response.ServeTypeCategoryResDTO">
|
||||
<!--id映射主键字段-->
|
||||
<id column="serve_type_id" property="serveTypeId"></id>
|
||||
<!--result映射普通字段-->
|
||||
<result column="serve_type_name" property="serveTypeName"></result>
|
||||
|
||||
<!--column 数据库中的字段名-->
|
||||
<!--property 实体类中对应的属性 该关键字可以省略... -->
|
||||
<!--ofType 是javaType中的单个对象类型-->
|
||||
<collection property="serveItemList" ofType="com.jzo2o.api.foundations.dto.ServeItemSimpleDTO">
|
||||
<id column="serve_item_id" property="serveItemId"></id>
|
||||
<result column="serve_item_name" property="serveItemName"></result>
|
||||
</collection>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.ServeMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.ServeSyncMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jzo2o.foundations.mapper.ServeTypeMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user