springboot升级2.4.2,代码优化去掉无用代码
This commit is contained in:
4
pom.xml
4
pom.xml
@ -28,7 +28,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.4.1</version>
|
||||
<version>2.4.2</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@ -37,7 +37,7 @@
|
||||
<java.version>1.8</java.version>
|
||||
<jedis.version>2.9.0</jedis.version>
|
||||
<swagger.version>2.9.2</swagger.version>
|
||||
<fastjson.version>1.2.74</fastjson.version>
|
||||
<fastjson.version>1.2.75</fastjson.version>
|
||||
<druid.version>1.1.10</druid.version>
|
||||
<hutool.version>5.2.5</hutool.version>
|
||||
<commons-pool2.version>2.5.0</commons-pool2.version>
|
||||
|
@ -1,3 +1,11 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.common.param;
|
||||
|
||||
|
||||
|
@ -30,7 +30,8 @@ public class CityTreeUtil {
|
||||
if (res.getPid() == parentId) {
|
||||
//该节点为根节点,开始递归
|
||||
|
||||
recursionFn(list, res); //通过递归为节点设置childList
|
||||
//通过递归为节点设置childList
|
||||
recursionFn(list, res);
|
||||
|
||||
returnList.add(res);
|
||||
}
|
||||
@ -54,7 +55,9 @@ public class CityTreeUtil {
|
||||
t.setC(childsList);
|
||||
|
||||
//迭代子集对象集
|
||||
for (CityVo nextChild : childsList) { //遍历完,则退出递归
|
||||
|
||||
//遍历完,则退出递归
|
||||
for (CityVo nextChild : childsList) {
|
||||
|
||||
//判断子集对象是否还有子节点
|
||||
if (!CollectionUtils.isEmpty(childsList)) {
|
||||
|
@ -5,6 +5,11 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @ClassName 获取Request工具类
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2020/6/26
|
||||
**/
|
||||
public class RequestUtils {
|
||||
|
||||
public static HttpServletRequest getRequest() {
|
||||
|
@ -68,7 +68,7 @@ import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping
|
||||
@Api(value = "砍价商品", tags = "营销:砍价商品", description = "砍价商品")
|
||||
@Api(value = "砍价商品", tags = "营销:砍价商品")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@SuppressWarnings("unchecked")
|
||||
public class StoreBargainController {
|
||||
|
@ -59,7 +59,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "拼团", tags = "营销:拼团", description = "拼团")
|
||||
@Api(value = "拼团", tags = "营销:拼团")
|
||||
public class StoreCombinationController {
|
||||
|
||||
private final YxStoreCombinationService storeCombinationService;
|
||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping
|
||||
@Api(value = "积分兑换", tags = "营销:积分兑换", description = "积分兑换")
|
||||
@Api(value = "积分兑换", tags = "营销:积分兑换")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreIntegralController {
|
||||
|
||||
|
@ -57,7 +57,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping
|
||||
@Api(value = "商品秒杀", tags = "营销:商品秒杀", description = "商品秒杀")
|
||||
@Api(value = "商品秒杀", tags = "营销:商品秒杀")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreSeckillController {
|
||||
|
||||
|
@ -58,7 +58,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "认证模块", tags = "商城:认证", description = "认证")
|
||||
@Api(value = "认证模块", tags = "商城:认证")
|
||||
public class AuthController {
|
||||
|
||||
private final YxUserService userService;
|
||||
|
@ -42,7 +42,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(value = "购物车", tags = "商城:购物车", description = "购物车")
|
||||
@Api(value = "购物车", tags = "商城:购物车")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreCartController {
|
||||
|
||||
|
@ -48,7 +48,7 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(value = "优惠券", tags = "营销:优惠券", description = "优惠券")
|
||||
@Api(value = "优惠券", tags = "营销:优惠券")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class CouponController {
|
||||
|
||||
|
@ -52,7 +52,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "商家管理", tags = "商城:商家管理", description = "商家管理")
|
||||
@Api(value = "商家管理", tags = "商城:商家管理")
|
||||
public class ShoperController {
|
||||
|
||||
private final YxStoreOrderService storeOrderService;
|
||||
|
@ -81,7 +81,7 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "订单模块", tags = "商城:订单模块", description = "订单模块")
|
||||
@Api(value = "订单模块", tags = "商城:订单模块")
|
||||
public class StoreOrderController {
|
||||
|
||||
private final YxStoreOrderService storeOrderService;
|
||||
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(value = "商品分类", tags = "商城:商品分类", description = "商品分类")
|
||||
@Api(value = "商品分类", tags = "商城:商品分类")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreCategoryController {
|
||||
|
||||
|
@ -73,7 +73,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(value = "产品模块", tags = "商城:产品模块", description = "产品模块")
|
||||
@Api(value = "产品模块", tags = "商城:产品模块")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class StoreProductController {
|
||||
|
||||
@ -97,13 +97,17 @@ public class StoreProductController {
|
||||
@ApiOperation(value = "获取首页更多产品",notes = "获取首页更多产品")
|
||||
public ApiResult<Map<String,Object>> moreGoodsList(@PathVariable Integer type){
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
if(ProductEnum.TYPE_1.getValue().equals(type)){// 精品推荐
|
||||
// 精品推荐
|
||||
if(ProductEnum.TYPE_1.getValue().equals(type)){
|
||||
map.put("list",storeProductService.getList(1,20,ProductEnum.TYPE_1.getValue()));
|
||||
}else if(type.equals(ProductEnum.TYPE_2.getValue())){// 热门榜单
|
||||
// 热门榜单
|
||||
}else if(type.equals(ProductEnum.TYPE_2.getValue())){
|
||||
map.put("list",storeProductService.getList(1,20,ProductEnum.TYPE_2.getValue()));
|
||||
}else if(type.equals(ProductEnum.TYPE_3.getValue())){// 首发新品
|
||||
// 首发新品
|
||||
}else if(type.equals(ProductEnum.TYPE_3.getValue())){
|
||||
map.put("list",storeProductService.getList(1,20,ProductEnum.TYPE_3.getValue()));
|
||||
}else if(type.equals(ProductEnum.TYPE_4.getValue())){// 促销单品
|
||||
// 促销单品
|
||||
}else if(type.equals(ProductEnum.TYPE_4.getValue())){
|
||||
map.put("list",storeProductService.getList(1,20,ProductEnum.TYPE_4.getValue()));
|
||||
}
|
||||
|
||||
@ -173,7 +177,8 @@ public class StoreProductController {
|
||||
//生成二维码
|
||||
QrCodeUtil.generate(siteUrl+"?id="+id+"&spread="+uid+"&pageType=good&codeType="+AppFromEnum.APP.getValue(), 180, 180,
|
||||
FileUtil.file(fileDir+name));
|
||||
}else if(AppFromEnum.H5.getValue().equals(from)){//如果类型是h5
|
||||
//如果类型是h5
|
||||
}else if(AppFromEnum.H5.getValue().equals(from)){
|
||||
//生成二维码
|
||||
QrCodeUtil.generate(siteUrl+"/detail/"+id+"?spread="+uid, 180, 180,
|
||||
FileUtil.file(fileDir+name));
|
||||
|
@ -58,6 +58,11 @@ import java.net.URL;
|
||||
|
||||
import static co.yixiang.utils.FileUtil.transformStyle;
|
||||
|
||||
/**
|
||||
* @ClassName 二维码相关服务
|
||||
* @Author hupeng <610796224@qq.com>
|
||||
* @Date 2020/6/22
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@ -780,7 +785,7 @@ public class CreatShareProductService {
|
||||
|
||||
//价格背景
|
||||
//读取互联网图片
|
||||
BufferedImage bground = null;//
|
||||
BufferedImage bground = null;
|
||||
InputStream redStream = getClass().getClassLoader().getResourceAsStream("red.jpg");
|
||||
try {
|
||||
ImageInputStream red = ImageIO.createImageInputStream(redStream);
|
||||
|
@ -244,6 +244,7 @@ public class OrderSupplyService {
|
||||
storeOrderService.integralPay(orderId,uid);
|
||||
map.put("payMsg","积分兑换成功");
|
||||
return map;
|
||||
default:
|
||||
}
|
||||
|
||||
map.put("payMsg","订单生成失败");
|
||||
|
@ -36,7 +36,7 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@RequestMapping("/article")
|
||||
@Api(value = "文章模块", tags = "商城:文章模块", description = "文章模块")
|
||||
@Api(value = "文章模块", tags = "商城:文章模块")
|
||||
public class ArticleController {
|
||||
|
||||
private final YxArticleService articleService;
|
||||
|
@ -57,7 +57,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "首页模块", tags = "商城:首页模块", description = "首页模块")
|
||||
@Api(value = "首页模块", tags = "商城:首页模块")
|
||||
public class IndexController {
|
||||
private final YxAppVersionService appVersionService;
|
||||
private final YxSystemGroupDataService systemGroupDataService;
|
||||
@ -148,7 +148,7 @@ public class IndexController {
|
||||
appVersionVo.setVersionCode(appVersion.getVersionCode());
|
||||
appVersionVo.setVersionInfo(appVersion.getVersionInfo());
|
||||
appVersionVo.setVersionName(appVersion.getVersionName());
|
||||
appVersionVo.setDownloadUrl(param.getType().equals("1101")?appVersion.getAndroidUrl():appVersion.getIosUrl());
|
||||
appVersionVo.setDownloadUrl("1101".equals(param.getType())?appVersion.getAndroidUrl():appVersion.getIosUrl());
|
||||
appVersionVo.setForceUpdate(appVersion.getForceUpdate()==0);
|
||||
if (!param.getVersionName().equals(appVersion.getVersionName())){
|
||||
return ApiResult.ok(appVersionVo);
|
||||
|
@ -54,7 +54,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "用户地址", tags = "用户:用户地址", description = "用户地址")
|
||||
@Api(value = "用户地址", tags = "用户:用户地址")
|
||||
public class UserAddressController {
|
||||
|
||||
private final YxUserAddressService userAddressService;
|
||||
|
@ -56,7 +56,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "用户分销", tags = "用户:用户分销", description = "用户分销")
|
||||
@Api(value = "用户分销", tags = "用户:用户分销")
|
||||
public class UserBillController {
|
||||
|
||||
private final YxUserBillService userBillService;
|
||||
|
@ -61,7 +61,7 @@ import static co.yixiang.constant.SystemConfigConstants.YSHOP_SHOW_RECHARGE;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "用户中心", tags = "用户:用户中心", description = "用户中心")
|
||||
@Api(value = "用户中心", tags = "用户:用户中心")
|
||||
public class UserController {
|
||||
|
||||
private final YxUserService yxUserService;
|
||||
|
@ -43,7 +43,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "用户提现", tags = "用户:用户提现", description = "用户提现")
|
||||
@Api(value = "用户提现", tags = "用户:用户提现")
|
||||
public class UserExtractController {
|
||||
|
||||
private final YxUserExtractService userExtractService;
|
||||
|
@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "用户等级", tags = "用户:用户等级", description = "用户等级")
|
||||
@Api(value = "用户等级", tags = "用户:用户等级")
|
||||
public class UserLevelController {
|
||||
|
||||
private final YxUserLevelService userLevelService;
|
||||
|
@ -58,7 +58,7 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "用户充值", tags = "用户:用户充值", description = "用户充值")
|
||||
@Api(value = "用户充值", tags = "用户:用户充值")
|
||||
public class UserRechargeController {
|
||||
|
||||
private final YxUserRechargeService userRechargeService;
|
||||
|
@ -63,7 +63,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "微信模块", tags = "微信:微信模块", description = "微信模块")
|
||||
@Api(value = "微信模块", tags = "微信:微信模块")
|
||||
public class WechatController {
|
||||
|
||||
private final YxStoreOrderService orderService;
|
||||
|
@ -45,7 +45,7 @@ import java.util.Map;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
@Api(value = "微信其他", tags = "微信:微信其他", description = "微信其他")
|
||||
@Api(value = "微信其他", tags = "微信:微信其他")
|
||||
public class WxMaUserController {
|
||||
|
||||
private final YxUserService userService;
|
||||
|
@ -1149,6 +1149,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||
.in(YxStoreOrder::getRefundStatus, Arrays.asList(strs));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
Page<YxStoreOrder> pageModel = new Page<>(page, limit);
|
||||
|
@ -436,6 +436,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
||||
wrapper.eq(YxStoreProduct::getIsHot,
|
||||
ShopCommonEnum.IS_STATUS_1.getValue());
|
||||
break;
|
||||
default:
|
||||
}
|
||||
Page<YxStoreProduct> pageModel = new Page<>(page, limit);
|
||||
|
||||
|
@ -14,9 +14,15 @@ import java.util.List;
|
||||
@Setter
|
||||
public class AppointInfoDto {
|
||||
|
||||
private String a_num; //包邮件数
|
||||
private String a_price; //包邮费用
|
||||
private List<RegionDto> place; //包邮地区
|
||||
/** 包邮件数 */
|
||||
private String a_num;
|
||||
|
||||
/** 包邮费用 */
|
||||
private String a_price;
|
||||
|
||||
/** 包邮地区 */
|
||||
private List<RegionDto> place;
|
||||
|
||||
private String placeName;
|
||||
|
||||
}
|
||||
|
@ -161,6 +161,7 @@ public class YxSystemUserTaskServiceImpl extends BaseServiceImpl<SystemUserTaskM
|
||||
sumNumber = userBillService.cumulativeAttendance(uid);
|
||||
title = "还需签到{0}天";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
if(sumNumber >= taskQueryVo.getNumber()){
|
||||
|
@ -541,6 +541,7 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
|
||||
.round(NumberUtil.mul(order.getTotalPrice(),storeBrokerageTwo),2);
|
||||
//固定返佣 + 比例返佣 = 总返佣金额
|
||||
return NumberUtil.add(twoBrokerage,storeBrokerageTwoPrice);
|
||||
default:
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,7 +63,9 @@ public class YxStoreCustomerController {
|
||||
@PreAuthorize("@el.check('admin','yxStoreCustomer:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody YxStoreCustomer resources){
|
||||
int count = yxStoreCustomerService.count(new LambdaQueryWrapper<YxStoreCustomer>().eq(YxStoreCustomer::getOpenId, resources.getOpenId()));
|
||||
if (count > 0) throw new BadRequestException("当前用户已存在,请勿重复提交");
|
||||
if (count > 0) {
|
||||
throw new BadRequestException("当前用户已存在,请勿重复提交");
|
||||
}
|
||||
return new ResponseEntity<>(yxStoreCustomerService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
@ -388,8 +388,8 @@ public class StoreOrderController {
|
||||
private YxStoreOrderQueryCriteria handleQuery(YxStoreOrderQueryCriteria criteria,String orderStatus,
|
||||
String orderType){
|
||||
|
||||
|
||||
criteria.setShippingType(OrderInfoEnum.SHIPPIING_TYPE_1.getValue());//默认查询所有快递订单
|
||||
//默认查询所有快递订单
|
||||
criteria.setShippingType(OrderInfoEnum.SHIPPIING_TYPE_1.getValue());
|
||||
//订单状态查询
|
||||
if (StrUtil.isNotEmpty(orderStatus)) {
|
||||
switch (orderStatus) {
|
||||
@ -426,6 +426,7 @@ public class StoreOrderController {
|
||||
criteria.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue());
|
||||
criteria.setRefundStatus(OrderInfoEnum.REFUND_STATUS_2.getValue());
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
//订单类型查询
|
||||
@ -448,6 +449,7 @@ public class StoreOrderController {
|
||||
case "5":
|
||||
criteria.setShippingType(2);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@ import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -55,6 +55,7 @@ public class WxPayConfiguration {
|
||||
case APP:
|
||||
payConfig.setAppId(RedisUtil.get(ShopKeyUtils.getWxNativeAppAppId()));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
payConfig.setMchId(redisUtils.getY(ShopKeyUtils.getWxPayMchId()));
|
||||
|
Reference in New Issue
Block a user