mirror of
https://github.com/abcv7/sfbx-cloud.git
synced 2026-08-16 19:49:49 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
FROM openjdk:11-jdk
|
||||
LABEL maintainer="研究院研发组 <research@itcast.cn>"
|
||||
|
||||
# 时区修改为东八区
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
WORKDIR /insurance-app
|
||||
ARG PACKAGE_PATH=./target/insurance-app.jar
|
||||
ADD ${PACKAGE_PATH:-./} insurance-app.jar
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENV JAVA_OPTS="\
|
||||
-server \
|
||||
-Xms256m \
|
||||
-Xmx512m \
|
||||
-XX:MetaspaceSize=256m \
|
||||
-XX:MaxMetaspaceSize=512m"
|
||||
ENTRYPOINT ["sh","-c","java -Djava.security.egd=file:/dev/./urandom -jar $JAVA_OPTS insurance-app.jar"]
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>sfbx-insurance</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<!--保险:小程序管理web-->
|
||||
<artifactId>insurance-app</artifactId>
|
||||
<name>insurance-app</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>framework-task-executor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>framework-web</artifactId>
|
||||
</dependency>
|
||||
<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>com.itheima.sfbx</groupId>
|
||||
<artifactId>framework-knife4j-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itheima.sfbx</groupId>
|
||||
<artifactId>insurance-service</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.yml</include>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.yaml</include>
|
||||
<include>**/*.txt</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<finalName>insurance-app</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.itheima.sfbx.insurance;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 小程序端对于保险的启动类
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = "com.itheima.sfbx")
|
||||
public class InsuranceAppStart {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(InsuranceAppStart.class);
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.itheima.sfbx.insurance.binding;
|
||||
|
||||
import com.itheima.sfbx.framework.rabbitmq.source.FileSource;
|
||||
import com.itheima.sfbx.framework.rabbitmq.source.WarrantySource;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
|
||||
/**
|
||||
* @ClassName Binding.java
|
||||
* @Description 绑定文件发送者声明
|
||||
*/
|
||||
@EnableBinding({WarrantySource.class})
|
||||
public class SourceBinding {
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.dto.security.UserVO;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.framework.commons.utils.SubjectContent;
|
||||
import com.itheima.sfbx.insurance.dto.*;
|
||||
import com.itheima.sfbx.insurance.service.IBrowsingHistoryService;
|
||||
import com.itheima.sfbx.insurance.service.ISearchRecordService;
|
||||
import com.itheima.sfbx.insurance.service.ISelfSelectionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName AppSelfSelectionController.java
|
||||
* @Description 自选
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "自选")
|
||||
@RestController
|
||||
@RequestMapping("app-self-selection")
|
||||
public class AppSelfSelectionController {
|
||||
|
||||
@Autowired
|
||||
private ISelfSelectionService selfSelectionService;
|
||||
|
||||
@Autowired
|
||||
private IBrowsingHistoryService browsingHistoryService;
|
||||
|
||||
@Autowired
|
||||
private ISearchRecordService searchRecordService;
|
||||
|
||||
|
||||
/***
|
||||
* @description 添加自选
|
||||
* @param selfSelectionVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("selection-insure")
|
||||
@ApiOperation(value = "添加自选保险",notes = "添加自选保险")
|
||||
public ResponseResult<SelfSelectionVO> selfSelectionInsuer(@RequestBody SelfSelectionVO selfSelectionVO){
|
||||
SelfSelectionVO res = selfSelectionService.save(selfSelectionVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 删除自选
|
||||
* @param selfSelectionVO
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("selection-insure")
|
||||
@ApiOperation(value = "删除自选保险",notes = "删除自选保险")
|
||||
public ResponseResult<Boolean> delSelectionInsuer(@RequestBody SelfSelectionVO selfSelectionVO){
|
||||
Boolean flag = selfSelectionService.delete(selfSelectionVO.getCheckedIds());
|
||||
return ResponseResultBuild.successBuild(flag);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 我的自选
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("find-self-selection-insure")
|
||||
@ApiOperation(value = "我的自选",notes = "我的自选")
|
||||
public ResponseResult<List<InsuranceTypeInfoVO>> findSelfSelectionInsure(){
|
||||
List<InsuranceTypeInfoVO> res = selfSelectionService.findMySelection(SubjectContent.getUserVO());
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* @description 最近浏览
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("find-history")
|
||||
@ApiOperation(value = "最近的浏览",notes = "查询最近的浏览记录")
|
||||
public ResponseResult<List<InsuranceVO>> findMyHistory(){
|
||||
UserVO userVO = SubjectContent.getUserVO();
|
||||
List<InsuranceVO> res = searchRecordService.findMyHistory(userVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.constant.basic.SuperConstant;
|
||||
import com.itheima.sfbx.framework.commons.constant.insure.InsureConstant;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.insurance.dto.CombinationInsuranceVO;
|
||||
import com.itheima.sfbx.insurance.dto.CombinationVO;
|
||||
import com.itheima.sfbx.insurance.dto.CombinationDetailVO;
|
||||
import com.itheima.sfbx.insurance.dto.InsuranceVO;
|
||||
import com.itheima.sfbx.insurance.service.ICombinationInsuranceService;
|
||||
import com.itheima.sfbx.insurance.service.ICombinationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName IndexController.java
|
||||
* @Description 保险方案详情
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "保险方案详情")
|
||||
@RestController
|
||||
@RequestMapping("combination-info")
|
||||
public class CombinationInfoController {
|
||||
|
||||
@Autowired
|
||||
private ICombinationInsuranceService combinationService;
|
||||
|
||||
/**
|
||||
* 首页保险方案查询
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("find-combination-index")
|
||||
@ApiOperation(value = "首页保险方案",notes = "首页保险方案")
|
||||
public ResponseResult<Page<CombinationInsuranceVO>> findCombinationIndex() {
|
||||
return ResponseResultBuild.successBuild(combinationService.findPage(CombinationInsuranceVO.builder().dataState(SuperConstant.DATA_STATE_0).build(),0,5));
|
||||
}
|
||||
|
||||
/**
|
||||
*保险方案详情页-->tab_combination-->tab_combination_insurance-->tab_insurance-->tab_insurance_plan-->tab_plan_safeguard
|
||||
*/
|
||||
@PostMapping("find-combination/{id}")
|
||||
@ApiOperation(value = "保险方案详情",notes = "保险方案详情")
|
||||
@ApiImplicitParam(name = "id",value = "保险方案id",required = true,dataType = "String")
|
||||
public ResponseResult<CombinationInsuranceVO> findCombination(@PathVariable("id") String id) {
|
||||
return ResponseResultBuild.successBuild(combinationService.findById(id));
|
||||
}
|
||||
}
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.constant.basic.SuperConstant;
|
||||
import com.itheima.sfbx.framework.commons.constant.category.CategoryConstant;
|
||||
import com.itheima.sfbx.framework.commons.constant.insure.InsureConstant;
|
||||
import com.itheima.sfbx.framework.commons.dto.basic.TreeVO;
|
||||
import com.itheima.sfbx.framework.commons.utils.EmptyUtil;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.insurance.constant.InsuranceConstant;
|
||||
import com.itheima.sfbx.insurance.dto.BannerVO;
|
||||
import com.itheima.sfbx.insurance.dto.CategoryVO;
|
||||
import com.itheima.sfbx.insurance.dto.CombinationVO;
|
||||
import com.itheima.sfbx.insurance.dto.InsuranceVO;
|
||||
import com.itheima.sfbx.insurance.service.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName IndexController.java
|
||||
* @Description 销售平台首页
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "销售平台首页")
|
||||
@RestController
|
||||
@RequestMapping("index")
|
||||
public class IndexController {
|
||||
|
||||
@Autowired
|
||||
private ICategoryService categoryService;
|
||||
|
||||
@Autowired
|
||||
private IInsuranceService insuranceService;
|
||||
|
||||
@Autowired
|
||||
private IInsurancePlanService iInsurancePlanService;
|
||||
|
||||
@Autowired
|
||||
private ICombinationService combinationService;
|
||||
|
||||
@Autowired
|
||||
IBannerService bannerService;
|
||||
|
||||
/**
|
||||
* @Description 分类树形
|
||||
* @param categoryVO 分类对象
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("tree")
|
||||
@ApiOperation(value = "分类树形",notes = "分类树形")
|
||||
@ApiImplicitParam(name = "categoryVO",value = "分类对象",required = false,dataType = "CategoryVO")
|
||||
@ApiOperationSupport(includeParameters = {"categoryVO.parentCategoryNo","categoryVO.categoryType","categoryVO.checkedCategoryNos"})
|
||||
public ResponseResult<TreeVO> categoryTreeVO(@RequestBody CategoryVO categoryVO) {
|
||||
TreeVO treeVO = categoryService.categoryTreeVO(categoryVO.getParentCategoryNo(), categoryVO.getCategoryType(),categoryVO.getCheckedCategoryNos());
|
||||
return ResponseResultBuild.successBuild(treeVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的推荐分类
|
||||
*
|
||||
* @return List<CategoryVO>
|
||||
* @description 获取首页分类-->tab_category-->category_type:1
|
||||
*/
|
||||
@ApiOperation(value = "产品分类", notes = "产品分类")
|
||||
@PostMapping("/find-index-category-product")
|
||||
public ResponseResult<List<CategoryVO>> findIndexCategory() {
|
||||
List<Long> nodeFloors = Lists.newArrayList(2L);
|
||||
CategoryVO categoryVO = CategoryVO.builder().
|
||||
categoryType(CategoryConstant.PRODUCT_TYPE).
|
||||
dataState(CategoryConstant.DATA_STATE_0).
|
||||
showIndex(CategoryConstant.SHOW_INDEX_STATE_0).
|
||||
build();
|
||||
categoryVO.setNodeFloors(nodeFloors);
|
||||
return ResponseResultBuild.successBuild(categoryService.findList(categoryVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 热点保险推荐-找到每个分类下售卖的最好的一个保险
|
||||
* 热点保险推荐-->tab_insurance-->show_index:0并且是上架且有效状态--->附件调用fegin-->file
|
||||
* @return: Page<InsureVO>
|
||||
*/
|
||||
@PostMapping("find-hotspot-insurePage")
|
||||
@ApiOperation(value = "热点保险推荐", notes = "APP首页热点保险推荐分页")
|
||||
public ResponseResult<List<InsuranceVO>> findHotspotInsurePage() {
|
||||
InsuranceVO insuranceVO = InsuranceVO.builder().
|
||||
showIndex(InsureConstant.SHOW_INDEX_STATE_0).
|
||||
dataState(InsureConstant.DATA_STATE_0).
|
||||
build();
|
||||
Page<InsuranceVO> page = insuranceService.findPage(insuranceVO, 0, 10);
|
||||
return ResponseResultBuild.successBuild(page.getRecords());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的产品分类
|
||||
* 产品分类-->tab_category-->category_type:1
|
||||
*/
|
||||
@ApiOperation(value = "推荐分类", notes = "推荐分类")
|
||||
@PostMapping("/find-index-category-recommend")
|
||||
public ResponseResult<List<CategoryVO>> findCategoryRecommend() {
|
||||
CategoryVO categoryVO = CategoryVO.builder().
|
||||
categoryType(CategoryConstant.RECOMMEND_TYPE).
|
||||
dataState(CategoryConstant.DATA_STATE_0).
|
||||
showIndex(CategoryConstant.SHOW_INDEX_STATE_0).
|
||||
build();
|
||||
return ResponseResultBuild.successBuild(categoryService.findList(categoryVO));
|
||||
}
|
||||
|
||||
//推荐保险列表-->tab_insurance[tab_insurance_plan价格排序]-->optimization升序再按创建时间--->附件调用fegin-->file
|
||||
|
||||
/**
|
||||
* @description 推荐保险列表-
|
||||
* 推荐保险列表-->tab_insurance[tab_insurance_plan价格排序]-->optimization升序再按创建时间--->附件调用fegin-->file
|
||||
* @return: Page<InsureVO>
|
||||
*/
|
||||
@PostMapping("recommend-insure-list")
|
||||
@ApiOperation(value = "推荐保险列表", notes = "推荐保险列表")
|
||||
@ApiImplicitParam(name = "recommendCategoryNo", value = "保险类型", required = false, dataType = "String")
|
||||
public ResponseResult<List<InsuranceVO>> recommendInsureList(@RequestParam(value = "recommendCategoryNo",required = false) String recommendCategoryNo) {
|
||||
InsuranceVO insuranceVO = InsuranceVO.builder().
|
||||
showIndex(InsureConstant.SHOW_INDEX_STATE_0).
|
||||
dataState(InsureConstant.DATA_STATE_0).
|
||||
build();
|
||||
if (!EmptyUtil.isNullOrEmpty(recommendCategoryNo)){
|
||||
insuranceVO.setRecommendCategoryNo(Long.valueOf(recommendCategoryNo));
|
||||
}
|
||||
Page<InsuranceVO> page = insuranceService.findPage(insuranceVO, 0, 10);
|
||||
return ResponseResultBuild.successBuild(page.getRecords());
|
||||
}
|
||||
|
||||
/**
|
||||
* 金牌好品
|
||||
* @param category 保险分类编号
|
||||
* @description 金牌好品、安心培
|
||||
* -->tab_insurance-->optimization 或者 relieved
|
||||
*/
|
||||
@PostMapping("glod-insurance-list/{category}")
|
||||
@ApiOperation(value = "金牌好品", notes = "金牌好品")
|
||||
@ApiImplicitParam(name = "category", value = "保险分类编号", required = true, dataType = "Long", paramType = "path", example = "分类接口中获得的内容")
|
||||
public ResponseResult<List<InsuranceVO>> glodInsurancelist(@PathVariable("category") String category) {
|
||||
InsuranceVO insuranceVO = InsuranceVO.builder().
|
||||
dataState(SuperConstant.DATA_STATE_0).
|
||||
categoryNo(Long.valueOf(category)).
|
||||
goldSelection(InsuranceConstant.GOLDSELECTION_0).
|
||||
build();
|
||||
Page<InsuranceVO> insuranceVOPage = insuranceService.findPage(insuranceVO, 0, 10);
|
||||
return ResponseResultBuild.successBuild(insuranceVOPage.getRecords());
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 保险方案
|
||||
*/
|
||||
@PostMapping("insurance-plan")
|
||||
@ApiOperation(value = "保险方案", notes = "保险方案")
|
||||
public ResponseResult<List<CombinationVO>> insurancePlan() {
|
||||
Page<CombinationVO> page = combinationService.findPage(CombinationVO.builder().dataState(SuperConstant.DATA_STATE_0).build(), 0, 6);
|
||||
return ResponseResultBuild.successBuild(page.getRecords());
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 多条件查询列表
|
||||
* @return List<BannerVO>
|
||||
*/
|
||||
@GetMapping("list")
|
||||
@ApiOperation(value = "banner查询列表",notes = "banner查询列表")
|
||||
public ResponseResult<List<BannerVO>> bannerList() {
|
||||
BannerVO bannerVO = BannerVO.builder()
|
||||
.dataState(SuperConstant.DATA_STATE_0)
|
||||
.build();
|
||||
List<BannerVO> bannerVOList = bannerService.findList(bannerVO);
|
||||
return ResponseResultBuild.successBuild(bannerVOList);
|
||||
}
|
||||
}
|
||||
+180
@@ -0,0 +1,180 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.dto.trade.TradeVO;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.insurance.dto.*;
|
||||
import com.itheima.sfbx.insurance.rule.AccessRuleDTO;
|
||||
import com.itheima.sfbx.insurance.service.IInsuranceService;
|
||||
import com.itheima.sfbx.insurance.service.IRuleService;
|
||||
import com.itheima.sfbx.insurance.service.IWarrantyOrderService;
|
||||
import com.itheima.sfbx.insurance.service.IWarrantyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @ClassName InsureController.java
|
||||
* @Description 投保
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "保险投保")
|
||||
@RestController
|
||||
@RequestMapping("insure")
|
||||
public class InsureController {
|
||||
|
||||
@Autowired
|
||||
IWarrantyService warrantyService;
|
||||
|
||||
@Autowired
|
||||
IWarrantyOrderService warrantyOrderService;
|
||||
|
||||
@Autowired
|
||||
private IInsuranceService insuranceService;
|
||||
|
||||
/***
|
||||
* @description 保险投保
|
||||
* @param doInsureVo 保险产品VO对象
|
||||
* @return 保险合同
|
||||
*/
|
||||
@PostMapping("do-insure")
|
||||
@ApiOperation(value = "保险投保",notes = "保险投保")
|
||||
@ApiImplicitParam(name = "doInsureVo",value = "保险产品详情Vo对象",required = true,dataType = "DoInsureVo")
|
||||
public ResponseResult<WarrantyVO> doInsure(@RequestBody DoInsureVo doInsureVo) {
|
||||
WarrantyVO warrantyVO = warrantyService.doInsure(doInsureVo);
|
||||
return ResponseResultBuild.successBuild(warrantyVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 查询保险合同及未支付的合同订单
|
||||
* @param warrantyId 保险合同ID
|
||||
* @return WarrantyVO
|
||||
*/
|
||||
@PostMapping("warranty/{warrantyId}")
|
||||
@ApiOperation(value = "查询合同",notes = "查询合同")
|
||||
@ApiImplicitParam(paramType = "path",name = "warrantyId",value = "合同ID",dataType = "String")
|
||||
public ResponseResult<WarrantyVO> findWarranty(@PathVariable("warrantyId") String warrantyId) {
|
||||
WarrantyVO warrantyVOResult = warrantyService.findWarranty(warrantyId);
|
||||
return ResponseResultBuild.successBuild(warrantyVOResult);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* @description 保费计算
|
||||
* @param doInsureVo 投保试算对象
|
||||
* @return 投入型:最终本期投保金额,返回0则表示不符合条件
|
||||
*/
|
||||
@PostMapping("do-premium")
|
||||
@ApiOperation(value = "保费计算",notes = "保费计算")
|
||||
@ApiImplicitParam(name = "doInsureVo",value = "投保试算对象",required = true,dataType = "DoInsureVo")
|
||||
public ResponseResult<String> doPremium(@RequestBody DoInsureVo doInsureVo) {
|
||||
String priceBuy= insuranceService.doPremium(doInsureVo);
|
||||
return ResponseResultBuild.successBuild(priceBuy);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 理财收益
|
||||
* @param doInsureVo 投保试算对象
|
||||
* @return 理财型:最终收益,返回0则表示不符合条件
|
||||
*/
|
||||
@PostMapping("do-earnings")
|
||||
@ApiOperation(value = "收益计算",notes = "收益计算")
|
||||
@ApiImplicitParam(name = "doInsureVo",value = "投保试算对象",required = true,dataType = "DoInsureVo")
|
||||
public ResponseResult<EarningVO> doEarnings(@RequestBody DoInsureVo doInsureVo) {
|
||||
EarningVO earningVO= insuranceService.doEarnings(doInsureVo);
|
||||
return ResponseResultBuild.successBuild(earningVO);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 保险支付:一次性支付
|
||||
* @param warrantyOrderId 合同订单Id
|
||||
* @param tradingChannel 支付渠道
|
||||
* @return 支付会话签名
|
||||
*/
|
||||
@PostMapping("do-payment/{warrantyOrderId}/{tradingChannel}")
|
||||
@ApiOperation(value = "一次性支付",notes = "一次性支付")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType = "path",name = "warrantyOrderId",value = "合同保单Id",required = true,dataType = "String"),
|
||||
@ApiImplicitParam(paramType = "path",name = "tradingChannel",value = "支付渠道",required = true,dataType = "String")
|
||||
})
|
||||
public ResponseResult<TradeVO> doPayment(@PathVariable("warrantyOrderId")String warrantyOrderId,
|
||||
@PathVariable("tradingChannel")String tradingChannel) {
|
||||
return ResponseResultBuild.successBuild(warrantyOrderService.doPayment(warrantyOrderId,tradingChannel));
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 关闭订单
|
||||
* @param tradeOrderNo 交易订单号
|
||||
* @param tradingChannel 支付渠道
|
||||
* @return 支付会话签名
|
||||
*/
|
||||
@PostMapping("do-close/{tradeOrderNo}/{tradingChannel}")
|
||||
@ApiOperation(value = "关闭订单",notes = "关闭订单")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType = "path",name = "tradeOrderNo",value = "交易订单号",required = true,dataType = "String"),
|
||||
@ApiImplicitParam(paramType = "path",name = "tradingChannel",value = "支付渠道",required = true,dataType = "String")
|
||||
})
|
||||
public ResponseResult<TradeVO> doClose(@PathVariable("tradeOrderNo")String tradeOrderNo,
|
||||
@PathVariable("tradingChannel")String tradingChannel) {
|
||||
return ResponseResultBuild.successBuild(warrantyOrderService.doClose(tradeOrderNo,tradingChannel));
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 保险支付:独立签约
|
||||
* @param warrantyOrderId 合同订单Id
|
||||
* @param tradingChannel 支付渠道
|
||||
* @return 签约唤醒签名
|
||||
*/
|
||||
@PostMapping("sign-contract/{warrantyOrderId}/{tradingChannel}")
|
||||
@ApiOperation(value = "独立签约",notes = "独立签约")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType = "path",name = "warrantyOrderId",value = "合同保单Id",required = true,dataType = "Long"),
|
||||
@ApiImplicitParam(paramType = "path",name = "tradingChannel",value = "支付渠道",required = true,dataType = "String")
|
||||
})
|
||||
public ResponseResult<String> signContract(@PathVariable("warrantyOrderId")String warrantyOrderId,
|
||||
@PathVariable("tradingChannel")String tradingChannel) {
|
||||
return ResponseResultBuild.successBuild(warrantyOrderService.signContract(warrantyOrderId,tradingChannel));
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 保险支付:签约同步,并首次扣款
|
||||
* @param warrantyOrderId 合同订单Id
|
||||
* @param tradingChannel 支付渠道
|
||||
* @param agreementNo 支付签约号
|
||||
* @return 签约唤醒签名
|
||||
*/
|
||||
@PostMapping("sign-contract-sync/{warrantyOrderId}/{tradingChannel}/{agreementNo}")
|
||||
@ApiOperation(value = "签约同步",notes = "签约同步")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType = "path",name = "warrantyOrderId",value = "合同保单Id",required = true,dataType = "Long"),
|
||||
@ApiImplicitParam(paramType = "path",name = "tradingChannel",value = "支付渠道",required = true,dataType = "String"),
|
||||
@ApiImplicitParam(paramType = "path",name = "agreementNo",value = "支付签约号",required = true,dataType = "String")
|
||||
})
|
||||
public ResponseResult<Boolean> signContractSync(@PathVariable("warrantyOrderId")String warrantyOrderId,
|
||||
@PathVariable("tradingChannel")String tradingChannel,
|
||||
@PathVariable("agreementNo")String agreementNo) {
|
||||
return ResponseResultBuild.successBuild(warrantyOrderService.signContractSync(warrantyOrderId,tradingChannel,agreementNo));
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 保险支付:关闭签约
|
||||
* @param warrantyOrderId 合同订单Id
|
||||
* @param tradingChannel 支付渠道
|
||||
* @return 支付会话签名
|
||||
*/
|
||||
@PostMapping("do-close-sign-contract/{warrantyOrderId}/{tradingChannel}")
|
||||
@ApiOperation(value = "关闭签约",notes = "关闭签约")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType = "path",name = "warrantyOrderId",value = "合同保单Id",required = true,dataType = "Long"),
|
||||
@ApiImplicitParam(paramType = "path",name = "tradingChannel",value = "支付渠道",required = true,dataType = "String")
|
||||
})
|
||||
public ResponseResult<Boolean> doCloseSignContract(@PathVariable("warrantyOrderId")String warrantyOrderId,
|
||||
@PathVariable("tradingChannel")String tradingChannel) {
|
||||
return ResponseResultBuild.successBuild(warrantyOrderService.doCloseSignContract(warrantyOrderId,tradingChannel));
|
||||
}
|
||||
}
|
||||
+237
@@ -0,0 +1,237 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.constant.basic.SuperConstant;
|
||||
import com.itheima.sfbx.framework.commons.dto.security.CustomerVO;
|
||||
import com.itheima.sfbx.framework.commons.dto.security.UserVO;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.framework.commons.utils.SubjectContent;
|
||||
import com.itheima.sfbx.insurance.dto.*;
|
||||
import com.itheima.sfbx.insurance.service.ICustomerCardService;
|
||||
import com.itheima.sfbx.insurance.service.ICustomerInfoService;
|
||||
import com.itheima.sfbx.insurance.service.ICustomerRelationService;
|
||||
import com.itheima.sfbx.insurance.service.IWarrantyService;
|
||||
import com.itheima.sfbx.security.feign.CustomerFeign;
|
||||
import com.itheima.sfbx.wenxin.WenXinService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName MineController.java
|
||||
* @Description 我的
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "我的tab页")
|
||||
@RestController
|
||||
@RequestMapping("mined")
|
||||
public class MineController {
|
||||
|
||||
@Autowired
|
||||
private CustomerFeign customerFeign;
|
||||
|
||||
@Autowired
|
||||
private ICustomerInfoService customerInfoService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerCardService customerCardService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerRelationService customerRelationService;
|
||||
|
||||
@Autowired
|
||||
private WenXinService wenXinService;
|
||||
|
||||
/**
|
||||
* 01、注册页面:调用security-interface中的CustomerFeign接口
|
||||
*/
|
||||
@PostMapping("register")
|
||||
@ApiOperation(value = "注册", notes = "注册")
|
||||
@ApiImplicitParam(name = "customerVO", value = "客户对象VO", dataType = "CustomerVO")
|
||||
public ResponseResult<UserVO> register(@RequestBody CustomerVO customerVO) {
|
||||
UserVO userVO = customerFeign.registerUser(customerVO);
|
||||
userVO.setPassword("");
|
||||
return ResponseResultBuild.successBuild(userVO);
|
||||
}
|
||||
|
||||
//03、重置密码:必须登录才能重置密码,必须是完成手机号码补充内容
|
||||
@PostMapping("reset-password")
|
||||
@ApiOperation(value = "重置密码", notes = "重置密码")
|
||||
public ResponseResult<Boolean> resetPassword() {
|
||||
UserVO userVO = SubjectContent.getUserVO();
|
||||
return ResponseResultBuild.successBuild(customerInfoService.resetPassword(userVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 07、我的关系-->tab_customer_relation
|
||||
*/
|
||||
@PostMapping("my-relation")
|
||||
@ApiOperation(value = "根据当前登录人信息获取关系网", notes = "根据当前登录人信息获取关系网")
|
||||
public ResponseResult<List<CustomerRelationVO>> myRelation() {
|
||||
UserVO userVO = SubjectContent.getUserVO();
|
||||
CustomerRelationVO relationVO = CustomerRelationVO.builder()
|
||||
.customerId(userVO.getId())
|
||||
.dataState(SuperConstant.DATA_STATE_0)
|
||||
.build();
|
||||
List<CustomerRelationVO> res = customerRelationService.myRelation(relationVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据关系字段获取对应的亲属
|
||||
*
|
||||
* @param fields
|
||||
*/
|
||||
@PostMapping("my-relation-field/{relationgFields}")
|
||||
@ApiOperation(value = "根据关系字段获取当前登录人信息获取关系网", notes = "根据关系字段获取当前登录人信息获取关系网")
|
||||
@ApiImplicitParam(name = "relationgFields", value = "关系字段列表(用逗号分隔)", required = true, dataType = "String")
|
||||
public ResponseResult<List<CustomerRelationVO>> myRelationsFields(@PathVariable("relationgFields") String fields) {
|
||||
CustomerRelationVO relationVO = CustomerRelationVO.builder().
|
||||
dataState(SuperConstant.DATA_STATE_0).
|
||||
customerId(SubjectContent.getUserVO().getId()).
|
||||
relations(customerRelationService.getRelations(fields)).
|
||||
build();
|
||||
List<CustomerRelationVO> res = customerRelationService.myRelation(relationVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据关系字段获取对应的亲属
|
||||
*/
|
||||
@PostMapping("ocr-access")
|
||||
@ApiOperation(value = "获取百度云token", notes = "获取百度云token")
|
||||
public ResponseResult<BaiduCloudTokenVO> myRelationsFields() {
|
||||
BaiduCloudTokenVO ocrToken = customerInfoService.getOcrToken(SubjectContent.getUserVO());
|
||||
return ResponseResultBuild.successBuild(ocrToken);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
IWarrantyService warrantyService;
|
||||
|
||||
/***
|
||||
* @description 我的保单合同列表
|
||||
* @return 保单列表
|
||||
*/
|
||||
@PostMapping("my-warrantys-nums")
|
||||
@ApiOperation(value = "我的保单数量", notes = "我的保单数量")
|
||||
public ResponseResult<MyWarrantyInfoVO> myWarrantyNums(){
|
||||
MyWarrantyInfoVO res = warrantyService.myWarrantyNums(SubjectContent.getUserVO());
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 我的保单合同列表
|
||||
* @return 保单列表
|
||||
*/
|
||||
@PostMapping("my-warrantys")
|
||||
@ApiOperation(value = "我的保单列表", notes = "我的保单列表")
|
||||
public ResponseResult<List<WarrantyVO>> myWarrantyVOs(@RequestBody(required = false) CustomerRelationVO customerRelationVO){
|
||||
List<WarrantyVO> warrantyVOs = warrantyService.myWarrantyVOs(SubjectContent.getUserVO(),customerRelationVO);
|
||||
return ResponseResultBuild.successBuild(warrantyVOs);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 保单详情
|
||||
* @param warrantyId 保险合同ID
|
||||
* @return WarrantyVO
|
||||
*/
|
||||
@PostMapping("detail/{warrantyId}")
|
||||
@ApiOperation(value = "保单详情",notes = "保单详情")
|
||||
@ApiImplicitParam(paramType = "path",name = "warrantyId",value = "合同ID",dataType = "String")
|
||||
public ResponseResult<WarrantyVO> createWarranty(@PathVariable("warrantyId") String warrantyId) {
|
||||
WarrantyVO warrantyVOResult = warrantyService.findById(warrantyId);
|
||||
return ResponseResultBuild.successBuild(warrantyVOResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据关系字段获取对应的亲属
|
||||
*/
|
||||
@PostMapping("find-risk-solution")
|
||||
@ApiOperation(value = "获取我的风险和解决方案", notes = "向文心一言请求风险和解决方案")
|
||||
public ResponseResult<String> findRiskAndSolution() {
|
||||
String question = wenXinService.askQuestion(null);
|
||||
return ResponseResultBuild.successBuild(question);
|
||||
}
|
||||
|
||||
/**
|
||||
* 银行卡列表
|
||||
*/
|
||||
@PostMapping("bank-card-list")
|
||||
@ApiOperation(value = "我的银行卡列表", notes = "我的银行卡列表")
|
||||
public ResponseResult<List<CustomerCardVO>> bankCardList() {
|
||||
CustomerCardVO customerCardVO = CustomerCardVO.builder().
|
||||
dataState(SuperConstant.DATA_STATE_0).
|
||||
customerId(String.valueOf(SubjectContent.getUserVO().getId())).
|
||||
build();
|
||||
List<CustomerCardVO> res = customerCardService.bankCardList(customerCardVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加银行卡
|
||||
*/
|
||||
@PostMapping("bank-card")
|
||||
@ApiOperation(value = "添加银行卡", notes = "添加银行卡")
|
||||
public ResponseResult<CustomerCardVO> saveBankCard(@RequestBody CustomerCardVO customerCardVO) {
|
||||
CustomerCardVO res = customerCardService.saveBankCard(customerCardVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸识别认证
|
||||
*/
|
||||
@PostMapping("face-check")
|
||||
@ApiOperation(value = "人脸识别认证", notes = "人脸识别认证")
|
||||
public ResponseResult<Boolean> faceCheck() {
|
||||
Boolean res = customerInfoService.faceCheck();
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 身份证号存储
|
||||
*/
|
||||
@PostMapping("id-card")
|
||||
@ApiOperation(value = "身份证号存储", notes = "身份证号存储")
|
||||
public ResponseResult<CustomerInfoVO> idCard(@RequestBody CustomerInfoVO customerInfo) {
|
||||
CustomerInfoVO res = customerInfoService.idCard(customerInfo);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 身份证号存储
|
||||
*/
|
||||
@PostMapping("id-card-info")
|
||||
@ApiOperation(value = "身份证信息", notes = "身份证信息")
|
||||
public ResponseResult<CustomerInfoVO> idCardInfo() {
|
||||
CustomerInfoVO res = customerInfoService.idCardInfo();
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改默认使用银行卡
|
||||
*/
|
||||
@PostMapping("default-bank-card/{customerCardId}")
|
||||
@ApiOperation(value = "修改默认使用银行卡", notes = "修改默认使用银行卡")
|
||||
public ResponseResult<CustomerCardVO> defaultBankCard(@PathVariable("customerCardId") String customerCardId) {
|
||||
CustomerCardVO res = customerCardService.defaultBankCard(customerCardId);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑银行卡
|
||||
*/
|
||||
@PostMapping("remove-bank-card")
|
||||
@ApiOperation(value = "解绑银行卡", notes = "解绑银行卡")
|
||||
public ResponseResult<CustomerCardVO> removeBankCarrd(@RequestBody CustomerCardVO customerCardVO) {
|
||||
CustomerCardVO res = customerCardService.removeBankCard(customerCardVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.itheima.sfbx.framework.anno.SensitiveResponse;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.framework.commons.utils.SubjectContent;
|
||||
import com.itheima.sfbx.insurance.dto.CustomerRelationVO;
|
||||
import com.itheima.sfbx.insurance.dto.HomePeopleVO;
|
||||
import com.itheima.sfbx.insurance.dto.SelfWarrantyVO;
|
||||
import com.itheima.sfbx.insurance.service.ICustomerRelationService;
|
||||
import com.itheima.sfbx.insurance.service.IRuleService;
|
||||
import com.itheima.sfbx.insurance.service.IWarrantyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.FieldError;
|
||||
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.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName WarrantyController.java
|
||||
* @Description 家庭保障
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "我的家庭")
|
||||
@RestController
|
||||
@RequestMapping("mine-home")
|
||||
public class MineHomeController {
|
||||
|
||||
@Autowired
|
||||
private IWarrantyService warrantyService;
|
||||
|
||||
@Autowired
|
||||
private IRuleService ruleService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerRelationService customerRelationService;
|
||||
|
||||
/**
|
||||
* 获取我的保单
|
||||
*/
|
||||
@PostMapping("home-all-warranty-order")
|
||||
@ApiOperation(value = "家庭全部保单数量", notes = "家庭全部保单数量")
|
||||
public ResponseResult<SelfWarrantyVO> myRelationsFields() {
|
||||
return ResponseResultBuild.successBuild(warrantyService.findMyWarrantyNums(SubjectContent.getUserVO()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 家庭人身保障
|
||||
*/
|
||||
@PostMapping("home-people-safe")
|
||||
@ApiOperation(value = "家庭人身保障", notes = "家庭人身保障")
|
||||
public ResponseResult<List<HomePeopleVO>> homePeopleSafe() {
|
||||
return ResponseResultBuild.successBuild(warrantyService.findHomeSafeInfo(SubjectContent.getUserVO()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加人物关系
|
||||
*/
|
||||
@PostMapping("customer-relation")
|
||||
@ApiOperation(value = "添加人物关系", notes = "添加人物关系")
|
||||
@ApiImplicitParam(name = "customerRelationVO", value = "用户关系", required = false, dataType = "CustomerRelationVO")
|
||||
public ResponseResult<CustomerRelationVO> addCustomerRelation(@Valid @RequestBody CustomerRelationVO customerRelationVO, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResponseResultBuild.validateErrorBuild(null);
|
||||
}else {
|
||||
return ResponseResultBuild.successBuild(customerRelationService.save(customerRelationVO));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人物关系
|
||||
*/
|
||||
@PostMapping("update-customer-relation")
|
||||
@ApiOperation(value = "修改人物关系", notes = "修改人物关系")
|
||||
@ApiImplicitParam(name = "customerRelationVO", value = "用户关系", required = false, dataType = "CustomerRelationVO")
|
||||
public ResponseResult<CustomerRelationVO> updateHomePeopleSafe(@Valid @RequestBody CustomerRelationVO customerRelationVO,BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
// 返回包含错误信息的响应
|
||||
return ResponseResultBuild.validateErrorBuild(null);
|
||||
}else {
|
||||
customerRelationService.update(customerRelationVO);
|
||||
return ResponseResultBuild.successBuild(customerRelationVO);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加人物关系
|
||||
*/
|
||||
@PostMapping("delete-customer-relation")
|
||||
@ApiOperation(value = "删除人物关系", notes = "删除人物关系")
|
||||
@ApiImplicitParam(name = "customerRelationVO", value = "用户关系", required = false, dataType = "CustomerRelationVO")
|
||||
@ApiOperationSupport(includeParameters = {"customerRelationVO.checkedIds"})
|
||||
public ResponseResult<Boolean> deleteHomePeopleSafe(@RequestBody CustomerRelationVO customerRelationVO) {
|
||||
return ResponseResultBuild.successBuild(customerRelationService.delete(customerRelationVO.getCheckedIds()));
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.constant.basic.SuperConstant;
|
||||
import com.itheima.sfbx.framework.commons.constant.category.CategoryConstant;
|
||||
import com.itheima.sfbx.framework.commons.dto.basic.TreeVO;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.insurance.constant.InsuranceConstant;
|
||||
import com.itheima.sfbx.insurance.dto.*;
|
||||
import com.itheima.sfbx.insurance.pojo.WarrantyOrder;
|
||||
import com.itheima.sfbx.insurance.service.ICategoryConditionService;
|
||||
import com.itheima.sfbx.insurance.service.ICategoryService;
|
||||
import com.itheima.sfbx.insurance.service.IInsuranceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ProductController.java
|
||||
* @Description 产品
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "产品")
|
||||
@RestController
|
||||
@RequestMapping("product")
|
||||
public class ProductController {
|
||||
|
||||
@Autowired
|
||||
private ICategoryService categoryService;
|
||||
|
||||
@Autowired
|
||||
private ICategoryConditionService categoryConditionService;
|
||||
|
||||
@Autowired
|
||||
IInsuranceService insuranceService;
|
||||
|
||||
/**
|
||||
* @description 获取产品页面下的分类
|
||||
* @return TreeVO<CategoryVO>
|
||||
*/
|
||||
@ApiOperation(value = "查询产品页下的产品分类",notes = "查询产品页下的产品分类")
|
||||
@PostMapping("/find-product-categorys")
|
||||
public ResponseResult<TreeVO> findCategoryByType() {
|
||||
TreeVO treeVO = categoryService.categoryTreeVO(SuperConstant.ROOT_PARENT_ID, CategoryConstant.PRODUCT_TYPE, null);
|
||||
return ResponseResultBuild.successBuild(treeVO);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 查询产品分类下筛选项目
|
||||
* @param categoryNo
|
||||
* @return ResponseResult<List<CategoryConditionVO>>
|
||||
*/
|
||||
@ApiOperation(value = "查询产品分类下筛选项目",notes = "查询产品分类下筛选项目")
|
||||
@PostMapping("/find-condition/{categoryNo}")
|
||||
public ResponseResult<List<CategoryConditionVO>> findConditionByCategoryNo(@PathVariable(name = "categoryNo",required = false)String categoryNo) {
|
||||
return ResponseResultBuild.successBuild(categoryConditionService.findConditionByType(categoryNo));
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 查询产品列表
|
||||
* @param insuranceVO 搜索对象
|
||||
* @return ResponseResult<List<InsuranceVO>>
|
||||
*/
|
||||
@PostMapping("find-insurance-product")
|
||||
@ApiOperation(value = "查询产品列表",notes = "查询产品列表")
|
||||
public ResponseResult<List<InsuranceVO>> findInsuranceProduct(@RequestBody InsuranceVO insuranceVO){
|
||||
insuranceVO.setInsuranceState(InsuranceConstant.INSURANCE_STATE_0);
|
||||
return ResponseResultBuild.successBuild(insuranceService.findList(insuranceVO));
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 保险产品详情
|
||||
* @param insuranceId 保险id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("find-insurance/{insuranceId}")
|
||||
@ApiOperation(value = "保险产品详情",notes = "保险产品详情")
|
||||
@ApiImplicitParam(name = "insuranceId",value = "保险id",required = true,dataType = "String")
|
||||
public ResponseResult<InsuranceVO> findInsuranceDetails(@PathVariable("insuranceId")String insuranceId){
|
||||
InsuranceVO insuranceVO = insuranceService.findById(insuranceId);
|
||||
return ResponseResultBuild.successBuild(insuranceVO);
|
||||
}
|
||||
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.itheima.sfbx.insurance.enums.RiskEnum;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.itheima.sfbx.insurance.dto.RiskVO;
|
||||
import com.itheima.sfbx.insurance.service.IRiskService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description:风险表响应接口
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "风险表")
|
||||
@RestController
|
||||
@RequestMapping("risk")
|
||||
public class RiskController {
|
||||
|
||||
@Autowired
|
||||
IRiskService riskService;
|
||||
|
||||
/***
|
||||
* @description 多条件查询风险表分页
|
||||
* @param riskVO 风险表VO查询条件
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页条数
|
||||
* @return: Page<RiskVO>
|
||||
*/
|
||||
@PostMapping("page/{pageNum}/{pageSize}")
|
||||
@ApiOperation(value = "风险表分页",notes = "风险表分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "riskVO",value = "风险表VO对象",required = true,dataType = "RiskVO"),
|
||||
@ApiImplicitParam(paramType = "path",name = "pageNum",value = "页码",example = "1",dataType = "Integer"),
|
||||
@ApiImplicitParam(paramType = "path",name = "pageSize",value = "每页条数",example = "10",dataType = "Integer")
|
||||
})
|
||||
@ApiOperationSupport(includeParameters = {"riskVO.riskTypeKey","riskVO.riskTypeName","riskVO.riskKey","riskVO.riskName","riskVO.sortNo"})
|
||||
public ResponseResult<Page<RiskVO>> findRiskVOPage(
|
||||
@RequestBody RiskVO riskVO,
|
||||
@PathVariable("pageNum") int pageNum,
|
||||
@PathVariable("pageSize") int pageSize) {
|
||||
Page<RiskVO> riskVOPage = riskService.findPage(riskVO, pageNum, pageSize);
|
||||
return ResponseResultBuild.successBuild(riskVOPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 保存风险表
|
||||
* @param riskVO 风险表VO对象
|
||||
* @return RiskVO
|
||||
*/
|
||||
@PutMapping
|
||||
@ApiOperation(value = "保存Risk",notes = "添加Risk")
|
||||
@ApiImplicitParam(name = "riskVO",value = "风险表VO对象",required = true,dataType = "RiskVO")
|
||||
@ApiOperationSupport(includeParameters = {"riskVO.dataState","riskVO.riskTypeKey","riskVO.riskTypeName","riskVO.riskKey","riskVO.riskName","riskVO.sortNo"})
|
||||
public ResponseResult<RiskVO> createRisk(@RequestBody RiskVO riskVO) {
|
||||
RiskVO riskVOResult = riskService.save(riskVO);
|
||||
return ResponseResultBuild.successBuild(riskVOResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 修改风险表
|
||||
* @param riskVO 风险表VO对象
|
||||
* @return Boolean 是否修改成功
|
||||
*/
|
||||
@PatchMapping
|
||||
@ApiOperation(value = "修改风险表",notes = "修改风险表")
|
||||
@ApiImplicitParam(name = "riskVO",value = "风险表VO对象",required = true,dataType = "RiskVO")
|
||||
@ApiOperationSupport(includeParameters = {"riskVO.id","riskVO.dataState","riskVO.riskTypeKey","riskVO.riskTypeName","riskVO.riskKey","riskVO.riskName","riskVO.sortNo"})
|
||||
public ResponseResult<Boolean> updateRisk(@RequestBody RiskVO riskVO) {
|
||||
Boolean flag = riskService.update(riskVO);
|
||||
return ResponseResultBuild.successBuild(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 删除风险表
|
||||
* @param riskVO 刪除条件:checkedIds 不可为空
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除风险表",notes = "删除风险表")
|
||||
@ApiImplicitParam(name = "riskVO",value = "风险表VO对象",required = true,dataType = "RiskVO")
|
||||
@ApiOperationSupport(includeParameters = {"riskVO.checkedIds"})
|
||||
public ResponseResult<Boolean> deleteRisk(@RequestBody RiskVO riskVO) {
|
||||
Boolean flag = riskService.delete(riskVO.getCheckedIds());
|
||||
return ResponseResultBuild.successBuild(flag);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 多条件查询风险表列表
|
||||
* @param riskVO 风险表VO对象
|
||||
* @return List<RiskVO>
|
||||
*/
|
||||
@PostMapping("list")
|
||||
@ApiOperation(value = "多条件查询风险表列表",notes = "多条件查询风险表列表")
|
||||
@ApiImplicitParam(name = "riskVO",value = "风险表VO对象",required = true,dataType = "RiskVO")
|
||||
@ApiOperationSupport(includeParameters = {"riskVO.riskTypeKey","riskVO.riskTypeName","riskVO.riskKey","riskVO.riskName","riskVO.sortNo"})
|
||||
public ResponseResult<List<RiskVO>> riskList(@RequestBody RiskVO riskVO) {
|
||||
List<RiskVO> riskVOList = riskService.findList(riskVO);
|
||||
return ResponseResultBuild.successBuild(riskVOList);
|
||||
}
|
||||
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.insurance.dto.CategoryVO;
|
||||
import com.itheima.sfbx.insurance.dto.SaleTopInsuranceVO;
|
||||
import com.itheima.sfbx.insurance.service.ICategoryService;
|
||||
import com.itheima.sfbx.insurance.service.ISaleTopInsuranceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:响应接口
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "热销榜")
|
||||
@RestController
|
||||
@RequestMapping("sale-top-insurance")
|
||||
public class SaleTopInsuranceController {
|
||||
|
||||
@Autowired
|
||||
ISaleTopInsuranceService saleTopInsuranceService;
|
||||
|
||||
@Autowired
|
||||
ICategoryService categoryService;
|
||||
|
||||
/***
|
||||
* @description 多条件查询分页
|
||||
* @param saleTopInsuranceVO VO查询条件
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页条数
|
||||
* @return: Page<SaleTopInsuranceVO>
|
||||
*/
|
||||
@PostMapping("page/{pageNum}/{pageSize}")
|
||||
@ApiOperation(value = "分页",notes = "分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "saleTopInsuranceVO",value = "VO对象",required = true,dataType = "SaleTopInsuranceVO"),
|
||||
@ApiImplicitParam(paramType = "path",name = "pageNum",value = "页码",example = "1",dataType = "Integer"),
|
||||
@ApiImplicitParam(paramType = "path",name = "pageSize",value = "每页条数",example = "10",dataType = "Integer")
|
||||
})
|
||||
@ApiOperationSupport(includeParameters = {"saleTopInsuranceVO.checkRule","saleTopInsuranceVO.insuranceId","saleTopInsuranceVO.insuranceName","saleTopInsuranceVO.insuranceDetail","saleTopInsuranceVO.comment","saleTopInsuranceVO.remake","saleTopInsuranceVO.categoryNo","saleTopInsuranceVO.companyNo"})
|
||||
public ResponseResult<Page<SaleTopInsuranceVO>> findSaleTopInsuranceVOPage(
|
||||
@RequestBody SaleTopInsuranceVO saleTopInsuranceVO,
|
||||
@PathVariable("pageNum") int pageNum,
|
||||
@PathVariable("pageSize") int pageSize) {
|
||||
Page<SaleTopInsuranceVO> saleTopInsuranceVOPage = saleTopInsuranceService.findPage(saleTopInsuranceVO, pageNum, pageSize);
|
||||
return ResponseResultBuild.successBuild(saleTopInsuranceVOPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 保存
|
||||
* @param saleTopInsuranceVO VO对象
|
||||
* @return SaleTopInsuranceVO
|
||||
*/
|
||||
@PutMapping
|
||||
@ApiOperation(value = "保存SaleTopInsurance",notes = "添加SaleTopInsurance")
|
||||
@ApiImplicitParam(name = "saleTopInsuranceVO",value = "VO对象",required = true,dataType = "SaleTopInsuranceVO")
|
||||
@ApiOperationSupport(includeParameters = {"saleTopInsuranceVO.dataState","saleTopInsuranceVO.checkRule","saleTopInsuranceVO.insuranceId","saleTopInsuranceVO.insuranceName","saleTopInsuranceVO.insuranceDetail","saleTopInsuranceVO.comment","saleTopInsuranceVO.remake","saleTopInsuranceVO.categoryNo","saleTopInsuranceVO.companyNo"})
|
||||
public ResponseResult<SaleTopInsuranceVO> createSaleTopInsurance(@RequestBody SaleTopInsuranceVO saleTopInsuranceVO) {
|
||||
SaleTopInsuranceVO saleTopInsuranceVOResult = saleTopInsuranceService.save(saleTopInsuranceVO);
|
||||
return ResponseResultBuild.successBuild(saleTopInsuranceVOResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 修改
|
||||
* @param saleTopInsuranceVO VO对象
|
||||
* @return Boolean 是否修改成功
|
||||
*/
|
||||
@PatchMapping
|
||||
@ApiOperation(value = "修改",notes = "修改")
|
||||
@ApiImplicitParam(name = "saleTopInsuranceVO",value = "VO对象",required = true,dataType = "SaleTopInsuranceVO")
|
||||
@ApiOperationSupport(includeParameters = {"saleTopInsuranceVO.id","saleTopInsuranceVO.dataState","saleTopInsuranceVO.checkRule","saleTopInsuranceVO.insuranceId","saleTopInsuranceVO.insuranceName","saleTopInsuranceVO.insuranceDetail","saleTopInsuranceVO.comment","saleTopInsuranceVO.remake","saleTopInsuranceVO.categoryNo","saleTopInsuranceVO.companyNo"})
|
||||
public ResponseResult<Boolean> updateSaleTopInsurance(@RequestBody SaleTopInsuranceVO saleTopInsuranceVO) {
|
||||
Boolean flag = saleTopInsuranceService.update(saleTopInsuranceVO);
|
||||
return ResponseResultBuild.successBuild(flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 删除
|
||||
* @param saleTopInsuranceVO 刪除条件:checkedIds 不可为空
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除",notes = "删除")
|
||||
@ApiImplicitParam(name = "saleTopInsuranceVO",value = "VO对象",required = true,dataType = "SaleTopInsuranceVO")
|
||||
@ApiOperationSupport(includeParameters = {"saleTopInsuranceVO.checkedIds"})
|
||||
public ResponseResult<Boolean> deleteSaleTopInsurance(@RequestBody SaleTopInsuranceVO saleTopInsuranceVO) {
|
||||
Boolean flag = saleTopInsuranceService.delete(saleTopInsuranceVO.getCheckedIds());
|
||||
return ResponseResultBuild.successBuild(flag);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 多条件查询列表
|
||||
* @param saleTopInsuranceVO VO对象
|
||||
* @return List<SaleTopInsuranceVO>
|
||||
*/
|
||||
@PostMapping("list")
|
||||
@ApiOperation(value = "多条件查询列表",notes = "多条件查询列表")
|
||||
@ApiImplicitParam(name = "saleTopInsuranceVO",value = "VO对象",required = true,dataType = "SaleTopInsuranceVO")
|
||||
@ApiOperationSupport(includeParameters = {"saleTopInsuranceVO.checkRule","saleTopInsuranceVO.insuranceId","saleTopInsuranceVO.insuranceName","saleTopInsuranceVO.insuranceDetail","saleTopInsuranceVO.comment","saleTopInsuranceVO.remake","saleTopInsuranceVO.categoryNo","saleTopInsuranceVO.companyNo"})
|
||||
public ResponseResult<List<SaleTopInsuranceVO>> saleTopInsuranceList(@RequestBody SaleTopInsuranceVO saleTopInsuranceVO) {
|
||||
List<SaleTopInsuranceVO> saleTopInsuranceVOList = saleTopInsuranceService.findList(saleTopInsuranceVO);
|
||||
return ResponseResultBuild.successBuild(saleTopInsuranceVOList);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* @description 人种榜/险种榜分类
|
||||
* @return List<CategoryVO>
|
||||
*/
|
||||
@PostMapping("category-check-rule/{type}")
|
||||
@ApiOperation(value = "人种/险种分类",notes = "人种/险种分类")
|
||||
public ResponseResult<List<CategoryVO>> categoryCheckRule(@PathVariable("type")String type) {
|
||||
List<CategoryVO> res = categoryService.categoryCheckRule(type);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.constant.basic.SuperConstant;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.framework.commons.utils.SubjectContent;
|
||||
import com.itheima.sfbx.insurance.dto.InsuranceVO;
|
||||
import com.itheima.sfbx.insurance.dto.SearchRecordVO;
|
||||
import com.itheima.sfbx.insurance.service.IInsuranceService;
|
||||
import com.itheima.sfbx.insurance.service.IInsuranceTopService;
|
||||
import com.itheima.sfbx.insurance.service.ISearchRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName SearchIndexController.java
|
||||
* @Description 搜索提示框首页
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "搜索提示框首页")
|
||||
@RestController
|
||||
@RequestMapping("search-index")
|
||||
public class SearchIndexController {
|
||||
|
||||
@Autowired
|
||||
private ISearchRecordService searchRecordService;
|
||||
|
||||
@Autowired
|
||||
private IInsuranceTopService insuranceTopService;
|
||||
|
||||
@Autowired
|
||||
private IInsuranceService insuranceService;
|
||||
|
||||
|
||||
/**
|
||||
* 搜索历史-->tab_search_record-->SubjectContent[当前登录人]
|
||||
* 只查询前5条记录
|
||||
*/
|
||||
@PostMapping("find-search-record")
|
||||
@ApiOperation(value = "搜索历史", notes = "搜索历史")
|
||||
public ResponseResult<List<SearchRecordVO>> findSearchRecord() {
|
||||
SearchRecordVO searchVO = SearchRecordVO.builder().
|
||||
createBy(SubjectContent.getUserVO().getId()).
|
||||
dataState(SuperConstant.DATA_STATE_0).
|
||||
build();
|
||||
List<SearchRecordVO> records = searchRecordService.findPage(searchVO, 0, 6).getRecords();
|
||||
return ResponseResultBuild.successBuild(records);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索历史-->tab_search_record-->SubjectContent[当前登录人]
|
||||
* 只查询前5条记录
|
||||
*/
|
||||
@PostMapping("clean-search-record")
|
||||
@ApiOperation(value = "清空历史记录", notes = "清空历史记录")
|
||||
public ResponseResult<Boolean> cleanSearchRecord() {
|
||||
return ResponseResultBuild.successBuild(searchRecordService.cleanSearchRecord());
|
||||
}
|
||||
|
||||
/**
|
||||
* 热搜榜-->tab_search_record
|
||||
*/
|
||||
@PostMapping("/find-hot-search-record")
|
||||
@ApiOperation(value = "热搜榜", notes = "热搜榜")
|
||||
public ResponseResult<List<SearchRecordVO>> findHotSearchRecord() {
|
||||
List<SearchRecordVO> records = searchRecordService.tindTopRecord(10);
|
||||
return ResponseResultBuild.successBuild(records);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人气保险-->tab_insurance_top
|
||||
*/
|
||||
@PostMapping("find-popular-top-insurance")
|
||||
@ApiOperation(value = "人气保险", notes = "人气保险")
|
||||
public ResponseResult<List<InsuranceVO>> findPopularTopInsurance() {
|
||||
//默认条数
|
||||
Integer defaultNum = 3;
|
||||
//30天内有效数据
|
||||
Integer dateLimit = 30;
|
||||
//获取人气保险
|
||||
List<InsuranceVO> topInsurance = insuranceTopService.findTopInsurance(defaultNum, dateLimit);
|
||||
return ResponseResultBuild.successBuild(topInsurance);
|
||||
}
|
||||
|
||||
/***
|
||||
* @description 搜索保险
|
||||
* @param insuranceVO 保险名称
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页条数
|
||||
* @return: Page<CategoryCoefficentVO>
|
||||
*/
|
||||
@PostMapping("find-search-insure/{pageNum}/{pageSize}")
|
||||
@ApiOperation(value = "搜索保险", notes = "搜索保险")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "insuranceVO", value = "保险搜索条件", dataType = "InsuranceVO"),
|
||||
@ApiImplicitParam(name = "pageNum", value = "页码", example = "1", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", example = "10", dataType = "Integer")
|
||||
})
|
||||
public ResponseResult<Page<InsuranceVO>> findSearchInsure(
|
||||
@RequestBody InsuranceVO insuranceVO,
|
||||
@PathVariable("pageNum") int pageNum,
|
||||
@PathVariable("pageSize") int pageSize) {
|
||||
Page<InsuranceVO> insurePageVO = insuranceService.findPage(insuranceVO, pageNum, pageSize);
|
||||
return ResponseResultBuild.successBuild(insurePageVO);
|
||||
}
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
|
||||
import com.alibaba.nacos.common.utils.MD5Utils;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.dto.dict.DataDictVO;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.framework.commons.utils.SubjectContent;
|
||||
import com.itheima.sfbx.insurance.dto.*;
|
||||
import com.itheima.sfbx.insurance.rule.advice.AdviceHealthDTO;
|
||||
import com.itheima.sfbx.insurance.service.DataExportService;
|
||||
import com.itheima.sfbx.insurance.service.IRuleService;
|
||||
import com.itheima.sfbx.insurance.service.ISickSearchRecordService;
|
||||
import com.itheima.sfbx.insurance.service.ISickService;
|
||||
import com.itheima.sfbx.insurance.service.impl.SickServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName SeekAdviceController.java
|
||||
* @Description 健康咨询
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "健康咨询")
|
||||
@RestController
|
||||
@RequestMapping("seek-advice")
|
||||
public class SeekAdviceController {
|
||||
|
||||
@Autowired
|
||||
private ISickService sickService;
|
||||
|
||||
@Autowired
|
||||
private ISickSearchRecordService sickSearchRecordService;
|
||||
|
||||
/**
|
||||
* @description 医疗重疾类保险 健康咨询
|
||||
*/
|
||||
@PostMapping("sick-type")
|
||||
@ApiOperation(value = "疾病类型",notes = "疾病类型列表")
|
||||
public ResponseResult<List<DataDictVO>> findSickType() {
|
||||
return ResponseResultBuild.successBuild(sickService.findSickType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 疾病添加
|
||||
*/
|
||||
@ApiOperation(value = "添加疾病",notes = "添加疾病")
|
||||
@PostMapping("sick-add")
|
||||
public ResponseResult<SickVO> saveSick(@RequestBody SickVO sickVO) {
|
||||
return ResponseResultBuild.successBuild(sickService.save(sickVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 疾病搜索
|
||||
*/
|
||||
@ApiOperation(value = "疾病搜索",notes = "疾病搜索")
|
||||
@PostMapping("sick-search")
|
||||
public ResponseResult<List<SickVO>> searchSick(@RequestBody SickVO sickVO) {
|
||||
return ResponseResultBuild.successBuild(sickService.searchSick(sickVO.getSickKeyName(), SubjectContent.getUserVO()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 热搜榜
|
||||
* 默认查询30天内搜索次数最多的疾病
|
||||
*/
|
||||
@ApiOperation(value = "疾病热搜榜",notes = "30天内被搜索次数最多的疾病")
|
||||
@PostMapping("hot-sick-list")
|
||||
public ResponseResult<List<SickVO>> hotSickList() {
|
||||
return ResponseResultBuild.successBuild(sickSearchRecordService.hotSickList());
|
||||
}
|
||||
/**
|
||||
* @description 常见疾病
|
||||
* 默认查询30天内搜索次数最多的疾病
|
||||
*/
|
||||
@ApiOperation(value = "常见疾病",notes = "常见疾病")
|
||||
@PostMapping("common-diseases")
|
||||
public ResponseResult<List<SickVO>> commonDiseases() {
|
||||
return ResponseResultBuild.successBuild(sickService.commonDiseases());
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 医疗重疾类保险 健康咨询
|
||||
*/
|
||||
@PostMapping("seek-advice-from-health")
|
||||
@ApiOperation(value = "健康咨询",notes = "医疗重疾类保险:健康咨询")
|
||||
@ApiImplicitParam(name = "seekAdviceVO",value = "健康咨询传入对象",required = true,dataType = "SeekAdviceVO")
|
||||
public ResponseResult<QuestionTemplateVO> seekAdviceHealth(@RequestBody SeekAdviceVO seekAdviceVO) {
|
||||
|
||||
return ResponseResultBuild.successBuild(sickService.seekAdviceHealth(seekAdviceVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 提交问卷选项
|
||||
*/
|
||||
@PostMapping("submit-question-choose")
|
||||
@ApiOperation(value = "提交问卷选项",notes = "用户点击确认无误后,提交用户的选项")
|
||||
public ResponseResult<AdviceHealthDTO> submitQuestionChoose(@RequestBody AdviceHealthDTO healthTemplate) {
|
||||
return ResponseResultBuild.successBuild(sickService.submitQuestionChoose(healthTemplate));
|
||||
}
|
||||
|
||||
//=====================疾病数据导入=====================
|
||||
|
||||
@Autowired
|
||||
private DataExportService dataExportService;
|
||||
|
||||
/**
|
||||
* @description 提交问卷选项
|
||||
*/
|
||||
@PostMapping("data-input")
|
||||
public ResponseResult dataInport() {
|
||||
return ResponseResultBuild.successBuild(dataExportService.dataInport());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 数据修改
|
||||
*/
|
||||
@PostMapping("data-update")
|
||||
public ResponseResult dataUpdate() {
|
||||
return ResponseResultBuild.successBuild(dataExportService.dataUpdate());
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package com.itheima.sfbx.insurance.web;
|
||||
|
||||
import cn.hutool.json.JSON;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.itheima.sfbx.framework.commons.basic.ResponseResult;
|
||||
import com.itheima.sfbx.framework.commons.utils.ResponseResultBuild;
|
||||
import com.itheima.sfbx.framework.commons.utils.SubjectContent;
|
||||
import com.itheima.sfbx.insurance.dto.WorryFreeCustomerInfoVO;
|
||||
import com.itheima.sfbx.insurance.dto.WorryFreeInsuranceMatchVO;
|
||||
import com.itheima.sfbx.insurance.dto.WorryFreeRiskItemVO;
|
||||
import com.itheima.sfbx.insurance.dto.WorryFreeSafeguardQuotaVO;
|
||||
import com.itheima.sfbx.insurance.service.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* WorryFreeInsuranceController
|
||||
*
|
||||
* @author: wgl
|
||||
* @describe: 省心配controller
|
||||
* @date: 2022/12/28 10:10
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "省心配")
|
||||
@RestController
|
||||
@RequestMapping("worry-free-insurance")
|
||||
public class WorryFreeInsuranceController {
|
||||
|
||||
@Autowired
|
||||
private IWorryFreeInsuranceService worryFreeInsuranceService;
|
||||
|
||||
@Autowired
|
||||
private IRuleService ruleService;
|
||||
|
||||
@Autowired
|
||||
private IWorryFreeRiskItemService worryFreeRiskItemService;
|
||||
|
||||
@Autowired
|
||||
private IWorryFreeFlowNodeService worryFreeFlowNodeService;
|
||||
|
||||
@Autowired
|
||||
private IWorryFreeSafeguardQuotaService worryFreeSafeguardQuotaService;
|
||||
|
||||
@Autowired
|
||||
private IWorryFreeInsuranceMatchService worryFreeInsuranceMatchService;
|
||||
/**
|
||||
* 省心配首页
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/index")
|
||||
@ApiOperation(value = "省心配首页", notes = "省心配首页")
|
||||
public String index() {
|
||||
return "worryfree";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据当前登录人从redis中获取对应的风险项
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/flow-node/{customerInfoId}")
|
||||
@ApiOperation(value = "流程节点", notes = "流程节点")
|
||||
@ApiImplicitParam(paramType = "path",name = "customerInfoId",value = "用户信息ID",example = "1",dataType = "String")
|
||||
public ResponseResult<List<String>> flowNode(@PathVariable("customerInfoId") String customerInfoId) {
|
||||
//获取流程节点数据
|
||||
List<String> res = worryFreeFlowNodeService.flowNode(Long.valueOf(customerInfoId));
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据当前登录人从redis中获取对应的风险项
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/safeguard-assess/{customerInfoId}")
|
||||
@ApiOperation(value = "保障评估", notes = "保障评估")
|
||||
@ApiImplicitParam(paramType = "path",name = "customerInfoId",value = "用户信息ID",example = "1",dataType = "String")
|
||||
public ResponseResult<WorryFreeSafeguardQuotaVO> safeguardAssess(@PathVariable("customerInfoId") String customerInfoId) {
|
||||
WorryFreeSafeguardQuotaVO res = worryFreeSafeguardQuotaService.findSaferQuota(Long.valueOf(customerInfoId));
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据当前登录人从redis中获取对应的风险项
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/risk-analysis/{customerInfoId}")
|
||||
@ApiOperation(value = "风险分析", notes = "获取风险分析结果")
|
||||
@ApiImplicitParam(paramType = "path",name = "customerInfoId",value = "用户信息ID",example = "1",dataType = "String")
|
||||
public ResponseResult<List<WorryFreeRiskItemVO>> findMyRiskItem(@PathVariable("customerInfoId") String customerInfoId) {
|
||||
List<WorryFreeRiskItemVO> res = worryFreeRiskItemService.findMyRiskItem(Long.valueOf(customerInfoId));
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开始结算接口
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/do-calculate")
|
||||
@ApiOperation(value = "省心配核心:开始计算", notes = "省心配核心:开始计算")
|
||||
public ResponseResult<WorryFreeCustomerInfoVO> worryFree(@RequestBody WorryFreeCustomerInfoVO worryFreeCustomerInfoVO) {
|
||||
ruleService.buildBaseParams(worryFreeCustomerInfoVO);
|
||||
WorryFreeCustomerInfoVO res = ruleService.worryFreePairing(worryFreeCustomerInfoVO);
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推荐产品列表
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/product-list/{customerInfoId}")
|
||||
@ApiOperation(value = "省心配核心:获取推荐产品列表", notes = "省心配核心:获取推荐产品列表")
|
||||
@ApiImplicitParam(paramType = "path",name = "customerInfoId",value = "用户信息ID",example = "1",dataType = "String")
|
||||
public ResponseResult<List<WorryFreeInsuranceMatchVO>> productList(@PathVariable("customerInfoId") String customerInfoId) {
|
||||
List<WorryFreeInsuranceMatchVO> res = worryFreeInsuranceMatchService.productList(Long.valueOf(customerInfoId));
|
||||
return ResponseResultBuild.successBuild(res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
_ __ __
|
||||
(_) /__________ ______/ /_
|
||||
/ / __/ ___/ __ `/ ___/ __/
|
||||
/ / /_/ /__/ /_/ (__ ) /_
|
||||
/_/\__/\___/\__,_/____/\__/
|
||||
:: Spring Boot :: (v-2.7.10)
|
||||
:: Spring Cloud :: (v-2021.0.6)
|
||||
:: Spring Cloud Alibaba :: (v-2021.0.1.0)
|
||||
:: sfbx Cloud :: (v-2.0-SNAPSHOT)
|
||||
:: 传智教育---献给可爱的传智人 ::
|
||||
@@ -0,0 +1,57 @@
|
||||
#服务配置
|
||||
server:
|
||||
#端口
|
||||
port: 7065
|
||||
#服务编码
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
allow-circular-references: true
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
config:
|
||||
activate:
|
||||
on-profile:
|
||||
- test
|
||||
#应用配置
|
||||
application:
|
||||
#应用名称
|
||||
name: insurance-app
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: ${NACOS_ADDRESS:nacos-service.yjy-public-sfbx-java.svc.cluster.local:20015} # nacos注册中心
|
||||
group: SEATA_GROUP
|
||||
service: ${spring.application.name}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:PKsf*bxQ4;yP3a+}
|
||||
config:
|
||||
server-addr: ${NACOS_ADDRESS:nacos-service.yjy-public-sfbx-java.svc.cluster.local:20015} # nacos注册中心
|
||||
group: SEATA_GROUP
|
||||
file-extension: yml
|
||||
shared-configs: # 共享配置
|
||||
- data-id: shared-spring-seata.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-spring-task.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-redisson.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-mybatis-plus.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-stream-rabbit-basic.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:PKsf*bxQ4;yP3a+}
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
urule:
|
||||
resporityServerUrl: http://localhost:8090
|
||||
knowledgeUpdateCycle: 1
|
||||
@@ -0,0 +1,55 @@
|
||||
#服务配置
|
||||
server:
|
||||
#端口
|
||||
port: 7065
|
||||
#服务编码
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
allow-circular-references: true
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
profiles:
|
||||
active: dev
|
||||
#应用配置
|
||||
application:
|
||||
#应用名称
|
||||
name: insurance-app
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 192.168.12.129:8848 # nacos注册中心
|
||||
group: SEATA_GROUP
|
||||
service: ${spring.application.name}
|
||||
config:
|
||||
server-addr: 192.168.12.129:8848 # nacos配置中心地址
|
||||
group: SEATA_GROUP
|
||||
file-extension: yml
|
||||
shared-configs: # 共享配置
|
||||
- data-id: shared-spring-seata.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-spring-task.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-redisson.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-mybatis-plus.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-stream-rabbit-basic.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
- data-id: shared-stream-rabbit-source-warranty.yml #配置文件名-DataId
|
||||
group: SEATA_GROUP
|
||||
refresh: false
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
urule:
|
||||
resporityServerUrl: http://localhost:8090
|
||||
knowledgeUpdateCycle: 1
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false">
|
||||
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径 -->
|
||||
<property name="LOG_HOME" value="/data/logs/insurance-app" />
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}-%msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名 -->
|
||||
<FileNamePattern>${LOG_HOME}/insurance-app-01.log.%d{yyyy-MM-dd}.log
|
||||
</FileNamePattern>
|
||||
<!--日志文件保留天数 -->
|
||||
<MaxHistory>30</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}-%msg%n</pattern>
|
||||
</encoder>
|
||||
<!--日志文件最大的大小 -->
|
||||
<triggeringPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
||||
<MaxFileSize>10MB</MaxFileSize>
|
||||
</triggeringPolicy>
|
||||
</appender>
|
||||
<!-- show parameters for hibernate sql 专为 Hibernate 定制 -->
|
||||
<logger name="org.hibernate.type.descriptor.sql.BasicBinder"
|
||||
level="TRACE" />
|
||||
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor"
|
||||
level="DEBUG" />
|
||||
<logger name="org.hibernate.SQL" level="DEBUG" />
|
||||
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
|
||||
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
|
||||
|
||||
<!--myibatis log configure -->
|
||||
<logger name="com.apache.ibatis" level="TRACE" />
|
||||
<logger name="java.sql.Connection" level="DEBUG" />
|
||||
<logger name="java.sql.Statement" level="DEBUG" />
|
||||
<logger name="java.sql.PreparedStatement" level="DEBUG" />
|
||||
|
||||
<!-- 日志输出级别 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE" />
|
||||
</root>
|
||||
<!--日志异步到数据库 -->
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user