This commit is contained in:
wangjinlei
2024-05-27 14:22:17 +08:00
parent 34521517c9
commit 9ba7f281cf
5 changed files with 16 additions and 11 deletions

View File

@@ -15,4 +15,6 @@ public class ParamTo {
private String keywords;
private String type;
}

View File

@@ -1,5 +1,6 @@
package com.peanut.modules.master.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.R;
@@ -33,13 +34,10 @@ public class ShopStoreController {
*/
@RequestMapping("/getStoreList")
public R getStoreList(@RequestBody Map params){
MPJLambdaWrapper<ShopStore> wrapper = new MPJLambdaWrapper();
if (params.containsKey("name")&&!"".equals(params.get("name").toString())){
wrapper.like(ShopStore::getName,params.get("name").toString());
}
Page<ShopStore> page = shopStoreService.page(new Page<>(
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
return R.ok().put("result", page);
LambdaQueryWrapper<ShopStore> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByAsc(ShopStore::getSort);
List<ShopStore> shopStores = shopStoreService.getBaseMapper().selectList(wrapper);
return R.ok().put("list",shopStores);
}
@RequestMapping(path = "/getStoreById")
@@ -51,7 +49,7 @@ public class ShopStoreController {
@RequestMapping(path = "/saveOrUpdateStore")
public R saveOrUpdateStore(@RequestBody ShopStore store) {
shopStoreService.saveOrUpdate(store);
return R.ok();
return R.ok().put("result",store);
}
@RequestMapping(path = "/delStore")

View File

@@ -44,7 +44,8 @@ public class ShopStoreToProductServiceImpl extends ServiceImpl<ShopStoreToProduc
.stream().map(ShopStoreToProductEntity::getProductId).collect(Collectors.toList());
LambdaQueryWrapper<ShopProduct> shopProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
shopProductLambdaQueryWrapper.like(StringUtils.isNotBlank(param.getKeywords()),ShopProduct::getProductName,param.getKeywords());
shopProductLambdaQueryWrapper.notIn(ShopProduct::getProductId,collect);
shopProductLambdaQueryWrapper.eq(param.getType().equals("00"),ShopProduct::getGoodsType,param.getType());
shopProductLambdaQueryWrapper.notIn(collect.size()>0,ShopProduct::getProductId,collect);
Page<ShopProduct> shopProductPage = shopProductDao.selectPage(new Page<>(param.getPage(), param.getLimit()), shopProductLambdaQueryWrapper);
return shopProductPage;
}
@@ -69,6 +70,9 @@ public class ShopStoreToProductServiceImpl extends ServiceImpl<ShopStoreToProduc
@Override
public R editStoreProductSort(Map<String, Integer> map) {
ShopStoreToProductEntity info = this.getById(map.get("id"));
if (info==null){
return R.error("查找失败!");
}
info.setSort(map.get("sort"));
this.updateById(info);
return R.ok().put("result",info);

View File

@@ -176,6 +176,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
UserCourseBuyEntity userCourseBuyEntity = new UserCourseBuyEntity();
userCourseBuyEntity.setUserId(uId);
userCourseBuyEntity.setCourseId(courseCatalogueEntity.getCourseId());
userCourseBuyEntity.setCatalogueId(catalogueId);
userCourseBuyEntity.setDays(30);
userCourseBuyEntity.setCreateTime(new Date());
userCourseBuyEntity.setStartTime(new Date());

View File

@@ -210,8 +210,8 @@
<!-- &lt;!&ndash; 4.2 生产环境:输出到文档&ndash;&gt;-->
<springProfile name="test,prod">
<logger name="com.peanut" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_FILE"/>
<logger name="com.peanut" level="ERROR" additivity="false">
<!-- <appender-ref ref="DEBUG_FILE"/>-->
<appender-ref ref="ERROR_FILE"/>
</logger>
<root level="info">