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 keywords;
private String type;
} }

View File

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

View File

@@ -44,7 +44,8 @@ public class ShopStoreToProductServiceImpl extends ServiceImpl<ShopStoreToProduc
.stream().map(ShopStoreToProductEntity::getProductId).collect(Collectors.toList()); .stream().map(ShopStoreToProductEntity::getProductId).collect(Collectors.toList());
LambdaQueryWrapper<ShopProduct> shopProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ShopProduct> shopProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
shopProductLambdaQueryWrapper.like(StringUtils.isNotBlank(param.getKeywords()),ShopProduct::getProductName,param.getKeywords()); 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); Page<ShopProduct> shopProductPage = shopProductDao.selectPage(new Page<>(param.getPage(), param.getLimit()), shopProductLambdaQueryWrapper);
return shopProductPage; return shopProductPage;
} }
@@ -69,6 +70,9 @@ public class ShopStoreToProductServiceImpl extends ServiceImpl<ShopStoreToProduc
@Override @Override
public R editStoreProductSort(Map<String, Integer> map) { public R editStoreProductSort(Map<String, Integer> map) {
ShopStoreToProductEntity info = this.getById(map.get("id")); ShopStoreToProductEntity info = this.getById(map.get("id"));
if (info==null){
return R.error("查找失败!");
}
info.setSort(map.get("sort")); info.setSort(map.get("sort"));
this.updateById(info); this.updateById(info);
return R.ok().put("result",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 userCourseBuyEntity = new UserCourseBuyEntity();
userCourseBuyEntity.setUserId(uId); userCourseBuyEntity.setUserId(uId);
userCourseBuyEntity.setCourseId(courseCatalogueEntity.getCourseId()); userCourseBuyEntity.setCourseId(courseCatalogueEntity.getCourseId());
userCourseBuyEntity.setCatalogueId(catalogueId);
userCourseBuyEntity.setDays(30); userCourseBuyEntity.setDays(30);
userCourseBuyEntity.setCreateTime(new Date()); userCourseBuyEntity.setCreateTime(new Date());
userCourseBuyEntity.setStartTime(new Date()); userCourseBuyEntity.setStartTime(new Date());

View File

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