后台产品新增上下架功能, 修改密码-update, app版本sql
This commit is contained in:
@@ -77,8 +77,8 @@ public class JobInfoController extends BladeController {
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入jobInfo")
|
||||
public R<IPage<JobInfo>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> jobInfo, Query query) {
|
||||
IPage<JobInfo> pages = jobInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(jobInfo, JobInfo.class));
|
||||
public R<IPage<JobInfo>> list(JobInfo jobInfo, Query query) {
|
||||
IPage<JobInfo> pages = jobInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(jobInfo).orderByDesc("id"));
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,15 @@ public class CulturalTourismSpotController extends BladeController {
|
||||
return R.status(culturalTourismSpotService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架文旅景点", description = "culturalTourismSpot.id")
|
||||
public R applyStatus(CulturalTourismSpotEntity culturalTourismSpot) {
|
||||
return R.status(culturalTourismSpotService.applyStatus(culturalTourismSpot.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean isValidRating(BigDecimal rating) {
|
||||
if (rating == null) {
|
||||
return false;
|
||||
|
||||
@@ -111,5 +111,12 @@ public class MerchantFlagshipStoreController extends BladeController {
|
||||
return R.status(merchantFlagshipStoreService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架店铺", description = "merchantFlagshipStore.id")
|
||||
public R applyStatus(MerchantFlagshipStoreEntity merchantFlagshipStore) {
|
||||
return R.status(merchantFlagshipStoreService.applyStatus(merchantFlagshipStore.getId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -108,6 +108,12 @@ public class NewsContentController extends BladeController {
|
||||
return R.status(newsContentService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架资讯", description = "newsContent.id")
|
||||
public R applyStatus(NewsContentEntity newsContent) {
|
||||
return R.status(newsContentService.applyStatus(newsContent.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ import org.springblade.modules.common.pojo.vo.TourProductVO;
|
||||
import org.springblade.modules.common.wrapper.TourProductWrapper;
|
||||
import org.springblade.modules.common.service.ITourProductService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -132,6 +131,12 @@ public class TourProductController extends BladeController {
|
||||
return R.status(tourProductService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架旅游产品", description = "tourProduct.id")
|
||||
public R applyStatus(TourProductEntity tourProduct) {
|
||||
return R.status(tourProductService.applyStatus(tourProduct.getId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
merchant_flagship_store
|
||||
WHERE
|
||||
ST_DWithin(location, ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326), 5000000)
|
||||
AND is_deleted = 0
|
||||
AND is_deleted = 0 and status = 1
|
||||
ORDER BY
|
||||
location <-> ST_SetSRID(ST_Point(#{request.longitude}, #{request.latitude}), 4326)
|
||||
LIMIT #{limit} OFFSET #{offset}
|
||||
|
||||
@@ -32,4 +32,5 @@ public interface ICulturalTourismSpotService extends BaseService<CulturalTourism
|
||||
CommonTourismSpotDetailApiVO tourismSpotDetail(@NotNull(message = "无效景点") Long id);
|
||||
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -39,4 +39,6 @@ public interface IMerchantFlagshipStoreService extends BaseService<MerchantFlags
|
||||
CommonMerchantStoreDetailApiVO merchantStoreDetail(@NotNull(message = "无效店铺") Long id);
|
||||
|
||||
MerchantFlagshipStoreEntity getByDetail(Long id);
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -29,4 +29,6 @@ public interface INewsContentService extends BaseService<NewsContentEntity> {
|
||||
IPage<CommonNewsContentApiVO> newsCategoryList(IPage<CommonNewsContentApiVO> page , Long categoryId);
|
||||
|
||||
CommonNewsContentDetailApiVO newsContentDetail(@NotNull(message = "无效资讯") Long id);
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -38,4 +38,6 @@ public interface ITourProductService extends BaseService<TourProductEntity> {
|
||||
IPage<CommonTourProductApiVO> tourProductTopList(IPage<CommonTourProductApiVO> page, TourProductRequest request);
|
||||
|
||||
CommonTourProductDetailApiVO tourProductDetail(@NotNull(message = "无效旅游团") Long id);
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -199,6 +199,9 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
MallProductEntity product = productService.getById(Long.valueOf(request.getItemCode()));
|
||||
Assert.notNull(product, "无效商品");
|
||||
if (product.getStatus() != 1) {
|
||||
throw new ServiceException("商品已下架");
|
||||
}
|
||||
if (!request.getIsOfflinePayment() && product.getRetailPrice().compareTo(BigDecimal.ONE) > 0) {
|
||||
discount = BigDecimal.valueOf(new Random().nextInt(99) + 1, 2);
|
||||
}
|
||||
@@ -507,6 +510,9 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
MallProductEntity product = productService.getById(Long.valueOf(request.getItemCode()));
|
||||
Assert.notNull(product, "无效商品");
|
||||
if (product.getStatus() != 1){
|
||||
throw new ServiceException("商品已下架");
|
||||
}
|
||||
CommonUserOrderEntity order = AppCommonConvert.INSTANCE.convertMallProductToOrder(request, product);
|
||||
BigDecimal totalAmount = product.getRetailPrice().multiply(BigDecimal.valueOf(request.getQuantity())).setScale(2, RoundingMode.DOWN);
|
||||
BigDecimal actualAmount = totalAmount.subtract(discount);
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.modules.api.vo.CommonTourismSpotApiVO;
|
||||
import org.springblade.modules.api.vo.CommonTourismSpotDetailApiVO;
|
||||
import org.springblade.modules.common.convert.CommonTourismSpotConvert;
|
||||
@@ -39,6 +40,7 @@ public class CulturalTourismSpotServiceImpl extends BaseServiceImpl<CulturalTour
|
||||
CulturalTourismSpotEntity::getThumbnailUrl,
|
||||
CulturalTourismSpotEntity::getSummary)
|
||||
.eq(CulturalTourismSpotEntity::getIsRecommended, 0)
|
||||
.eq(CulturalTourismSpotEntity::getStatus, 1)
|
||||
.orderByDesc(CulturalTourismSpotEntity::getVisitCount)
|
||||
|
||||
);
|
||||
@@ -58,6 +60,7 @@ public class CulturalTourismSpotServiceImpl extends BaseServiceImpl<CulturalTour
|
||||
CulturalTourismSpotEntity::getThumbnailUrl,
|
||||
CulturalTourismSpotEntity::getSummary)
|
||||
.eq(CulturalTourismSpotEntity::getIsRecommended, 1)
|
||||
.eq(CulturalTourismSpotEntity::getStatus, 1)
|
||||
.orderByDesc(CulturalTourismSpotEntity::getVisitCount)
|
||||
|
||||
);
|
||||
@@ -71,7 +74,15 @@ public class CulturalTourismSpotServiceImpl extends BaseServiceImpl<CulturalTour
|
||||
return CommonTourismSpotConvert.INSTANCE.convertTourismSpotDetailApiVO(tourismSpot);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
CulturalTourismSpotEntity tourismSpot = getById(id);
|
||||
if (tourismSpot == null){
|
||||
throw new ServiceException("无效文旅景点");
|
||||
}
|
||||
tourismSpot.setStatus(Math.abs(tourismSpot.getStatus() - 1));
|
||||
return updateById(tourismSpot);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -159,5 +160,25 @@ public class MerchantFlagshipStoreServiceImpl extends BaseServiceImpl<MerchantFl
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
|
||||
MerchantFlagshipStoreEntity merchantFlagshipStore = getOne(
|
||||
Wrappers.lambdaQuery(MerchantFlagshipStoreEntity.class)
|
||||
.select(MerchantFlagshipStoreEntity::getId, MerchantFlagshipStoreEntity::getStatus)
|
||||
.eq(MerchantFlagshipStoreEntity::getId, id)
|
||||
);
|
||||
|
||||
if (merchantFlagshipStore == null) {
|
||||
throw new ServiceException("无效店铺");
|
||||
}
|
||||
int status = Math.abs(merchantFlagshipStore.getStatus() - 1);
|
||||
return update(
|
||||
Wrappers.lambdaUpdate(MerchantFlagshipStoreEntity.class)
|
||||
.eq(MerchantFlagshipStoreEntity::getId, id)
|
||||
.set(MerchantFlagshipStoreEntity::getStatus, status)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ public class NewsCategoryServiceImpl extends BaseServiceImpl<NewsCategoryMapper,
|
||||
|
||||
List<NewsCategoryEntity> categoryList = list(
|
||||
Wrappers.lambdaQuery(NewsCategoryEntity.class)
|
||||
.eq(NewsCategoryEntity::getStatus, 1)
|
||||
.orderByDesc(NewsCategoryEntity::getIsTop)
|
||||
.orderByDesc(NewsCategoryEntity::getSortOrder)
|
||||
.orderByDesc(NewsCategoryEntity::getCreateTime)
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springblade.modules.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.modules.api.vo.CommonNewsCategoryApiVO;
|
||||
import org.springblade.modules.api.vo.CommonNewsContentApiVO;
|
||||
import org.springblade.modules.api.vo.CommonNewsContentDetailApiVO;
|
||||
@@ -48,6 +49,7 @@ public class NewsContentServiceImpl extends BaseServiceImpl<NewsContentMapper, N
|
||||
NewsContentEntity::getCreateTime
|
||||
)
|
||||
.eq(categoryId != null ,NewsContentEntity::getCategoryId, categoryId)
|
||||
.eq(NewsContentEntity::getStatus, 1)
|
||||
.orderByDesc(NewsContentEntity::getIsFeatured)
|
||||
.orderByDesc(NewsContentEntity::getSortOrder)
|
||||
.orderByDesc(NewsContentEntity::getCreateTime)
|
||||
@@ -61,5 +63,15 @@ public class NewsContentServiceImpl extends BaseServiceImpl<NewsContentMapper, N
|
||||
return CommonNewsContentConvert.INSTANCE.convertNewsContentDetailApiVO(newsContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
NewsContentEntity newsContent = getById(id);
|
||||
if (newsContent == null){
|
||||
throw new ServiceException("无效资讯信息");
|
||||
}
|
||||
newsContent.setStatus(Math.abs(newsContent.getStatus() - 1));
|
||||
return updateById(newsContent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
TourProductEntity::getRating,
|
||||
TourProductEntity::getBasePrice)
|
||||
.eq(TourProductEntity::getIsRecommended, 0)
|
||||
.eq(TourProductEntity::getStatus, 1)
|
||||
.like( request.getCityName() != null, TourProductEntity::getCityName, request.getCityName())
|
||||
.orderByDesc(TourProductEntity::getId)
|
||||
.orderByDesc(TourProductEntity::getVisitCount)
|
||||
@@ -168,6 +169,7 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
TourProductEntity::getRating,
|
||||
TourProductEntity::getBasePrice)
|
||||
.eq(TourProductEntity::getIsRecommended, 1)
|
||||
.eq(TourProductEntity::getStatus, 1)
|
||||
.like( request.getCityName() != null, TourProductEntity::getCityName, request.getCityName())
|
||||
.orderByDesc(TourProductEntity::getId)
|
||||
.orderByDesc(TourProductEntity::getVisitCount)
|
||||
@@ -182,6 +184,16 @@ public class TourProductServiceImpl extends BaseServiceImpl<TourProductMapper, T
|
||||
return CommonTourProductConvert.INSTANCE.convertTourProductDetailApiVO(tourProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
TourProductEntity tourProduct = getById(id);
|
||||
if (tourProduct == null) {
|
||||
throw new ServiceException("无效商品");
|
||||
}
|
||||
tourProduct.setStatus(Math.abs(tourProduct.getStatus() - 1));
|
||||
return updateById(tourProduct);
|
||||
}
|
||||
|
||||
|
||||
private boolean isValidRating(BigDecimal rating) {
|
||||
if (rating == null) {
|
||||
|
||||
@@ -150,4 +150,11 @@ public class MallProductController extends BladeController {
|
||||
return R.status(mallProductService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/applyStatus")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "上下架商品", description = "mallProduct.id")
|
||||
public R applyStatus(MallProductEntity mallProduct) {
|
||||
return R.status(mallProductService.applyStatus(mallProduct.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
</select>
|
||||
|
||||
<select id="selectDirectMallPage" resultMap="mallProductResultMap">
|
||||
select * from mall_product where is_deleted = 0 and status = 1 and category_id = 2033413707249164290 order by create_time desc
|
||||
select * from mall_product where is_deleted = 0 and category_id = 2033413707249164290 order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectEcosystemProductPage" resultMap="mallProductResultMap">
|
||||
select * from mall_product where is_deleted = 0 and status = 1 and category_id = 2033413760969809921 order by create_time desc
|
||||
select * from mall_product where is_deleted = 0 and category_id = 2033413760969809921 order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -39,4 +39,5 @@ public interface IMallProductService extends BaseService<MallProductEntity> {
|
||||
MallProductDetailApiVO apiDetailVO(@NotNull(message = "无效商品") Long id);
|
||||
|
||||
|
||||
boolean applyStatus(Long id);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ package org.springblade.modules.mall.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.modules.api.vo.MallProductApiVO;
|
||||
import org.springblade.modules.api.vo.MallProductDetailApiVO;
|
||||
import org.springblade.modules.mall.convert.AppMallConvert;
|
||||
@@ -93,4 +94,17 @@ public class MallProductServiceImpl extends BaseServiceImpl<MallProductMapper, M
|
||||
return AppMallConvert.INSTANCE.convertMallProductDetailApiVO(product);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyStatus(Long id) {
|
||||
|
||||
MallProductEntity product = getById(id);
|
||||
if (product == null) {
|
||||
throw new ServiceException("无效商品");
|
||||
}
|
||||
|
||||
product.setStatus(Math.abs(product.getStatus() - 1));
|
||||
|
||||
return updateById( product);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -704,7 +704,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
||||
String decryptPassword = SM2Util.decrypt(request.getPassword(), properties.getPublicKey(), properties.getPrivateKey());
|
||||
|
||||
if (!isPasswordValid(decryptPassword)) {
|
||||
throw new ServiceException("密码必须包含大小写字母、数字,长度8-12位");
|
||||
throw new ServiceException("密码必须包含字母、数字,长度至少8位");
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -723,7 +723,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
||||
|
||||
private boolean isPasswordValid(String password) {
|
||||
// 规则: 必须包含大小写字母和数字, 长度8-12位, 仅允许字母和数字
|
||||
return password.matches("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,12}$");
|
||||
return password.matches("^[a-zA-Z0-9]{8,}$");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user