mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-26 20:49:37 +08:00
后端代码提交
This commit is contained in:
@@ -15,7 +15,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.springframework.web.filter.CorsFilter;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -16,7 +16,7 @@ import javax.sql.DataSource;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -35,18 +35,20 @@ public class DruidConfig {
|
||||
servletRegistrationBean.addInitParameter("loginUsername", "kf"); // 用户名
|
||||
servletRegistrationBean.addInitParameter("loginPassword", "654321"); // 密码
|
||||
servletRegistrationBean.addInitParameter("resetEnable", "true"); // 是否可以重置数据源
|
||||
return servletRegistrationBean ;
|
||||
return servletRegistrationBean;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean filterRegistrationBean() {
|
||||
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean() ;
|
||||
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
|
||||
filterRegistrationBean.setFilter(new WebStatFilter());
|
||||
|
||||
filterRegistrationBean.addUrlPatterns("/*"); // 所有请求进行监控处理
|
||||
//不必监控的请求
|
||||
filterRegistrationBean.addInitParameter("exclusions", "*.html,*.png,*.ico,*.js,*.gif,*.jpg,*.css,/druid/*");
|
||||
return filterRegistrationBean ;
|
||||
return filterRegistrationBean;
|
||||
}
|
||||
|
||||
@Bean("dataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource")
|
||||
public DataSource druidDataSource() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.math.BigDecimal;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -30,7 +30,7 @@ import static com.google.common.collect.Lists.newArrayList;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.springframework.web.servlet.handler.MappedInterceptor;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -76,19 +76,32 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
excludePathPatterns("/api/front/groom/list/**").
|
||||
excludePathPatterns("/api/front/config").
|
||||
excludePathPatterns("/api/front/category").
|
||||
excludePathPatterns("/api/front/categorybypid/*").
|
||||
excludePathPatterns("/api/front/seckill/*").
|
||||
excludePathPatterns("/api/front/seckill/list/*").
|
||||
excludePathPatterns("/api/front/seckill/detail/*").
|
||||
excludePathPatterns("/api/front/seckill/detail").
|
||||
excludePathPatterns("/api/front/ios/*").
|
||||
excludePathPatterns("/api/front/ios/register/binding/phone").
|
||||
excludePathPatterns("api/front/combination/index").
|
||||
excludePathPatterns("api/front/seckill/index").
|
||||
excludePathPatterns("api/front/bargain/index").
|
||||
excludePathPatterns("api/front/combination/index").
|
||||
excludePathPatterns("api/front/index/product/*").
|
||||
excludePathPatterns("api/front/index/color/config").
|
||||
excludePathPatterns("api/front/image/domain").
|
||||
excludePathPatterns("api/front/product/leaderboard").
|
||||
excludePathPatterns("/api/front/combination/index").
|
||||
excludePathPatterns("/api/front/seckill/index").
|
||||
excludePathPatterns("/api/front/bargain/index").
|
||||
excludePathPatterns("/api/front/bargain/header").
|
||||
excludePathPatterns("/api/front/bargain/detail").
|
||||
excludePathPatterns("/api/front/index/product/*").
|
||||
excludePathPatterns("/api/front/index/color/config").
|
||||
excludePathPatterns("/api/front/image/domain").
|
||||
excludePathPatterns("/api/front/product/leaderboard").
|
||||
excludePathPatterns("/api/front/product/byids/**").
|
||||
excludePathPatterns("/api/front/token/is/exist").
|
||||
excludePathPatterns("/api/front/login/config").
|
||||
excludePathPatterns("/api/front/copyright/info").
|
||||
excludePathPatterns("/api/front/get/bottom/navigation").
|
||||
excludePathPatterns("/api/front/agreement/**").
|
||||
excludePathPatterns("/api/front/pagediy/**").
|
||||
excludePathPatterns("/api/front/menu/user").
|
||||
excludePathPatterns("/api/front/combination/header").
|
||||
excludePathPatterns("/api/front/combination/detail").
|
||||
excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.response.ArticleResponse;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.model.article.Article;
|
||||
import com.zbkj.common.model.category.Category;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.ArticleResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.ArticleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.BargainFrontRequest;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.StoreBargainService;
|
||||
import com.zbkj.service.service.StoreBargainUserHelpService;
|
||||
import com.zbkj.service.service.StoreBargainUserService;
|
||||
@@ -22,7 +23,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -4,9 +4,9 @@ import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.CartNumRequest;
|
||||
import com.zbkj.common.request.CartRequest;
|
||||
import com.zbkj.common.request.CartResetRequest;
|
||||
import com.zbkj.common.response.CartInfoResponse;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.CartInfoResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.StoreCartService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.SystemCityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.model.combination.StoreCombination;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.StorePinkRequest;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.StoreCombinationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -19,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.StoreCouponFrontResponse;
|
||||
import com.zbkj.common.response.StoreCouponUserOrder;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.StoreCouponService;
|
||||
import com.zbkj.service.service.StoreCouponUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -23,7 +24,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -45,8 +46,9 @@ public class CouponController {
|
||||
|
||||
/**
|
||||
* 分页显示优惠券表
|
||||
* @param type 类型,1-通用,2-商品,3-品类
|
||||
* @param productId 产品id,搜索产品指定优惠券
|
||||
*
|
||||
* @param type 类型,1-通用,2-商品,3-品类
|
||||
* @param productId 产品id,搜索产品指定优惠券
|
||||
* @param pageParamRequest 分页参数
|
||||
*/
|
||||
@ApiOperation(value = "分页列表")
|
||||
@@ -57,14 +59,11 @@ public class CouponController {
|
||||
@ApiImplicitParam(name="page", value="页码", required = true),
|
||||
@ApiImplicitParam(name="limit", value="每页数量", required = true)
|
||||
})
|
||||
public CommonResult<List<StoreCouponFrontResponse>> getList(@RequestParam(value = "type", defaultValue = "0") int type,
|
||||
@RequestParam(value = "productId", defaultValue = "0") int productId, @Validated PageParamRequest pageParamRequest) {
|
||||
return CommonResult.success(storeCouponService.getH5List(type, productId, pageParamRequest));
|
||||
public CommonResult<CommonPage<StoreCouponFrontResponse>> getList(@RequestParam(value = "type", defaultValue = "0") int type,
|
||||
@RequestParam(value = "productId", defaultValue = "0") int productId, @Validated PageParamRequest pageParamRequest) {
|
||||
return CommonResult.success(CommonPage.restPage(storeCouponService.getH5List(type, productId, pageParamRequest)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据购物车id获取可用优惠券
|
||||
*/
|
||||
@ApiOperation(value = "当前订单可用优惠券")
|
||||
@RequestMapping(value = "coupons/order/{preOrderNo}", method = RequestMethod.GET)
|
||||
public CommonResult<List<StoreCouponUserOrder>> getCouponsListByPreOrderNo(@PathVariable String preOrderNo) {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.model.system.SystemConfig;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.CopyrightConfigInfoResponse;
|
||||
import com.zbkj.common.response.IndexInfoResponse;
|
||||
import com.zbkj.common.response.IndexProductResponse;
|
||||
import com.zbkj.common.response.pagelayout.PageLayoutBottomNavigationResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.front.service.IndexService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -27,7 +29,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -105,7 +107,19 @@ public class IndexController {
|
||||
@ApiOperation(value = "全局本地图片域名")
|
||||
@RequestMapping(value = "/image/domain", method = RequestMethod.GET)
|
||||
public CommonResult<String> getImageDomain() {
|
||||
return CommonResult.success(indexService.getImageDomain(), "成功");
|
||||
return CommonResult.success(indexService.getImageDomain());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取版权信息")
|
||||
@RequestMapping(value = "/copyright/info", method = RequestMethod.GET)
|
||||
public CommonResult<CopyrightConfigInfoResponse> getCopyrightInfo() {
|
||||
return CommonResult.success(indexService.getCopyrightInfo());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取底部导航信息")
|
||||
@RequestMapping(value = "/get/bottom/navigation", method = RequestMethod.GET)
|
||||
public CommonResult<PageLayoutBottomNavigationResponse> getBottomNavigation() {
|
||||
return CommonResult.success(indexService.getBottomNavigationInfo());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@ package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.request.LoginMobileRequest;
|
||||
import com.zbkj.common.request.LoginRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.response.LoginConfigResponse;
|
||||
import com.zbkj.common.response.LoginResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.front.service.LoginService;
|
||||
import com.zbkj.service.service.SmsService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -20,15 +21,15 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 用户登陆 前端控制器
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController("FrontLoginController")
|
||||
@@ -66,28 +67,41 @@ public class LoginController {
|
||||
*/
|
||||
@ApiOperation(value = "退出")
|
||||
@RequestMapping(value = "/logout", method = RequestMethod.GET)
|
||||
public CommonResult<String> loginOut(HttpServletRequest request){
|
||||
public CommonResult<String> loginOut(HttpServletRequest request) {
|
||||
loginService.loginOut(request);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信登录验证码
|
||||
*
|
||||
* @param phone 手机号码
|
||||
* @return 发送是否成功
|
||||
*/
|
||||
@ApiOperation(value = "发送短信登录验证码")
|
||||
@RequestMapping(value = "/sendCode", method = RequestMethod.POST)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="phone", value="手机号码", required = true)
|
||||
@ApiImplicitParam(name = "phone", value = "手机号码", required = true)
|
||||
})
|
||||
public CommonResult<Object> sendCode(@RequestParam String phone){
|
||||
if(smsService.sendCommonCode(phone)){
|
||||
public CommonResult<Object> sendCode(@RequestParam String phone) {
|
||||
if (smsService.sendCommonCode(phone)) {
|
||||
return CommonResult.success("发送成功");
|
||||
}else{
|
||||
} else {
|
||||
return CommonResult.failed("发送失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "校验token是否有效")
|
||||
@RequestMapping(value = "/token/is/exist", method = RequestMethod.POST)
|
||||
public CommonResult<Boolean> tokenIsExist() {
|
||||
return CommonResult.success(loginService.tokenIsExist());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取登录配置")
|
||||
@RequestMapping(value = "/login/config", method = RequestMethod.GET)
|
||||
public CommonResult<LoginConfigResponse> getLoginConfig() {
|
||||
return CommonResult.success(loginService.getLoginConfig());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.request.OrderPayRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.response.OrderPayResultResponse;
|
||||
import com.zbkj.common.response.PayConfigResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.service.service.OrderPayService;
|
||||
import com.zbkj.service.service.WeChatPayService;
|
||||
@@ -20,7 +21,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -39,6 +40,14 @@ public class PayController {
|
||||
@Autowired
|
||||
private OrderPayService orderPayService;
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "获取支付配置")
|
||||
@RequestMapping(value = "/get/config", method = RequestMethod.GET)
|
||||
public CommonResult<PayConfigResponse> getPayConfig() {
|
||||
return CommonResult.success(orderPayService.getPayConfig());
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单支付
|
||||
*/
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.zbkj.common.model.category.Category;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.ProductListRequest;
|
||||
import com.zbkj.common.request.ProductRequest;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.front.service.ProductService;
|
||||
import com.zbkj.service.service.CategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -24,7 +28,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -40,6 +44,9 @@ public class ProductController {
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
/**
|
||||
* 热门商品推荐
|
||||
*/
|
||||
@@ -67,6 +74,12 @@ public class ProductController {
|
||||
return CommonResult.success(productService.getCategory());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据pid获取子分类")
|
||||
@RequestMapping(value = "/categorybypid/{pid}", method = RequestMethod.GET)
|
||||
public CommonResult<List<Category>> getCategoryByPid(@PathVariable Integer pid) {
|
||||
return CommonResult.success(categoryService.getChildVoStatusOnListByPid(pid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@@ -141,6 +154,12 @@ public class ProductController {
|
||||
public CommonResult<List<StoreProduct>> getLeaderboard() {
|
||||
return CommonResult.success(productService.getLeaderboard());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据商品id集合查询对应商品")
|
||||
@RequestMapping(value = "/product/byids/{ids}", method = RequestMethod.GET)
|
||||
public CommonResult<List<IndexProductResponse>> getProductByIds(@PathVariable String ids) {
|
||||
return CommonResult.success(productService.getProductByIds(CrmebUtil.stringToArray(ids)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.exception.CrmebException;
|
||||
import com.zbkj.front.service.QrCodeService;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.QrCodeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,7 +19,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -2,7 +2,11 @@ package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.response.SecKillResponse;
|
||||
import com.zbkj.common.response.SeckillIndexResponse;
|
||||
import com.zbkj.common.response.StoreSecKillH5Response;
|
||||
import com.zbkj.common.response.StoreSeckillDetailResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.StoreSeckillService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -17,7 +21,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.zbkj.common.request.StoreNearRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.StoreNearRequest;
|
||||
import com.zbkj.common.response.StoreNearResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.SystemStoreService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zbkj.front.controller;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.*;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -21,7 +22,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -84,9 +85,11 @@ public class StoreOrderController {
|
||||
@ApiImplicitParams ({
|
||||
@ApiImplicitParam(name = "type", value = "评价等级|0=未支付,1=待发货,2=待收货,3=待评价,4=已完成,-3=售后/退款", required = true)
|
||||
})
|
||||
public CommonResult<CommonPage<OrderDetailResponse>> orderList(@RequestParam(name = "type") Integer type,
|
||||
@ModelAttribute PageParamRequest pageRequest) {
|
||||
return CommonResult.success(orderService.list(type, pageRequest));
|
||||
public CommonResult<CommonPage<OrderDetailResponse>> orderList(
|
||||
@RequestParam(name = "keywords", required = false) String keywords,
|
||||
@RequestParam(name = "type") Integer type,
|
||||
@ModelAttribute PageParamRequest pageRequest) {
|
||||
return CommonResult.success(CommonPage.restPage(orderService.list(keywords, type, pageRequest)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.vo.FileResultVo;
|
||||
import com.zbkj.service.service.UploadService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -23,7 +23,7 @@ import java.io.IOException;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -48,7 +48,7 @@ public class UploadFrontController {
|
||||
@ApiImplicitParam(name = "model", value = "模块 用户user,商品product,微信wechat,news文章"),
|
||||
@ApiImplicitParam(name = "pid", value = "分类ID 0编辑器,1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图,7前台用户,8微信系列 ", allowableValues = "range[0,1,2,3,4,5,6,7,8]")
|
||||
})
|
||||
public CommonResult<FileResultVo> image(MultipartFile multipart,@RequestParam(value = "model") String model,
|
||||
public CommonResult<FileResultVo> image(MultipartFile multipart, @RequestParam(value = "model") String model,
|
||||
@RequestParam(value = "pid") Integer pid) throws IOException {
|
||||
return CommonResult.success(uploadService.imageUpload(multipart, model, pid));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.model.user.UserAddress;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.UserAddressDelRequest;
|
||||
import com.zbkj.common.request.UserAddressRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.model.user.UserAddress;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.UserAddressService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.UserCollectAllRequest;
|
||||
import com.zbkj.common.request.UserCollectRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.UserRelationResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.StoreProductRelationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.model.system.SystemUserLevel;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.model.user.UserExperienceRecord;
|
||||
import com.zbkj.common.model.user.UserIntegralRecord;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.*;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.front.service.UserCenterService;
|
||||
import com.zbkj.service.service.SystemGroupDataService;
|
||||
import com.zbkj.service.service.UserService;
|
||||
@@ -30,7 +31,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -299,6 +300,7 @@ public class UserController {
|
||||
userService.bindSpread(spreadPid);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.UserCouponReceiveRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.UserCouponReceiveRequest;
|
||||
import com.zbkj.common.response.StoreCouponUserResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.service.service.StoreCouponUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -4,10 +4,10 @@ import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.UserRechargeRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.response.OrderPayResultResponse;
|
||||
import com.zbkj.common.response.UserRechargeBillRecordResponse;
|
||||
import com.zbkj.common.response.UserRechargeFrontResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.front.service.UserCenterService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -77,6 +77,16 @@ public class UserRechargeController {
|
||||
return CommonResult.success(userCenterService.recharge(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* App充值
|
||||
*/
|
||||
@ApiOperation(value = "App充值")
|
||||
@RequestMapping(value = "/wechat/app", method = RequestMethod.POST)
|
||||
public CommonResult<OrderPayResultResponse> weChatAppRecharge(HttpServletRequest httpServletRequest, @RequestBody @Validated UserRechargeRequest request) {
|
||||
request.setClientIp(CrmebUtil.getClientIp(httpServletRequest));
|
||||
return CommonResult.success(userCenterService.recharge(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 佣金转入余额
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.UserSignInfoResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.vo.SystemGroupDataSignConfigVo;
|
||||
import com.zbkj.common.vo.UserSignMonthVo;
|
||||
import com.zbkj.common.vo.UserSignVo;
|
||||
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -48,7 +48,7 @@ public class UserSignController {
|
||||
*/
|
||||
@ApiOperation(value = "分页列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public CommonResult<CommonPage<UserSignVo>> getList(@Validated PageParamRequest pageParamRequest) {
|
||||
public CommonResult<CommonPage<UserSignVo>> getList(@Validated PageParamRequest pageParamRequest) {
|
||||
CommonPage<UserSignVo> userSignCommonPage = CommonPage.restPage(userSignService.getList(pageParamRequest));
|
||||
return CommonResult.success(userSignCommonPage);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import com.zbkj.common.model.wechat.TemplateMessage;
|
||||
import com.zbkj.common.request.RegisterAppWxRequest;
|
||||
import com.zbkj.common.request.RegisterThirdUserRequest;
|
||||
import com.zbkj.common.request.WxBindingPhoneRequest;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.response.LoginResponse;
|
||||
import com.zbkj.common.response.WeChatJsSdkConfigResponse;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.front.service.UserCenterService;
|
||||
import com.zbkj.service.service.SystemNotificationService;
|
||||
import com.zbkj.service.service.WechatNewService;
|
||||
@@ -29,7 +29,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -54,7 +54,7 @@ public class WeChatController {
|
||||
/**
|
||||
* 通过微信code登录
|
||||
*/
|
||||
@ApiOperation(value = "微信登录公共号授权登录")
|
||||
@ApiOperation(value = "微信登录公众号授权登录")
|
||||
@RequestMapping(value = "/authorize/login", method = RequestMethod.GET)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "spread_spid", value = "推荐人id", dataType = "Integer"),
|
||||
@@ -74,6 +74,15 @@ public class WeChatController {
|
||||
return CommonResult.success(userCenterService.weChatAuthorizeProgramLogin(code, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信登录App授权登录
|
||||
*/
|
||||
@ApiOperation(value = "微信登录App授权登录")
|
||||
@RequestMapping(value = "/authorize/app/login", method = RequestMethod.POST)
|
||||
public CommonResult<LoginResponse> appLogin(@RequestBody @Validated RegisterAppWxRequest request){
|
||||
return CommonResult.success(userCenterService.appLogin(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信注册绑定手机号
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.zbkj.front.filter;
|
||||
|
||||
|
||||
import com.zbkj.common.config.CrmebConfig;
|
||||
import com.zbkj.common.utils.RequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -14,7 +16,7 @@ import java.nio.charset.StandardCharsets;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -25,6 +27,9 @@ import java.nio.charset.StandardCharsets;
|
||||
//@Component
|
||||
public class ResponseFilter implements Filter {
|
||||
|
||||
@Autowired
|
||||
CrmebConfig crmebConfig;
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
|
||||
throws IOException, ServletException {
|
||||
@@ -38,7 +43,7 @@ public class ResponseFilter implements Filter {
|
||||
|
||||
try {
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
str = new ResponseRouter().filter(str, RequestUtil.getUri(req));
|
||||
str = new ResponseRouter().filter(str, RequestUtil.getUri(req), crmebConfig);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package com.zbkj.front.filter;
|
||||
|
||||
import com.zbkj.common.config.CrmebConfig;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.constants.UploadConstants;
|
||||
import com.zbkj.common.utils.SpringUtil;
|
||||
import com.zbkj.service.service.SystemAttachmentService;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.PathMatcher;
|
||||
|
||||
/**
|
||||
* response路径处理
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -18,23 +22,34 @@ import com.zbkj.service.service.SystemAttachmentService;
|
||||
*/
|
||||
public class ResponseRouter {
|
||||
|
||||
public String filter(String data, String path) {
|
||||
public String filter(String data, String path, CrmebConfig crmebConfig) {
|
||||
boolean result = un().contains(path);
|
||||
if (result) {
|
||||
return data;
|
||||
}
|
||||
|
||||
//系统不用过滤的URL,针对数据而非token
|
||||
PathMatcher pathMatcher = new AntPathMatcher();
|
||||
for (String configUrl : crmebConfig.getIgnored()) {
|
||||
if(pathMatcher.match(path, configUrl)){
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
if (!path.contains("api/admin/") && !path.contains("api/front/")) {
|
||||
return data;
|
||||
}
|
||||
|
||||
//根据需要处理返回值
|
||||
if (data.contains(Constants.UPLOAD_TYPE_IMAGE+"/") && !data.contains("data:image/png;base64")) {
|
||||
data = SpringUtil.getBean(SystemAttachmentService.class).prefixImage(data);
|
||||
}
|
||||
|
||||
if (data.contains("file/")) {
|
||||
data = SpringUtil.getBean(SystemAttachmentService.class).prefixFile(data);
|
||||
if ((data.contains(UploadConstants.UPLOAD_FILE_KEYWORD+"/") && !data.contains("data:image/png;base64"))
|
||||
|| data.contains(UploadConstants.DOWNLOAD_FILE_KEYWORD) || data.contains(UploadConstants.UPLOAD_AFTER_FILE_KEYWORD)) {
|
||||
if (data.contains(UploadConstants.DOWNLOAD_FILE_KEYWORD+"/"+Constants.UPLOAD_MODEL_PATH_EXCEL)) {
|
||||
data = SpringUtil.getBean(SystemAttachmentService.class).prefixFile(data);
|
||||
} else if(data.contains(UploadConstants.UPLOAD_AFTER_FILE_KEYWORD+"/")) {
|
||||
data = SpringUtil.getBean(SystemAttachmentService.class).prefixUploadf(data);
|
||||
} else {
|
||||
data = SpringUtil.getBean(SystemAttachmentService.class).prefixImage(data);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.io.IOException;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.zbkj.front.interceptor;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.result.CommonResultCode;
|
||||
import com.zbkj.common.token.FrontTokenComponent;
|
||||
import com.zbkj.common.utils.RequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -16,7 +17,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -38,13 +39,13 @@ public class FrontTokenInterceptor implements HandlerInterceptor {
|
||||
if(result){
|
||||
return true;
|
||||
}
|
||||
response.getWriter().write(JSONObject.toJSONString(CommonResult.unauthorized()));
|
||||
response.getWriter().write(JSONObject.toJSONString(CommonResult.failed(CommonResultCode.UNAUTHORIZED)));
|
||||
return false;
|
||||
}
|
||||
|
||||
Boolean result = frontTokenComponent.check(token, request);
|
||||
if(!result){
|
||||
response.getWriter().write(JSONObject.toJSONString(CommonResult.unauthorized()));
|
||||
response.getWriter().write(JSONObject.toJSONString(CommonResult.failed(CommonResultCode.PERMISSION_EXPIRATION)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.zbkj.front.pub;
|
||||
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.utils.ImageMergeUtil;
|
||||
import com.zbkj.common.vo.ImageMergeUtilVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 图片操作
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/public/qrcode")
|
||||
@Api(tags = "图片操作")
|
||||
public class ImageMergeController {
|
||||
|
||||
@ApiOperation(value = "合并图片返回文件")
|
||||
@RequestMapping(value = "/mergeList", method = RequestMethod.POST)
|
||||
public CommonResult<Map<String, String>> mergeList(@RequestBody @Validated List<ImageMergeUtilVo> list){
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("base64Code", ImageMergeUtil.drawWordFile(list)); //需要云服务域名,如果需要存入数据库参照上传图片服务
|
||||
return CommonResult.success(map);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zbkj.front.pub;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zbkj.common.response.CommonResult;
|
||||
import com.zbkj.common.result.CommonResult;
|
||||
import com.zbkj.common.utils.RestTemplateUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.zbkj.front.service;
|
||||
|
||||
import com.zbkj.common.model.system.SystemConfig;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.response.CopyrightConfigInfoResponse;
|
||||
import com.zbkj.common.response.IndexInfoResponse;
|
||||
import com.zbkj.common.response.IndexProductResponse;
|
||||
import com.zbkj.common.response.pagelayout.PageLayoutBottomNavigationResponse;
|
||||
import com.zbkj.common.vo.MyRecord;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.model.system.SystemConfig;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -15,7 +17,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -66,4 +68,14 @@ public interface IndexService{
|
||||
* @return String
|
||||
*/
|
||||
String getImageDomain();
|
||||
|
||||
/**
|
||||
* 获取公司版权图片
|
||||
*/
|
||||
CopyrightConfigInfoResponse getCopyrightInfo();
|
||||
|
||||
/**
|
||||
* 获取底部导航信息
|
||||
*/
|
||||
PageLayoutBottomNavigationResponse getBottomNavigationInfo();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zbkj.front.service;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.request.LoginMobileRequest;
|
||||
import com.zbkj.common.request.LoginRequest;
|
||||
import com.zbkj.common.response.LoginConfigResponse;
|
||||
import com.zbkj.common.response.LoginResponse;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -12,7 +13,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -23,6 +24,7 @@ public interface LoginService {
|
||||
|
||||
/**
|
||||
* 账号密码登录
|
||||
*
|
||||
* @return LoginResponse
|
||||
*/
|
||||
LoginResponse login(LoginRequest loginRequest);
|
||||
@@ -34,7 +36,8 @@ public interface LoginService {
|
||||
|
||||
/**
|
||||
* 老绑定分销关系
|
||||
* @param user User 用户user类
|
||||
*
|
||||
* @param user User 用户user类
|
||||
* @param spreadUid Integer 推广人id
|
||||
* @return Boolean
|
||||
*/
|
||||
@@ -42,7 +45,20 @@ public interface LoginService {
|
||||
|
||||
/**
|
||||
* 推出登录
|
||||
*
|
||||
* @param request HttpServletRequest
|
||||
*/
|
||||
void loginOut(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 校验token是否有效
|
||||
*
|
||||
* @return true 有效, false 无效
|
||||
*/
|
||||
Boolean tokenIsExist();
|
||||
|
||||
/**
|
||||
* 获取登录配置
|
||||
*/
|
||||
LoginConfigResponse getLoginConfig();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -103,4 +103,11 @@ public interface ProductService {
|
||||
* @return List
|
||||
*/
|
||||
List<StoreProduct> getLeaderboard();
|
||||
|
||||
/**
|
||||
* 根据商品id集合 加载对应商品
|
||||
* @param proIdList id集合
|
||||
* @return id集合对应的商品列表
|
||||
*/
|
||||
List<IndexProductResponse> getProductByIds(List<Integer> proIdList);
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.zbkj.front.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* QrCodeService 接口
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
public interface QrCodeService {
|
||||
|
||||
/**
|
||||
* 获取二维码
|
||||
* @return CommonResult
|
||||
*/
|
||||
Map<String, Object> get(JSONObject data);
|
||||
|
||||
/**
|
||||
* 远程图片转base64
|
||||
* @param url 图片链接地址
|
||||
*/
|
||||
Map<String, Object> base64(String url);
|
||||
|
||||
/**
|
||||
* 将字符串 转base64
|
||||
* @param text 字符串
|
||||
* @param width 宽
|
||||
* @param height 高
|
||||
*/
|
||||
Map<String, Object> base64String(String text,int width, int height);
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.zbkj.front.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.model.system.SystemUserLevel;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.model.user.UserExperienceRecord;
|
||||
import com.zbkj.common.model.user.UserIntegralRecord;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.request.*;
|
||||
import com.zbkj.common.response.*;
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -180,6 +180,13 @@ public interface UserCenterService extends IService<User> {
|
||||
*/
|
||||
List<UserIntegralRecord> getUserIntegralRecordList(PageParamRequest pageParamRequest);
|
||||
|
||||
/**
|
||||
* 微信app登录
|
||||
* @param request 请求参数
|
||||
* @return 登录响应体
|
||||
*/
|
||||
LoginResponse appLogin(RegisterAppWxRequest request);
|
||||
|
||||
/**
|
||||
* 获取用户积分信息
|
||||
* @return IntegralUserResponse
|
||||
@@ -204,4 +211,5 @@ public interface UserCenterService extends IService<User> {
|
||||
* @return UserSpreadPeopleResponse
|
||||
*/
|
||||
UserSpreadPeopleResponse getSpreadPeopleCount();
|
||||
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.response.CopyrightConfigInfoResponse;
|
||||
import com.zbkj.common.response.IndexInfoResponse;
|
||||
import com.zbkj.common.response.IndexProductResponse;
|
||||
import com.zbkj.common.response.ProductActivityItemResponse;
|
||||
import com.zbkj.common.response.pagelayout.PageLayoutBottomNavigationResponse;
|
||||
import com.zbkj.common.vo.MyRecord;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
@@ -35,7 +37,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -63,6 +65,9 @@ public class IndexServiceImpl implements IndexService {
|
||||
@Autowired
|
||||
private UserVisitRecordService userVisitRecordService;
|
||||
|
||||
@Autowired
|
||||
private ActivityStyleService activityStyleService;
|
||||
|
||||
/**
|
||||
* 首页数据
|
||||
* banner、金刚区、广告位
|
||||
@@ -78,6 +83,7 @@ public class IndexServiceImpl implements IndexService {
|
||||
indexInfoResponse.setYzfUrl(systemConfigService.getValueByKey(Constants.CONFIG_KEY_YZF_H5_URL));// 云智服H5 url
|
||||
indexInfoResponse.setConsumerHotline(systemConfigService.getValueByKey(Constants.CONFIG_KEY_CONSUMER_HOTLINE));// 客服电话
|
||||
indexInfoResponse.setTelephoneServiceSwitch(systemConfigService.getValueByKey(Constants.CONFIG_KEY_TELEPHONE_SERVICE_SWITCH));// 客服电话服务
|
||||
indexInfoResponse.setWxChatIndependent(systemConfigService.getValueByKey(Constants.CONFIG_KEY_WX_CHAT_INDEPENDENT));
|
||||
indexInfoResponse.setCategoryPageConfig(systemConfigService.getValueByKey(Constants.CONFIG_CATEGORY_CONFIG));// 商品分类页配置
|
||||
indexInfoResponse.setIsShowCategory(systemConfigService.getValueByKey(Constants.CONFIG_IS_SHOW_CATEGORY));// 是否隐藏一级分类
|
||||
indexInfoResponse.setExplosiveMoney(systemGroupDataService.getListMapByGid(Constants.GROUP_DATA_ID_INDEX_EX_BANNER));//首页超值爆款
|
||||
@@ -138,6 +144,10 @@ public class IndexServiceImpl implements IndexService {
|
||||
if(CollUtil.isEmpty(storeProductList)) {
|
||||
return CommonPage.restPage(new ArrayList<>());
|
||||
}
|
||||
|
||||
// 查询活动边框配置信息, 并赋值给商品response 重复添加的商品数据会根据数据添加持续覆盖后的为准
|
||||
storeProductList = activityStyleService.makeActivityBorderStyle(storeProductList);
|
||||
|
||||
CommonPage<StoreProduct> storeProductCommonPage = CommonPage.restPage(storeProductList);
|
||||
|
||||
List<IndexProductResponse> productResponseArrayList = new ArrayList<>();
|
||||
@@ -184,6 +194,7 @@ public class IndexServiceImpl implements IndexService {
|
||||
BeanUtils.copyProperties(storeProduct, productResponse);
|
||||
productResponseArrayList.add(productResponse);
|
||||
}
|
||||
|
||||
CommonPage<IndexProductResponse> productResponseCommonPage = CommonPage.restPage(productResponseArrayList);
|
||||
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
|
||||
return productResponseCommonPage;
|
||||
@@ -195,7 +206,7 @@ public class IndexServiceImpl implements IndexService {
|
||||
*/
|
||||
@Override
|
||||
public SystemConfig getColorConfig() {
|
||||
return systemConfigService.getColorConfig();
|
||||
return systemConfigService.getChangeColor();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,5 +233,31 @@ public class IndexServiceImpl implements IndexService {
|
||||
String localUploadUrl = systemConfigService.getValueByKey("localUploadUrl");
|
||||
return StrUtil.isBlank(localUploadUrl) ? "" : localUploadUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公司版权图片
|
||||
*/
|
||||
@Override
|
||||
public CopyrightConfigInfoResponse getCopyrightInfo() {
|
||||
String copyrightCompanyImage = systemConfigService.getValueByKey(SysConfigConstants.CONFIG_COPYRIGHT_COMPANY_IMAGE);
|
||||
String copyrightCompanyName = systemConfigService.getValueByKey(SysConfigConstants.CONFIG_COPYRIGHT_COMPANY_INFO);
|
||||
CopyrightConfigInfoResponse response = new CopyrightConfigInfoResponse();
|
||||
response.setCompanyName(copyrightCompanyName);
|
||||
response.setCompanyImage(copyrightCompanyImage);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取底部导航信息
|
||||
*/
|
||||
@Override
|
||||
public PageLayoutBottomNavigationResponse getBottomNavigationInfo() {
|
||||
String isCustom = systemConfigService.getValueByKey(Constants.CONFIG_BOTTOM_NAVIGATION_IS_CUSTOM);
|
||||
List<HashMap<String, Object>> bnList = systemGroupDataService.getListMapByGid(Constants.GROUP_DATA_ID_BOTTOM_NAVIGATION);
|
||||
PageLayoutBottomNavigationResponse response = new PageLayoutBottomNavigationResponse();
|
||||
response.setIsCustom(isCustom);
|
||||
response.setBottomNavigationList(bnList);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package com.zbkj.front.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.constants.SmsConstants;
|
||||
import com.zbkj.common.exception.CrmebException;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.request.LoginMobileRequest;
|
||||
import com.zbkj.common.request.LoginRequest;
|
||||
import com.zbkj.common.response.LoginConfigResponse;
|
||||
import com.zbkj.common.response.LoginResponse;
|
||||
import com.zbkj.common.token.FrontTokenComponent;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.utils.DateUtil;
|
||||
import com.zbkj.common.utils.CrmebDateUtil;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.front.service.LoginService;
|
||||
import com.zbkj.service.service.SystemConfigService;
|
||||
import com.zbkj.service.service.UserService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -28,7 +32,7 @@ import java.util.Optional;
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -51,6 +55,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
|
||||
@Autowired
|
||||
private FrontTokenComponent tokenComponent;
|
||||
@Autowired
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
/**
|
||||
* 账号密码登录
|
||||
@@ -83,7 +89,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
}
|
||||
|
||||
// 记录最后一次登录时间
|
||||
user.setLastLoginTime(DateUtil.nowDateTime());
|
||||
user.setLastLoginTime(CrmebDateUtil.nowDateTime());
|
||||
user.setUpdateTime(DateUtil.date());
|
||||
userService.updateById(user);
|
||||
|
||||
loginResponse.setUid(user.getUid());
|
||||
@@ -116,7 +123,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
bindSpread(user, spreadPid);
|
||||
}
|
||||
// 记录最后一次登录时间
|
||||
user.setLastLoginTime(DateUtil.nowDateTime());
|
||||
user.setLastLoginTime(CrmebDateUtil.nowDateTime());
|
||||
user.setUpdateTime(DateUtil.date());
|
||||
boolean b = userService.updateById(user);
|
||||
if (!b) {
|
||||
logger.error("用户登录时,记录最后一次登录时间出错,uid = " + user.getUid());
|
||||
@@ -170,7 +178,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
if (!checkBingSpread) return false;
|
||||
|
||||
user.setSpreadUid(spreadUid);
|
||||
user.setSpreadTime(DateUtil.nowDateTime());
|
||||
user.setSpreadTime(CrmebDateUtil.nowDateTime());
|
||||
user.setUpdateTime(DateUtil.date());
|
||||
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
userService.updateById(user);
|
||||
@@ -185,10 +194,39 @@ public class LoginServiceImpl implements LoginService {
|
||||
|
||||
/**
|
||||
* 推出登录
|
||||
*
|
||||
* @param request HttpServletRequest
|
||||
*/
|
||||
@Override
|
||||
public void loginOut(HttpServletRequest request) {
|
||||
tokenComponent.logout(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验token是否有效
|
||||
*
|
||||
* @return true 有效, false 无效
|
||||
*/
|
||||
@Override
|
||||
public Boolean tokenIsExist() {
|
||||
Integer userId = userService.getUserId();
|
||||
return userId > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录配置
|
||||
*/
|
||||
@Override
|
||||
public LoginConfigResponse getLoginConfig() {
|
||||
String routinePhoneVerification = systemConfigService.getValueByKey(Constants.WECHAT_ROUTINE_PHONE_VERIFICATION);
|
||||
String publicLoginType = systemConfigService.getValueByKey(Constants.WECHAT_PUBLIC_LOGIN_TYPE);
|
||||
String mobileLoginLogo = systemConfigService.getValueByKey(Constants.CONFIG_KEY_MOBILE_LOGIN_LOGO);
|
||||
String siteName = systemConfigService.getValueByKey(Constants.CONFIG_KEY_SITE_NAME);
|
||||
LoginConfigResponse response = new LoginConfigResponse();
|
||||
response.setPublicLoginType(publicLoginType);
|
||||
response.setRoutinePhoneVerification(routinePhoneVerification);
|
||||
response.setMobileLoginLogo(mobileLoginLogo);
|
||||
response.setSiteName(siteName);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,26 +4,23 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.constants.CategoryConstants;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.constants.RedisConstatns;
|
||||
import com.zbkj.common.constants.SysConfigConstants;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.model.product.StoreProductAttr;
|
||||
import com.zbkj.common.model.product.StoreProductAttrValue;
|
||||
import com.zbkj.common.model.record.UserVisitRecord;
|
||||
import com.zbkj.common.model.system.SystemUserLevel;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.constants.*;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.ProductListRequest;
|
||||
import com.zbkj.common.request.ProductRequest;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.vo.MyRecord;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.common.vo.MyRecord;
|
||||
import com.zbkj.common.model.record.UserVisitRecord;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.model.product.StoreProductAttr;
|
||||
import com.zbkj.common.model.product.StoreProductAttrValue;
|
||||
import com.zbkj.common.model.system.SystemUserLevel;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.front.service.ProductService;
|
||||
import com.zbkj.service.delete.ProductUtils;
|
||||
import com.zbkj.service.service.*;
|
||||
@@ -36,13 +33,14 @@ import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* IndexServiceImpl 接口实现
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
@@ -91,6 +89,9 @@ public class ProductServiceImpl implements ProductService {
|
||||
@Autowired
|
||||
private UserVisitRecordService userVisitRecordService;
|
||||
|
||||
@Autowired
|
||||
private ActivityStyleService activityStyleService;
|
||||
|
||||
/**
|
||||
* 获取分类
|
||||
* @return List<CategoryTreeVo>
|
||||
@@ -121,6 +122,9 @@ public class ProductServiceImpl implements ProductService {
|
||||
}
|
||||
CommonPage<StoreProduct> storeProductCommonPage = CommonPage.restPage(storeProductList);
|
||||
|
||||
// 查询活动边框配置信息, 并赋值给商品response 重复添加的商品数据会根据数据添加持续覆盖后的为准
|
||||
storeProductList = activityStyleService.makeActivityBorderStyle(storeProductList);
|
||||
|
||||
List<IndexProductResponse> productResponseArrayList = new ArrayList<>();
|
||||
for (StoreProduct storeProduct : storeProductList) {
|
||||
IndexProductResponse productResponse = new IndexProductResponse();
|
||||
@@ -188,8 +192,12 @@ public class ProductServiceImpl implements ProductService {
|
||||
ProductDetailResponse productDetailResponse = new ProductDetailResponse();
|
||||
// 查询商品
|
||||
StoreProduct storeProduct = storeProductService.getH5Detail(id);
|
||||
// 查询活动边框配置信息, 并赋值给商品response 重复添加的商品数据会根据数据添加持续覆盖后的为准
|
||||
storeProduct.setActivityStyle(activityStyleService.makeActivityBackgroundStyle(storeProduct));
|
||||
|
||||
if (ObjectUtil.isNotNull(userLevel)) {
|
||||
storeProduct.setVipPrice(storeProduct.getPrice());
|
||||
BigDecimal vipPrice = storeProduct.getPrice().multiply(new BigDecimal(userLevel.getDiscount())).divide(new BigDecimal(100), 2 ,BigDecimal.ROUND_HALF_UP);
|
||||
storeProduct.setVipPrice(vipPrice);
|
||||
}
|
||||
productDetailResponse.setProductInfo(storeProduct);
|
||||
|
||||
@@ -206,7 +214,8 @@ public class ProductServiceImpl implements ProductService {
|
||||
BeanUtils.copyProperties(storeProductAttrValue, atr);
|
||||
// 设置会员价
|
||||
if (ObjectUtil.isNotNull(userLevel)) {
|
||||
atr.setVipPrice(atr.getPrice());
|
||||
BigDecimal vipPrice = atr.getPrice().multiply(new BigDecimal(userLevel.getDiscount())).divide(new BigDecimal(100), 2 ,BigDecimal.ROUND_HALF_UP);
|
||||
atr.setVipPrice(vipPrice);
|
||||
}
|
||||
skuMap.put(atr.getSuk(), atr);
|
||||
}
|
||||
@@ -239,6 +248,11 @@ public class ProductServiceImpl implements ProductService {
|
||||
updateProduct.setBrowse(storeProduct.getBrowse() + 1);
|
||||
storeProductService.updateById(updateProduct);
|
||||
|
||||
// 商品浏览量统计(每日/商城)
|
||||
String yesterdayStr = DateUtil.date().toString(Constants.DATE_FORMAT_DATE);
|
||||
redisUtil.incrAndCreate(RedisConstatns.PRO_PAGE_VIEW_KEY + yesterdayStr);
|
||||
// 商品浏览量统计(每日/个体)
|
||||
redisUtil.incrAndCreate(StrUtil.format(RedisConstatns.PRO_PRO_PAGE_VIEW_KEY, yesterdayStr, id));
|
||||
// 保存用户访问记录
|
||||
if (userService.getUserId() > 0) {
|
||||
UserVisitRecord visitRecord = new UserVisitRecord();
|
||||
@@ -370,6 +384,10 @@ public class ProductServiceImpl implements ProductService {
|
||||
if (CollUtil.isEmpty(storeProductList)) {
|
||||
return CommonPage.restPage(new ArrayList<>());
|
||||
}
|
||||
|
||||
// 查询活动边框配置信息, 并赋值给商品response 重复添加的商品数据会根据数据添加持续覆盖后的为准
|
||||
storeProductList = activityStyleService.makeActivityBorderStyle(storeProductList);
|
||||
|
||||
CommonPage<StoreProduct> storeProductCommonPage = CommonPage.restPage(storeProductList);
|
||||
|
||||
List<IndexProductResponse> productResponseArrayList = new ArrayList<>();
|
||||
@@ -538,5 +556,55 @@ public class ProductServiceImpl implements ProductService {
|
||||
return storeProductService.getLeaderboard();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据商品id集合 加载对应商品
|
||||
*
|
||||
* @param proIdList id集合
|
||||
* @return id集合对应的商品列表
|
||||
*/
|
||||
@Override
|
||||
public List<IndexProductResponse> getProductByIds(List<Integer> proIdList) {
|
||||
List<StoreProduct> byIdsAndLabel = storeProductService.findByIds(proIdList, "front");
|
||||
List<IndexProductResponse> productFrontResponses = byIdsAndLabel.stream().map(productItem -> {
|
||||
IndexProductResponse response = new IndexProductResponse();
|
||||
BeanUtils.copyProperties(productItem, response);
|
||||
return response;
|
||||
}).collect(Collectors.toList());
|
||||
productFrontResponses.forEach(e -> {
|
||||
// 评论总数
|
||||
Integer sumCount = storeProductReplyService.getCountByScore(e.getId(), ProductConstants.PRODUCT_REPLY_TYPE_ALL);
|
||||
// 好评总数
|
||||
Integer goodCount = storeProductReplyService.getCountByScore(e.getId(), ProductConstants.PRODUCT_REPLY_TYPE_GOOD);
|
||||
|
||||
|
||||
String replyChance = "0";
|
||||
if (sumCount > 0 && goodCount > 0) {
|
||||
replyChance = String.format("%.2f", ((goodCount.doubleValue() / sumCount.doubleValue())));
|
||||
}
|
||||
e.setReplyNum(sumCount);
|
||||
e.setPositiveRatio(replyChance);
|
||||
e.setSales(e.getSales() + e.getFicti());
|
||||
});
|
||||
|
||||
// 查询活动边框配置信息, 并赋值给商品response 重复添加的商品数据会根据数据添加持续覆盖后的为准
|
||||
List<StoreProduct> products = new ArrayList<>();
|
||||
productFrontResponses.forEach(response -> {
|
||||
StoreProduct product = new StoreProduct();
|
||||
BeanUtils.copyProperties(response, product);
|
||||
products.add(product);
|
||||
});
|
||||
List<StoreProduct> makeProductList = activityStyleService.makeActivityBorderStyle(products);
|
||||
|
||||
makeProductList.forEach(p -> {
|
||||
productFrontResponses.stream().map(resProduct -> {
|
||||
if (p.getId().equals(resProduct.getId())) {
|
||||
resProduct.setActivityStyle(p.getActivityStyle());
|
||||
}
|
||||
return resProduct;
|
||||
}).collect(Collectors.toList());
|
||||
});
|
||||
return productFrontResponses;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
package com.zbkj.front.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zbkj.common.exception.CrmebException;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.utils.QRCodeUtil;
|
||||
import com.zbkj.common.utils.RestTemplateUtil;
|
||||
import com.zbkj.front.service.QrCodeService;
|
||||
import com.zbkj.service.service.WechatNewService;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* QrCodeServiceImpl 接口实现
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Service
|
||||
public class QrCodeServiceImpl implements QrCodeService {
|
||||
// @Autowired
|
||||
// private WeChatService weChatService;
|
||||
|
||||
@Autowired
|
||||
private RestTemplateUtil restTemplateUtil;
|
||||
@Autowired
|
||||
private WechatNewService wechatNewService;
|
||||
|
||||
/**
|
||||
* 二维码
|
||||
* @return Object
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> get(JSONObject data) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
StringBuilder scene = new StringBuilder();
|
||||
String page = "";
|
||||
try{
|
||||
if(null != data){
|
||||
Map<Object, Object> dataMap = JSONObject.toJavaObject(data, Map.class);
|
||||
|
||||
for (Map.Entry<Object, Object> m : dataMap.entrySet()) {
|
||||
if("path".equals(m.getKey())){
|
||||
//前端路由, 不需要拼参数
|
||||
page = m.getValue().toString();
|
||||
continue;
|
||||
}
|
||||
if (scene.length() > 0) {
|
||||
scene.append(",");
|
||||
}
|
||||
scene.append(m.getKey()).append(":").append(m.getValue());
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new CrmebException("url参数错误 " + e.getMessage());
|
||||
}
|
||||
map.put("code", wechatNewService.createQrCode(page, scene.length() > 0 ? scene.toString() : ""));
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> base64(String url) {
|
||||
byte[] bytes = restTemplateUtil.getBuffer(url);
|
||||
String base64Image = CrmebUtil.getBase64Image(Base64.encodeBase64String(bytes));
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("code", base64Image);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 讲字符串转为QRcode
|
||||
* @param text 待转换字符串
|
||||
* @return QRcode base64格式
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> base64String(String text,int width, int height) {
|
||||
|
||||
String base64Image = null;
|
||||
try {
|
||||
base64Image = QRCodeUtil.crateQRCode(text,width,height);
|
||||
}catch (Exception e){
|
||||
throw new CrmebException("生成二维码异常");
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("code", base64Image);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zbkj.front.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -29,7 +30,6 @@ import com.zbkj.front.service.LoginService;
|
||||
import com.zbkj.front.service.UserCenterService;
|
||||
import com.zbkj.service.dao.UserDao;
|
||||
import com.zbkj.service.service.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -45,15 +46,15 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户中心 服务实现类
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Service
|
||||
public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements UserCenterService {
|
||||
@@ -120,6 +121,8 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
@Autowired
|
||||
private FrontTokenComponent tokenComponent;
|
||||
|
||||
@Autowired
|
||||
private SCRMUtils scrmUtils;
|
||||
|
||||
/**
|
||||
* 推广数据接口(昨天的佣金 累计提现金额 当前佣金)
|
||||
@@ -141,6 +144,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 推广佣金/提现总和
|
||||
*
|
||||
* @return BigDecimal
|
||||
*/
|
||||
@Override
|
||||
@@ -155,7 +159,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
//累计提现
|
||||
if (type == 4) {
|
||||
return userExtractService.getWithdrawn(null,null);
|
||||
return userExtractService.getWithdrawn(null, null);
|
||||
}
|
||||
|
||||
return BigDecimal.ZERO;
|
||||
@@ -163,45 +167,47 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 提现申请
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
@Override
|
||||
public Boolean extractCash(UserExtractRequest request) {
|
||||
switch (request.getExtractType()) {
|
||||
case "weixin":
|
||||
if (StringUtils.isBlank(request.getWechat())) {
|
||||
throw new CrmebException("请填写微信号!");
|
||||
if (StrUtil.isBlank(request.getWechat())) {
|
||||
throw new CrmebException("请填写微信号!");
|
||||
}
|
||||
request.setAlipayCode(null);
|
||||
request.setBankCode(null);
|
||||
request.setBankName(null);
|
||||
break;
|
||||
case "alipay":
|
||||
if (StringUtils.isBlank(request.getAlipayCode())) {
|
||||
throw new CrmebException("请填写支付宝账号!");
|
||||
if (StrUtil.isBlank(request.getAlipayCode())) {
|
||||
throw new CrmebException("请填写支付宝账号!");
|
||||
}
|
||||
request.setWechat(null);
|
||||
request.setBankCode(null);
|
||||
request.setBankName(null);
|
||||
break;
|
||||
case "bank":
|
||||
if (StringUtils.isBlank(request.getBankName())) {
|
||||
throw new CrmebException("请填写银行名称!");
|
||||
if (StrUtil.isBlank(request.getBankName())) {
|
||||
throw new CrmebException("请填写银行名称!");
|
||||
}
|
||||
if (StringUtils.isBlank(request.getBankCode())) {
|
||||
throw new CrmebException("请填写银行卡号!");
|
||||
if (StrUtil.isBlank(request.getBankCode())) {
|
||||
throw new CrmebException("请填写银行卡号!");
|
||||
}
|
||||
request.setWechat(null);
|
||||
request.setAlipayCode(null);
|
||||
break;
|
||||
default:
|
||||
throw new CrmebException("请选择支付方式");
|
||||
throw new CrmebException("请选择支付方式");
|
||||
}
|
||||
return userExtractService.extractApply(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现银行/提现最低金额
|
||||
*
|
||||
* @return UserExtractCashResponse
|
||||
*/
|
||||
@Override
|
||||
@@ -211,7 +217,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
List<String> bankArr = new ArrayList<>();
|
||||
if (bank.indexOf("\n") > 0) {
|
||||
bankArr.addAll(Arrays.asList(bank.split("\n")));
|
||||
}else{
|
||||
} else {
|
||||
bankArr.add(bank);
|
||||
}
|
||||
return bankArr;
|
||||
@@ -219,6 +225,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 会员等级列表
|
||||
*
|
||||
* @return List<UserLevel>
|
||||
*/
|
||||
@Override
|
||||
@@ -228,6 +235,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 推广用户, 我自己推广了哪些用户
|
||||
*
|
||||
* @return List<UserSpreadPeopleItemResponse>
|
||||
*/
|
||||
@Override
|
||||
@@ -244,21 +252,20 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
if (request.getGrade().equals(1)) {// 二级推广人
|
||||
//查询二级推广人
|
||||
List<Integer> secondSpreadIdList = userService.getSpreadPeopleIdList(userIdList);
|
||||
if (CollUtil.isEmpty(secondSpreadIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//二级推广人
|
||||
userIdList.clear();
|
||||
userIdList.addAll(secondSpreadIdList);
|
||||
}
|
||||
List<UserSpreadPeopleItemResponse> spreadPeopleList = userService.getSpreadPeopleList(userIdList, request.getKeyword(), request.getSortKey(), request.getIsAsc(), pageParamRequest);
|
||||
spreadPeopleList.forEach(e -> {
|
||||
OrderBrokerageData brokerageData = storeOrderService.getBrokerageData(e.getUid(), userId);
|
||||
e.setOrderCount(brokerageData.getNum());
|
||||
e.setNumberCount(brokerageData.getPrice());
|
||||
});
|
||||
return spreadPeopleList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值额度选择
|
||||
*
|
||||
* @return UserRechargeResponse
|
||||
*/
|
||||
@Override
|
||||
@@ -267,7 +274,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
userRechargeResponse.setRechargeQuota(systemGroupDataService.getListByGid(SysGroupDataConstants.GROUP_DATA_ID_RECHARGE_LIST, UserRechargeItemResponse.class));
|
||||
String rechargeAttention = systemConfigService.getValueByKey(Constants.CONFIG_RECHARGE_ATTENTION);
|
||||
List<String> rechargeAttentionList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(rechargeAttention)) {
|
||||
if (StrUtil.isNotBlank(rechargeAttention)) {
|
||||
rechargeAttentionList = CrmebUtil.stringToArrayStrRegex(rechargeAttention, "\n");
|
||||
}
|
||||
userRechargeResponse.setRechargeAttention(rechargeAttentionList);
|
||||
@@ -276,6 +283,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 用户资金统计
|
||||
*
|
||||
* @return UserBalanceResponse
|
||||
*/
|
||||
@Override
|
||||
@@ -283,12 +291,12 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
User info = userService.getInfo();
|
||||
BigDecimal recharge = userBillService.getSumBigDecimal(1, info.getUid(), Constants.USER_BILL_CATEGORY_MONEY, null, null);
|
||||
BigDecimal orderStatusSum = userBillService.getSumBigDecimal(0, info.getUid(), Constants.USER_BILL_CATEGORY_MONEY, null, null);
|
||||
// BigDecimal orderStatusSum = storeOrderService.getSumBigDecimal(info.getUid(), null);
|
||||
return new UserBalanceResponse(info.getNowMoney(), recharge, orderStatusSum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推广订单
|
||||
*
|
||||
* @return UserSpreadOrderResponse;
|
||||
*/
|
||||
@Override
|
||||
@@ -327,7 +335,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
userSpreadOrderItemChildResponse.setNickname(userMap.get(orderUid).getNickname());
|
||||
userSpreadOrderItemChildResponse.setType("返佣");
|
||||
|
||||
String month = DateUtil.dateToStr(record.getUpdateTime(), Constants.DATE_FORMAT_MONTH);
|
||||
String month = CrmebDateUtil.dateToStr(record.getUpdateTime(), Constants.DATE_FORMAT_MONTH);
|
||||
if (monthList.contains(month)) {
|
||||
//如果在已有的数据中找到当前月份数据则追加
|
||||
for (UserSpreadOrderItemResponse userSpreadOrderItemResponse : userSpreadOrderItemResponseList) {
|
||||
@@ -348,7 +356,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
// 获取月份总订单数
|
||||
Map<String, Integer> countMap = userBrokerageRecordService.getSpreadCountByUidAndMonth(user.getUid(), monthList);
|
||||
for (UserSpreadOrderItemResponse userSpreadOrderItemResponse: userSpreadOrderItemResponseList) {
|
||||
for (UserSpreadOrderItemResponse userSpreadOrderItemResponse : userSpreadOrderItemResponseList) {
|
||||
userSpreadOrderItemResponse.setCount(countMap.get(userSpreadOrderItemResponse.getTime()));
|
||||
}
|
||||
|
||||
@@ -358,6 +366,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*
|
||||
* @return UserSpreadOrderResponse;
|
||||
*/
|
||||
@Override
|
||||
@@ -392,10 +401,6 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
userRecharge.setPrice(request.getPrice());
|
||||
userRecharge.setGivePrice(request.getGivePrice());
|
||||
userRecharge.setRechargeType(request.getFromType());
|
||||
boolean save = userRechargeService.save(userRecharge);
|
||||
if (!save) {
|
||||
throw new CrmebException("生成充值订单失败!");
|
||||
}
|
||||
|
||||
OrderPayResultResponse response = new OrderPayResultResponse();
|
||||
MyRecord record = new MyRecord();
|
||||
@@ -413,13 +418,23 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
vo.setMwebUrl(unifiedorder.get("mweb_url"));
|
||||
response.setPayType(PayConstants.PAY_CHANNEL_WE_CHAT_H5);
|
||||
}
|
||||
if (userRecharge.getRechargeType().equals(PayConstants.PAY_CHANNEL_WE_CHAT_APP_IOS) || userRecharge.getRechargeType().equals(PayConstants.PAY_CHANNEL_WE_CHAT_APP_ANDROID)) {//
|
||||
vo.setPartnerid(unifiedorder.get("partnerid"));
|
||||
}
|
||||
response.setJsConfig(vo);
|
||||
response.setOrderNo(userRecharge.getOrderId());
|
||||
|
||||
userRecharge.setOutTradeNo(unifiedorder.get("outTradeNo"));
|
||||
boolean save = userRechargeService.save(userRecharge);
|
||||
if (!save) {
|
||||
throw new CrmebException("生成充值订单失败!");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信登录
|
||||
*
|
||||
* @return LoginResponse;
|
||||
*/
|
||||
@Override
|
||||
@@ -427,7 +442,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
// 通过code获取获取公众号授权信息
|
||||
WeChatOauthToken oauthToken = wechatNewService.getOauth2AccessToken(code);
|
||||
//检测是否存在
|
||||
UserToken userToken = userTokenService.getByOpenidAndType(oauthToken.getOpenId(), Constants.THIRD_LOGIN_TOKEN_TYPE_PUBLIC);
|
||||
UserToken userToken = userTokenService.getByOpenidAndType(oauthToken.getOpenId(), Constants.THIRD_LOGIN_TOKEN_TYPE_PUBLIC);
|
||||
LoginResponse loginResponse = new LoginResponse();
|
||||
if (ObjectUtil.isNotNull(userToken)) {// 已存在,正常登录
|
||||
User user = userService.getById(userToken.getUid());
|
||||
@@ -436,15 +451,16 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
}
|
||||
|
||||
// 记录最后一次登录时间
|
||||
user.setLastLoginTime(DateUtil.nowDateTime());
|
||||
user.setLastLoginTime(CrmebDateUtil.nowDateTime());
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
// 分销绑定
|
||||
if (userService.checkBingSpread(user, spreadUid, "old")) {
|
||||
user.setSpreadUid(spreadUid);
|
||||
user.setSpreadTime(DateUtil.nowDateTime());
|
||||
user.setSpreadTime(CrmebDateUtil.nowDateTime());
|
||||
// 处理新旧推广人数据
|
||||
userService.updateSpreadCountByUid(spreadUid, "add");
|
||||
}
|
||||
user.setUpdateTime(DateUtil.date());
|
||||
userService.updateById(user);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
@@ -482,6 +498,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 获取微信授权logo
|
||||
*
|
||||
* @return String;
|
||||
*/
|
||||
@Override
|
||||
@@ -491,7 +508,8 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 小程序登录
|
||||
* @param code String 前端临时授权code
|
||||
*
|
||||
* @param code String 前端临时授权code
|
||||
* @param request RegisterThirdUserRequest 用户信息
|
||||
* @return LoginResponse
|
||||
*/
|
||||
@@ -509,15 +527,16 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
throw new CrmebException("当前账户已禁用,请联系管理员!");
|
||||
}
|
||||
// 记录最后一次登录时间
|
||||
user.setLastLoginTime(DateUtil.nowDateTime());
|
||||
user.setLastLoginTime(CrmebDateUtil.nowDateTime());
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
// 分销绑定
|
||||
if (userService.checkBingSpread(user, request.getSpreadPid(), "old")) {
|
||||
user.setSpreadUid(request.getSpreadPid());
|
||||
user.setSpreadTime(DateUtil.nowDateTime());
|
||||
user.setSpreadTime(CrmebDateUtil.nowDateTime());
|
||||
// 处理新旧推广人数据
|
||||
userService.updateSpreadCountByUid(request.getSpreadPid(), "add");
|
||||
}
|
||||
user.setUpdateTime(DateUtil.date());
|
||||
userService.updateById(user);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
@@ -544,7 +563,9 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
loginResponse.setType("start");
|
||||
return loginResponse;
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(request.getNickName())) {
|
||||
request.setNickName("");
|
||||
}
|
||||
request.setType(Constants.USER_LOGIN_TYPE_PROGRAM);
|
||||
request.setOpenId(response.getOpenId());
|
||||
String key = SecureUtil.md5(response.getOpenId());
|
||||
@@ -556,7 +577,8 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 推广人排行榜
|
||||
* @param type String 时间范围(week-周,month-月)
|
||||
*
|
||||
* @param type String 时间范围(week-周,month-月)
|
||||
* @param pageParamRequest PageParamRequest 分页
|
||||
* @return List<LoginResponse>
|
||||
*/
|
||||
@@ -567,7 +589,8 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 佣金排行榜
|
||||
* @param type String 时间范围
|
||||
*
|
||||
* @param type String 时间范围
|
||||
* @param pageParamRequest PageParamRequest 分页
|
||||
* @return List<User>
|
||||
*/
|
||||
@@ -579,7 +602,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
return null;
|
||||
}
|
||||
// 解决0元排行问题
|
||||
for (int i = 0; i < recordList.size();) {
|
||||
for (int i = 0; i < recordList.size(); ) {
|
||||
UserBrokerageRecord userBrokerageRecord = recordList.get(i);
|
||||
if (userBrokerageRecord.getPrice().compareTo(BigDecimal.ZERO) < 1) {
|
||||
recordList.remove(i);
|
||||
@@ -597,7 +620,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
//解决排序问题
|
||||
List<User> userList = CollUtil.newArrayList();
|
||||
for (UserBrokerageRecord record: recordList) {
|
||||
for (UserBrokerageRecord record : recordList) {
|
||||
User user = new User();
|
||||
User userVo = userVoList.get(record.getUid());
|
||||
|
||||
@@ -606,7 +629,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
user.setBrokeragePrice(record.getPrice());
|
||||
if (StrUtil.isBlank(userVo.getNickname())) {
|
||||
user.setNickname(userVo.getPhone().substring(0, 2) + "****" + userVo.getPhone().substring(7));
|
||||
}else{
|
||||
} else {
|
||||
user.setNickname(userVo.getNickname());
|
||||
}
|
||||
userList.add(user);
|
||||
@@ -616,6 +639,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 推广海报图
|
||||
*
|
||||
* @return List<SystemGroupData>
|
||||
*/
|
||||
@Override
|
||||
@@ -625,7 +649,8 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 当前用户在佣金排行第几名
|
||||
* @param type String 时间范围
|
||||
*
|
||||
* @param type String 时间范围
|
||||
* @return 优惠券集合
|
||||
*/
|
||||
@Override
|
||||
@@ -643,7 +668,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
for (int i = 0; i < recordList.size(); i++) {
|
||||
if (recordList.get(i).getUid().equals(userId)) {
|
||||
number = i + 1;
|
||||
break ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return number;
|
||||
@@ -651,6 +676,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 佣金转入余额
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
@Override
|
||||
@@ -679,7 +705,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
userBill.setBalance(user.getNowMoney().add(price));
|
||||
userBill.setMark(StrUtil.format("佣金转余额,增加{}", price));
|
||||
userBill.setStatus(1);
|
||||
userBill.setCreateTime(DateUtil.nowDateTime());
|
||||
userBill.setCreateTime(CrmebDateUtil.nowDateTime());
|
||||
|
||||
// userBrokerage转出记录
|
||||
UserBrokerageRecord brokerageRecord = new UserBrokerageRecord();
|
||||
@@ -692,7 +718,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
brokerageRecord.setBalance(user.getNowMoney().add(price));
|
||||
brokerageRecord.setMark(StrUtil.format("佣金转余额,减少{}", price));
|
||||
brokerageRecord.setStatus(BrokerageRecordConstants.BROKERAGE_RECORD_STATUS_COMPLETE);
|
||||
brokerageRecord.setCreateTime(DateUtil.nowDateTime());
|
||||
brokerageRecord.setCreateTime(CrmebDateUtil.nowDateTime());
|
||||
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
// 扣佣金
|
||||
@@ -717,6 +743,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 推广佣金明细
|
||||
*
|
||||
* @param pageParamRequest 分页参数
|
||||
*/
|
||||
@Override
|
||||
@@ -727,6 +754,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 用户账单记录(现金)
|
||||
*
|
||||
* @param type 记录类型:all-全部,expenditure-支出,income-收入
|
||||
* @return CommonPage
|
||||
*/
|
||||
@@ -742,7 +770,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
// 获取年-月
|
||||
Map<String, List<UserBill>> map = CollUtil.newHashMap();
|
||||
list.forEach(i -> {
|
||||
String month = StrUtil.subPre(DateUtil.dateToStr(i.getCreateTime(), Constants.DATE_FORMAT), 7);
|
||||
String month = StrUtil.subPre(CrmebDateUtil.dateToStr(i.getCreateTime(), Constants.DATE_FORMAT), 7);
|
||||
if (map.containsKey(month)) {
|
||||
map.get(month).add(i);
|
||||
} else {
|
||||
@@ -759,12 +787,14 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
responseList.add(response);
|
||||
});
|
||||
|
||||
PageInfo<UserRechargeBillRecordResponse> pageInfo = CommonPage.copyPageInfo(billPageInfo, responseList);
|
||||
List<UserRechargeBillRecordResponse> collect = responseList.stream().sorted(Comparator.comparing(s -> cn.hutool.core.date.DateUtil.parse(s.getDate(), "yyyy-MM").getTime(), Comparator.reverseOrder())).collect(Collectors.toList());
|
||||
PageInfo<UserRechargeBillRecordResponse> pageInfo = CommonPage.copyPageInfo(billPageInfo, collect);
|
||||
return CommonPage.restPage(pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信注册绑定手机号
|
||||
*
|
||||
* @param request 请求参数
|
||||
* @return 登录信息
|
||||
*/
|
||||
@@ -798,6 +828,12 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
case "routine":
|
||||
type = Constants.THIRD_LOGIN_TOKEN_TYPE_PROGRAM;
|
||||
break;
|
||||
case "iosWx":
|
||||
type = Constants.THIRD_LOGIN_TOKEN_TYPE_IOS_WX;
|
||||
break;
|
||||
case "androidWx":
|
||||
type = Constants.THIRD_LOGIN_TOKEN_TYPE_ANDROID_WX;
|
||||
break;
|
||||
}
|
||||
|
||||
UserToken userToken = userTokenService.getTokenByUserId(user.getUid(), type);
|
||||
@@ -814,7 +850,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
// 分销绑定
|
||||
if (userService.checkBingSpread(finalUser, registerThirdUserRequest.getSpreadPid(), "new")) {
|
||||
finalUser.setSpreadUid(registerThirdUserRequest.getSpreadPid());
|
||||
finalUser.setSpreadTime(DateUtil.nowDateTime());
|
||||
finalUser.setSpreadTime(CrmebDateUtil.nowDateTime());
|
||||
userService.updateSpreadCountByUid(registerThirdUserRequest.getSpreadPid(), "add");
|
||||
}
|
||||
userService.save(finalUser);
|
||||
@@ -828,6 +864,12 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
case "routine":
|
||||
userTokenService.bind(registerThirdUserRequest.getOpenId(), Constants.THIRD_LOGIN_TOKEN_TYPE_PROGRAM, finalUser.getUid());
|
||||
break;
|
||||
case "iosWx":
|
||||
userTokenService.bind(registerThirdUserRequest.getOpenId(), Constants.THIRD_LOGIN_TOKEN_TYPE_IOS_WX, finalUser.getUid());
|
||||
break;
|
||||
default:
|
||||
userTokenService.bind(registerThirdUserRequest.getOpenId(), Constants.THIRD_LOGIN_TOKEN_TYPE_ANDROID_WX, finalUser.getUid());
|
||||
break;
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
@@ -850,11 +892,17 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
loginResponse.setUid(user.getUid());
|
||||
loginResponse.setNikeName(user.getNickname());
|
||||
loginResponse.setPhone(user.getPhone());
|
||||
try {
|
||||
scrmUtils.addUserForSCRM(user.getPhone(), user.getNickname());
|
||||
} catch (Exception e) {
|
||||
logger.error("SCRM用户同步失败: phone={}, nickname={}", user.getPhone(), user.getNickname(), e);
|
||||
}
|
||||
return loginResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户积分记录列表
|
||||
*
|
||||
* @param pageParamRequest 分页参数
|
||||
* @return List<UserIntegralRecord>
|
||||
*/
|
||||
@@ -864,8 +912,73 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
return userIntegralRecordService.findUserIntegralRecordList(uid, pageParamRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信app登录
|
||||
*
|
||||
* @param request 请求参数
|
||||
* @return 登录响应体
|
||||
*/
|
||||
@Override
|
||||
public LoginResponse appLogin(RegisterAppWxRequest request) {
|
||||
//检测是否存在
|
||||
UserToken userToken = null;
|
||||
if (request.getType().equals(Constants.USER_LOGIN_TYPE_IOS_WX)) {
|
||||
userToken = userTokenService.getByOpenidAndType(request.getOpenId(), Constants.THIRD_LOGIN_TOKEN_TYPE_IOS_WX);
|
||||
}
|
||||
if (request.getType().equals(Constants.USER_LOGIN_TYPE_ANDROID_WX)) {
|
||||
userToken = userTokenService.getByOpenidAndType(request.getOpenId(), Constants.THIRD_LOGIN_TOKEN_TYPE_ANDROID_WX);
|
||||
}
|
||||
LoginResponse loginResponse = new LoginResponse();
|
||||
if (ObjectUtil.isNotNull(userToken)) {// 已存在,正常登录
|
||||
User user = userService.getById(userToken.getUid());
|
||||
if (!user.getStatus()) {
|
||||
throw new CrmebException("当前账户已禁用,请联系管理员!");
|
||||
}
|
||||
|
||||
// 记录最后一次登录时间
|
||||
user.setLastLoginTime(CrmebDateUtil.nowDateTime());
|
||||
user.setUpdateTime(DateUtil.date());
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
userService.updateById(user);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
if (!execute) {
|
||||
logger.error(StrUtil.format("APP微信登录记录最后一次登录时间失败,uid={}", user.getUid()));
|
||||
}
|
||||
try {
|
||||
String token = tokenComponent.createToken(user);
|
||||
loginResponse.setToken(token);
|
||||
} catch (Exception e) {
|
||||
logger.error(StrUtil.format("APP微信登录生成token失败,uid={}", user.getUid()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
loginResponse.setType("login");
|
||||
loginResponse.setUid(user.getUid());
|
||||
return loginResponse;
|
||||
}
|
||||
// 没有用户,走创建用户流程
|
||||
// 从微信获取用户信息,存入Redis中,将key返回给前端,前端在下一步绑定手机号的时候下发
|
||||
RegisterThirdUserRequest registerThirdUserRequest = new RegisterThirdUserRequest();
|
||||
registerThirdUserRequest.setSpreadPid(0);
|
||||
registerThirdUserRequest.setType(request.getType());
|
||||
registerThirdUserRequest.setOpenId(request.getOpenId());
|
||||
registerThirdUserRequest.setNickName(request.getNickName());
|
||||
registerThirdUserRequest.setSex(request.getGender());
|
||||
registerThirdUserRequest.setProvince(request.getProvince());
|
||||
registerThirdUserRequest.setCity(request.getCity());
|
||||
registerThirdUserRequest.setCountry(request.getCountry());
|
||||
registerThirdUserRequest.setAvatar(request.getAvatarUrl());
|
||||
String key = SecureUtil.md5(request.getOpenId());
|
||||
redisUtil.set(key, JSONObject.toJSONString(registerThirdUserRequest), (long) (60 * 2), TimeUnit.MINUTES);
|
||||
|
||||
loginResponse.setType("register");
|
||||
loginResponse.setKey(key);
|
||||
return loginResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户积分信息
|
||||
*
|
||||
* @return IntegralUserResponse
|
||||
*/
|
||||
@Override
|
||||
@@ -875,7 +988,10 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
//签到
|
||||
Integer sumIntegral = userIntegralRecordService.getSumIntegral(user.getUid(), IntegralRecordConstants.INTEGRAL_RECORD_TYPE_ADD, "", null);
|
||||
Integer deductionIntegral = userIntegralRecordService.getSumIntegral(user.getUid(), IntegralRecordConstants.INTEGRAL_RECORD_TYPE_SUB, "", IntegralRecordConstants.INTEGRAL_RECORD_LINK_TYPE_ORDER);
|
||||
ArrayList<String> linkTypeList = new ArrayList<>();
|
||||
linkTypeList.add(IntegralRecordConstants.INTEGRAL_RECORD_LINK_TYPE_ORDER);
|
||||
linkTypeList.add(IntegralRecordConstants.INTEGRAL_RECORD_LINK_TYPE_SYSTEM);
|
||||
Integer deductionIntegral = userIntegralRecordService.getSumIntegral(user.getUid(), IntegralRecordConstants.INTEGRAL_RECORD_TYPE_SUB, "", linkTypeList);
|
||||
userSignInfoResponse.setSumIntegral(sumIntegral);
|
||||
userSignInfoResponse.setDeductionIntegral(deductionIntegral);
|
||||
// 冻结积分
|
||||
@@ -887,6 +1003,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 获取用户经验记录
|
||||
*
|
||||
* @param pageParamRequest 分页参数
|
||||
* @return List<UserExperienceRecord>
|
||||
*/
|
||||
@@ -898,6 +1015,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 提现用户信息
|
||||
*
|
||||
* @return UserExtractCashResponse
|
||||
*/
|
||||
@Override
|
||||
@@ -916,6 +1034,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 推广人列表统计
|
||||
*
|
||||
* @return UserSpreadPeopleResponse
|
||||
*/
|
||||
@Override
|
||||
@@ -951,10 +1070,10 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
* 绑定手机号数据校验
|
||||
*/
|
||||
private void checkBindingPhone(WxBindingPhoneRequest request) {
|
||||
if (!"public".equals(request.getType()) && !"routine".equals(request.getType()) && !"iosWx".equals(request.getType()) && !"androidWx".equals(request.getType())) {
|
||||
if (!request.getType().equals("public") && !request.getType().equals("routine") && !request.getType().equals("iosWx") && !request.getType().equals("androidWx")) {
|
||||
throw new CrmebException("未知的用户类型");
|
||||
}
|
||||
if ("public".equals(request.getType())) {
|
||||
if (request.getType().equals("public") || request.getType().equals("iosWx") || request.getType().equals("androidWx")) {
|
||||
if (StrUtil.isBlank(request.getCaptcha())) {
|
||||
throw new CrmebException("验证码不能为空");
|
||||
}
|
||||
@@ -969,39 +1088,54 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
}
|
||||
checkValidateCode(request.getPhone(), request.getCaptcha());
|
||||
} else {
|
||||
// 参数校验
|
||||
if (StrUtil.isBlank(request.getCode())) {
|
||||
throw new CrmebException("小程序获取手机号code不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(request.getEncryptedData())) {
|
||||
throw new CrmebException("小程序获取手机号加密数据不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(request.getIv())) {
|
||||
throw new CrmebException("小程序获取手机号加密算法的初始向量不能为空");
|
||||
}
|
||||
// 获取appid
|
||||
String programAppId = systemConfigService.getValueByKey(WeChatConstants.WECHAT_MINI_APPID);
|
||||
if (StringUtils.isBlank(programAppId)) {
|
||||
throw new CrmebException("微信小程序appId未设置");
|
||||
}
|
||||
if (StrUtil.isNotBlank(request.getCaptcha())) {
|
||||
if (StrUtil.isBlank(request.getPhone())) {
|
||||
throw new CrmebException("手机号不能为空");
|
||||
}
|
||||
boolean matchPhone = ReUtil.isMatch(RegularConstants.PHONE_TWO, request.getPhone());
|
||||
if (!matchPhone) {
|
||||
throw new CrmebException("手机号格式错误,请输入正确得手机号");
|
||||
}
|
||||
boolean match = ReUtil.isMatch(RegularConstants.VALIDATE_CODE_NUM_SIX, request.getCaptcha());
|
||||
if (!match) {
|
||||
throw new CrmebException("验证码格式错误,验证码必须为6位数字");
|
||||
}
|
||||
checkValidateCode(request.getPhone(), request.getCaptcha());
|
||||
} else {
|
||||
// 参数校验
|
||||
if (StrUtil.isBlank(request.getCode())) {
|
||||
throw new CrmebException("小程序获取手机号code不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(request.getEncryptedData())) {
|
||||
throw new CrmebException("小程序获取手机号加密数据不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(request.getIv())) {
|
||||
throw new CrmebException("小程序获取手机号加密算法的初始向量不能为空");
|
||||
}
|
||||
// 获取appid
|
||||
String programAppId = systemConfigService.getValueByKey(WeChatConstants.WECHAT_MINI_APPID);
|
||||
if (StrUtil.isBlank(programAppId)) {
|
||||
throw new CrmebException("微信小程序appId未设置");
|
||||
}
|
||||
|
||||
WeChatMiniAuthorizeVo response = wechatNewService.miniAuthCode(request.getCode());
|
||||
// WeChatMiniAuthorizeVo response = weChatService.programAuthorizeLogin(request.getCode());
|
||||
System.out.println("小程序登陆成功 = " + JSON.toJSONString(response));
|
||||
String decrypt = WxUtil.decrypt(programAppId, request.getEncryptedData(), response.getSessionKey(), request.getIv());
|
||||
if (StrUtil.isBlank(decrypt)) {
|
||||
throw new CrmebException("微信小程序获取手机号解密失败");
|
||||
WeChatMiniAuthorizeVo response = wechatNewService.miniAuthCode(request.getCode());
|
||||
System.out.println("小程序登陆成功 = " + JSON.toJSONString(response));
|
||||
String decrypt = WxUtil.decrypt(programAppId, request.getEncryptedData(), response.getSessionKey(), request.getIv());
|
||||
if (StrUtil.isBlank(decrypt)) {
|
||||
throw new CrmebException("微信小程序获取手机号解密失败");
|
||||
}
|
||||
JSONObject jsonObject = JSONObject.parseObject(decrypt);
|
||||
if (StrUtil.isBlank(jsonObject.getString("phoneNumber"))) {
|
||||
throw new CrmebException("微信小程序获取手机号没有有效的手机号");
|
||||
}
|
||||
request.setPhone(jsonObject.getString("phoneNumber"));
|
||||
}
|
||||
JSONObject jsonObject = JSONObject.parseObject(decrypt);
|
||||
if (StrUtil.isBlank(jsonObject.getString("phoneNumber"))) {
|
||||
throw new CrmebException("微信小程序获取手机号没有有效的手机号");
|
||||
}
|
||||
request.setPhone(jsonObject.getString("phoneNumber"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送新人券
|
||||
*
|
||||
* @param uid 用户uid
|
||||
*/
|
||||
private void giveNewPeopleCoupon(Integer uid) {
|
||||
@@ -1012,9 +1146,9 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
couponList.forEach(storeCoupon -> {
|
||||
//是否有固定的使用时间
|
||||
if (!storeCoupon.getIsFixedTime()) {
|
||||
String endTime = DateUtil.addDay(DateUtil.nowDate(Constants.DATE_FORMAT), storeCoupon.getDay(), Constants.DATE_FORMAT);
|
||||
storeCoupon.setUseEndTime(DateUtil.strToDate(endTime, Constants.DATE_FORMAT));
|
||||
storeCoupon.setUseStartTime(DateUtil.nowDateTimeReturnDate(Constants.DATE_FORMAT));
|
||||
String endTime = CrmebDateUtil.addDay(CrmebDateUtil.nowDate(Constants.DATE_FORMAT), storeCoupon.getDay(), Constants.DATE_FORMAT);
|
||||
storeCoupon.setUseEndTime(CrmebDateUtil.strToDate(endTime, Constants.DATE_FORMAT));
|
||||
storeCoupon.setUseStartTime(CrmebDateUtil.nowDateTimeReturnDate(Constants.DATE_FORMAT));
|
||||
}
|
||||
|
||||
StoreCouponUser storeCouponUser = new StoreCouponUser();
|
||||
@@ -1027,7 +1161,7 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
storeCouponUser.setStartTime(storeCoupon.getUseStartTime());
|
||||
storeCouponUser.setEndTime(storeCoupon.getUseEndTime());
|
||||
} else {// 没有固定使用时间
|
||||
Date nowDate = DateUtil.nowDateTime();
|
||||
Date nowDate = CrmebDateUtil.nowDateTime();
|
||||
storeCouponUser.setStartTime(nowDate);
|
||||
DateTime dateTime = cn.hutool.core.date.DateUtil.offsetDay(nowDate, storeCoupon.getDay());
|
||||
storeCouponUser.setEndTime(dateTime);
|
||||
@@ -1051,8 +1185,9 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
|
||||
/**
|
||||
* 检测手机验证码
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param code 验证码
|
||||
* @param code 验证码
|
||||
*/
|
||||
private void checkValidateCode(String phone, String code) {
|
||||
Object validateCode = redisUtil.get(SmsConstants.SMS_VALIDATE_PHONE + phone);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# CRMEB 相关配置
|
||||
crmeb:
|
||||
version: CRMEB-JAVA-KY-v1.3.4 # 当前代码版本
|
||||
version: CRMEB-JAVA-KY-v1.4 # 当前代码版本
|
||||
imagePath: /你的站点绝对路径 建议jar包位置/ # 服务器图片路径配置 斜杠结尾
|
||||
asyncConfig: true #是否同步config表数据到redis
|
||||
|
||||
server:
|
||||
port: 20009
|
||||
@@ -13,13 +15,13 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb_java_beta?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: root
|
||||
password: 123456
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb_java_beta?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: crmeb_java_beta
|
||||
password: 111111
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 123456
|
||||
password: 111111
|
||||
timeout: 10000 # 连接超时时间(毫秒)
|
||||
database: 3 #默认数据库
|
||||
jedis:
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# CRMEB 相关配置
|
||||
crmeb:
|
||||
version: CRMEB-JAVA-KY-v1.3.4 # 当前代码版本
|
||||
version: CRMEB-JAVA-KY-v1.4 # 当前代码版本
|
||||
imagePath: /JAVA_PROJECT/OPEN/dev/admin/ # 服务器图片路径配置 斜杠结尾
|
||||
asyncConfig: false #是否同步config表数据到redis
|
||||
|
||||
server:
|
||||
port: 20011
|
||||
port: 20510
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
@@ -13,15 +15,15 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb_java_dev?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: root
|
||||
password: 123456
|
||||
url: jdbc:mysql://127.0.0.1:3306/single_open?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: single_open
|
||||
password: 111111
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 123456
|
||||
password: 111111
|
||||
timeout: 10000 # 连接超时时间(毫秒)
|
||||
database: 10 #默认数据库
|
||||
database: 6 #默认数据库
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# CRMEB 相关配置
|
||||
crmeb:
|
||||
version: CRMEB-JAVA-KY-v1.3.4 # 当前代码版本
|
||||
version: CRMEB-JAVA-KY-v1.4 # 当前代码版本
|
||||
imagePath: /JAVA_PROJECT/SINGLE/demo/admin/ # 服务器图片路径配置 斜杠结尾
|
||||
asyncConfig: true #是否同步config表数据到redis
|
||||
|
||||
server:
|
||||
port: 20001
|
||||
port: 20410
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
@@ -13,15 +15,15 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb_java?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: root
|
||||
password: 123456
|
||||
url: jdbc:mysql://127.0.0.1:3306/java_demo?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: java_demo
|
||||
password: 111111
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 123456
|
||||
password: 111111
|
||||
timeout: 10000 # 连接超时时间(毫秒)
|
||||
database: 15 #默认数据库
|
||||
database: 4 #默认数据库
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
|
||||
@@ -42,7 +44,7 @@ logging:
|
||||
|
||||
# mybatis 配置
|
||||
mybatis-plus:
|
||||
# 配置slq打印日志
|
||||
# 配置sql打印日志
|
||||
configuration:
|
||||
log-impl:
|
||||
|
||||
@@ -50,6 +52,6 @@ mybatis-plus:
|
||||
swagger:
|
||||
basic:
|
||||
enable: true #是否开启界面
|
||||
check: true #是否打开验证
|
||||
username: #访问swagger的账号
|
||||
password: #访问swagger的密码
|
||||
check: false #是否打开验证
|
||||
username: crmeb #访问swagger的账号
|
||||
password: crmeb.com #访问swagger的密码
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
# CRMEB 相关配置
|
||||
crmeb:
|
||||
version: CRMEB-JAVA-KY-v1.3.4 # 当前代码版本
|
||||
version: CRMEB-JAVA-KY-v1.4 # 当前代码版本
|
||||
imagePath: /Users/dazongzi/Documents/ZBKJ/CODEMANGER/BIZ-CODE/JavaSingel/back_old_version/V2.1/CRMEB_JAVA_SY_V2.1-20240827/single_java/ # 服务器图片路径配置 斜杠结尾
|
||||
asyncConfig: false #是否同步config表数据到redis
|
||||
activityStyleCachedTime: 10 #活动边框缓存周期 秒为单位,生产环境适当5-10分钟即可
|
||||
demoSite: true # 是否演示站点 所有手机号码都会掩码
|
||||
ignored: #安全路径白名单
|
||||
- swagger-ui/
|
||||
- swagger-resources/**
|
||||
- /**/v2/api-docs
|
||||
- /**/*.html
|
||||
- /**/*.js
|
||||
- /**/*.css
|
||||
- /**/*.png
|
||||
- /**/*.map
|
||||
- /favicon.ico
|
||||
- /actuator/**
|
||||
- /druid/**
|
||||
- api/front/pagediy/info
|
||||
|
||||
# 配置端口
|
||||
server:
|
||||
@@ -21,8 +38,6 @@ spring:
|
||||
multipart:
|
||||
max-file-size: 50MB #设置单个文件大小
|
||||
max-request-size: 50MB #设置单次请求文件的总大小
|
||||
resources:
|
||||
static-locations: classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${crmeb.filePath}
|
||||
application:
|
||||
name: cemrb-front #这个很重要,这在以后的服务与服务之间相互调用一般都是根据这个name
|
||||
jackson:
|
||||
@@ -33,15 +48,15 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: crmeb
|
||||
url: jdbc:mysql://127.0.0.1:3306/single_open?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: single_open
|
||||
password: 111111
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 111111
|
||||
timeout: 30000 # 连接超时时间(毫秒)
|
||||
database: 3 #默认数据库
|
||||
database: 6 #默认数据库
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
|
||||
@@ -49,6 +64,8 @@ spring:
|
||||
max-idle: 10 # 连接池中的最大空闲连接
|
||||
min-idle: 0 # 连接池中的最小空闲连接
|
||||
time-between-eviction-runs: -1 #逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
|
||||
second:
|
||||
database: 13 # 微信accessToken存储库
|
||||
|
||||
debug: true
|
||||
logging:
|
||||
@@ -63,7 +80,7 @@ logging:
|
||||
# mybatis 配置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/*/*Mapper.xml #xml扫描,多个目录用逗号或者分号分隔(告诉 Mapper 所对应的 XML 文件位置)
|
||||
# 配置slq打印日志
|
||||
# 配置sql打印日志
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
global-config:
|
||||
@@ -73,6 +90,47 @@ mybatis-plus:
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
|
||||
|
||||
# 行为验证码
|
||||
aj:
|
||||
captcha:
|
||||
type: default # 验证码类型
|
||||
water-mark: CRMEB Java # 水印
|
||||
slip-offset: 15 # 校验滑动拼图允许误差偏移量(默认5像素)
|
||||
aes-status: true # aes加密坐标开启或者禁用(true|false)
|
||||
interference-options: 2 # 滑动干扰项(0/1/2)
|
||||
font-style: 1 # 点选字体样式 默认Font.BOLD
|
||||
font-size: 25 # 点选字体字体大小
|
||||
req-frequency-limit-enable: false # 接口请求次数一分钟限制是否开启 true|false
|
||||
req-get-lock-limit: 5 # 验证失败5次,get接口锁定
|
||||
req-get-lock-seconds: 360 # 验证失败后,锁定时间间隔,s
|
||||
req-get-minute-limit: 30 # get接口一分钟内请求数限制
|
||||
req-check-minute-limit: 60 # check接口一分钟内请求数限制
|
||||
req-verify-minute-limit: 60 # verify接口一分钟内请求数限制
|
||||
|
||||
# 滑动验证,底图路径,不配置将使用默认图片
|
||||
# 支持全路径
|
||||
# 支持项目路径,以classpath:开头,取resource目录下路径,例:classpath:images/jigsaw
|
||||
jigsaw: classpath:images/jigsaw
|
||||
#滑动验证,底图路径,不配置将使用默认图片
|
||||
##支持全路径
|
||||
# 支持项目路径,以classpath:开头,取resource目录下路径,例:classpath:images/pic-click
|
||||
pic-click: classpath:images/pic-click
|
||||
# 对于分布式部署的应用,我们建议应用自己实现CaptchaCacheService,比如用Redis或者memcache,
|
||||
# 参考CaptchaCacheServiceRedisImpl.java
|
||||
# 如果应用是单点的,也没有使用redis,那默认使用内存。
|
||||
# 内存缓存只适合单节点部署的应用,否则验证码生产与验证在节点之间信息不同步,导致失败。
|
||||
# !!! 注意啦,如果应用有使用spring-boot-starter-data-redis,
|
||||
# 请打开CaptchaCacheServiceRedisImpl.java注释。
|
||||
# redis -----> SPI: 在resources目录新建META-INF.services文件夹(两层),参考当前服务resources。
|
||||
# 缓存local/redis...
|
||||
cache-type: redis
|
||||
# local缓存的阈值,达到这个值,清除缓存
|
||||
cache-number: 1000
|
||||
# local定时清除过期缓存(单位秒),设置为0代表不执行
|
||||
timing-clear: 3600
|
||||
|
||||
history-data-clear-enable: false
|
||||
|
||||
#swagger 配置
|
||||
swagger:
|
||||
basic:
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<!-- 根据需要自行配置 -->
|
||||
<springProperty scope="context" name="LOG_PORT" source="server.port"/>
|
||||
<property name="APP_NAME" value="Crmeb"/>
|
||||
<property name="log.path" value="../crmeb_front_log/${LOG_PORT}}"/>
|
||||
<!--<property name="log.path" value="/www/wwwroot/crmeb_front_log/${LOG_PORT}}"></property>-->
|
||||
<property name="log.path" value="crmeb_front_log/${LOG_PORT}}"></property>
|
||||
|
||||
<!--"@timestamp": "2019-06-27T09:59:41.897+08:00",-->
|
||||
<!--"@version": "1",-->
|
||||
|
||||
Reference in New Issue
Block a user