QueryWrapper全部升级LambdaQueryWrapper

This commit is contained in:
LIONCITYS\lioncity
2020-10-16 14:51:38 +08:00
parent 15b9680209
commit 4c89f55a05
44 changed files with 242 additions and 243 deletions

View File

@ -41,7 +41,7 @@ public class VisitsServiceImpl extends BaseServiceImpl<VisitsMapper, Visits> imp
@Override @Override
public void save() { public void save() {
LocalDate localDate = LocalDate.now(); LocalDate localDate = LocalDate.now();
Visits visits = this.getOne(new QueryWrapper<Visits>().lambda() Visits visits = this.getOne(new LambdaQueryWrapper<Visits>()
.eq(Visits::getDate,localDate.toString())); .eq(Visits::getDate,localDate.toString()));
if(visits == null){ if(visits == null){
visits = new Visits(); visits = new Visits();
@ -56,7 +56,7 @@ public class VisitsServiceImpl extends BaseServiceImpl<VisitsMapper, Visits> imp
@Override @Override
public void count(HttpServletRequest request) { public void count(HttpServletRequest request) {
LocalDate localDate = LocalDate.now(); LocalDate localDate = LocalDate.now();
Visits visits = this.getOne(new QueryWrapper<Visits>().lambda() Visits visits = this.getOne(new LambdaQueryWrapper<Visits>()
.eq(Visits::getDate,localDate.toString())); .eq(Visits::getDate,localDate.toString()));
visits.setPvCounts(visits.getPvCounts()+1); visits.setPvCounts(visits.getPvCounts()+1);
long ipCounts = logMapper.findIp(localDate.toString(), localDate.plusDays(1).toString()); long ipCounts = logMapper.findIp(localDate.toString(), localDate.plusDays(1).toString());
@ -68,7 +68,7 @@ public class VisitsServiceImpl extends BaseServiceImpl<VisitsMapper, Visits> imp
public Object get() { public Object get() {
Map<String,Object> map = new HashMap<>(4); Map<String,Object> map = new HashMap<>(4);
LocalDate localDate = LocalDate.now(); LocalDate localDate = LocalDate.now();
Visits visits = this.getOne(new QueryWrapper<Visits>().lambda() Visits visits = this.getOne(new LambdaQueryWrapper<Visits>()
.eq(Visits::getDate,localDate.toString())); .eq(Visits::getDate,localDate.toString()));
List<Visits> list = visitsMapper.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString()); List<Visits> list = visitsMapper.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString());

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.quartz.service.dto.QuartzJobQueryCriteria;
import co.yixiang.modules.quartz.service.dto.QuartzLogDto; import co.yixiang.modules.quartz.service.dto.QuartzLogDto;
import co.yixiang.modules.quartz.service.dto.QuartzLogQueryCriteria; import co.yixiang.modules.quartz.service.dto.QuartzLogQueryCriteria;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -134,7 +134,7 @@ public class QuartzJobController {
@PutMapping(value = "/exec/{id}") @PutMapping(value = "/exec/{id}")
@PreAuthorize("@el.check('admin','timing:edit')") @PreAuthorize("@el.check('admin','timing:edit')")
public ResponseEntity<Object> execution(@PathVariable Long id){ public ResponseEntity<Object> execution(@PathVariable Long id){
quartzJobService.execution(quartzJobService.getOne(new QueryWrapper<QuartzJob>().eq("id",id))); quartzJobService.execution(quartzJobService.getOne(new LambdaQueryWrapper<QuartzJob>().eq(QuartzJob::getId,id)));
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }

View File

@ -16,7 +16,7 @@ import co.yixiang.modules.system.service.DeptService;
import co.yixiang.modules.system.service.dto.DeptDto; import co.yixiang.modules.system.service.dto.DeptDto;
import co.yixiang.modules.system.service.dto.DeptQueryCriteria; import co.yixiang.modules.system.service.dto.DeptQueryCriteria;
import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.ValidationUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -98,7 +98,7 @@ public class DeptController {
if(resources.getId().equals(resources.getPid())) { if(resources.getId().equals(resources.getPid())) {
throw new BadRequestException("上级不能为自己"); throw new BadRequestException("上级不能为自己");
} }
Dept dept = deptService.getOne(new QueryWrapper<Dept>().lambda() Dept dept = deptService.getOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getId,resources.getId())); .eq(Dept::getId,resources.getId()));
ValidationUtil.isNull( dept.getId(),"Dept","id",resources.getId()); ValidationUtil.isNull( dept.getId(),"Dept","id",resources.getId());
resources.setId(dept.getId()); resources.setId(dept.getId());
@ -115,7 +115,7 @@ public class DeptController {
List<Long> deptIds = new ArrayList<>(); List<Long> deptIds = new ArrayList<>();
for (Long id : ids) { for (Long id : ids) {
List<Dept> deptList = deptService.findByPid(id); List<Dept> deptList = deptService.findByPid(id);
Dept dept = deptService.getOne(new QueryWrapper<Dept>().eq("id",id)); Dept dept = deptService.getOne(new LambdaQueryWrapper<Dept>().eq(Dept::getId,id));
if(null!=dept){ if(null!=dept){
deptIds.add(dept.getId()); deptIds.add(dept.getId());
} }

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.system.service.dto.MenuDto;
import co.yixiang.modules.system.service.dto.MenuQueryCriteria; import co.yixiang.modules.system.service.dto.MenuQueryCriteria;
import co.yixiang.modules.system.service.dto.UserDto; import co.yixiang.modules.system.service.dto.UserDto;
import co.yixiang.utils.SecurityUtils; import co.yixiang.utils.SecurityUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -131,7 +131,7 @@ public class MenuController {
Set<Menu> menuSet = new HashSet<>(); Set<Menu> menuSet = new HashSet<>();
for (Long id : ids) { for (Long id : ids) {
List<Menu> menuList = menuService.findByPid(id); List<Menu> menuList = menuService.findByPid(id);
menuSet.add(menuService.getOne(new QueryWrapper<Menu>().eq("id",id))); menuSet.add(menuService.getOne(new LambdaQueryWrapper<Menu>().eq(Menu::getId,id)));
menuSet = menuService.getDeleteMenus(menuList, menuSet); menuSet = menuService.getDeleteMenus(menuList, menuSet);
} }
menuService.delete(menuSet); menuService.delete(menuSet);

View File

@ -190,7 +190,7 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, Dept> implement
for (Dept dept : deptList) { for (Dept dept : deptList) {
deptDtos.add((DeptDto)generator.convert(deptList,DeptDto.class)); deptDtos.add((DeptDto)generator.convert(deptList,DeptDto.class));
List<Dept> depts = Collections.singletonList(this.getOne(new QueryWrapper<Dept>().eq("id", dept.getId()))); List<Dept> depts = Collections.singletonList(this.getOne(new LambdaQueryWrapper<Dept>().eq("id", dept.getId())));
if(depts!=null && depts.size()!=0){ if(depts!=null && depts.size()!=0){
getDeleteDepts(depts, deptDtos); getDeleteDepts(depts, deptDtos);
} }

View File

@ -28,7 +28,7 @@ import co.yixiang.modules.system.service.mapper.RoleMapper;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.ValidationUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
@ -306,7 +306,7 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
isExitHttp(resources); isExitHttp(resources);
Menu menu1 = this.getOne(new QueryWrapper<Menu>().lambda() Menu menu1 = this.getOne(new LambdaQueryWrapper<Menu>()
.eq(Menu::getName,resources.getName())); .eq(Menu::getName,resources.getName()));
if(menu1 != null && !menu1.getId().equals(menu.getId())){ if(menu1 != null && !menu1.getId().equals(menu.getId())){
@ -318,7 +318,7 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
if(menuCount > 1) { if(menuCount > 1) {
throw new YshopException("请保持菜单组件名称唯一"); throw new YshopException("请保持菜单组件名称唯一");
} }
menu1 = this.getOne(new QueryWrapper<Menu>().lambda() menu1 = this.getOne(new LambdaQueryWrapper<Menu>()
.eq(Menu::getComponentName,resources.getComponentName())); .eq(Menu::getComponentName,resources.getComponentName()));
if(menu1 != null && !menu1.getId().equals(menu.getId())){ if(menu1 != null && !menu1.getId().equals(menu.getId())){
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
@ -345,11 +345,11 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
@CacheEvict(allEntries = true) @CacheEvict(allEntries = true)
public MenuDto create(Menu resources) { public MenuDto create(Menu resources) {
isExitHttp(resources); isExitHttp(resources);
if(this.getOne(new QueryWrapper<Menu>().eq("name",resources.getName())) != null){ if(this.getOne(new LambdaQueryWrapper<Menu>().eq(Menu::getName,resources.getName())) != null){
throw new EntityExistException(Menu.class,"name",resources.getName()); throw new EntityExistException(Menu.class,"name",resources.getName());
} }
if(StringUtils.isNotBlank(resources.getComponentName())){ if(StringUtils.isNotBlank(resources.getComponentName())){
if(this.getOne(new QueryWrapper<Menu>().eq("component_name",resources.getComponentName())) != null){ if(this.getOne(new LambdaQueryWrapper<Menu>().eq(Menu::getComponentName,resources.getComponentName())) != null){
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName()); throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
} }
} }

View File

@ -30,7 +30,6 @@ import co.yixiang.modules.system.service.mapper.RoleMapper;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -190,11 +189,11 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
// @CacheEvict(allEntries = true) // @CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public RoleDto create(Role resources) { public RoleDto create(Role resources) {
if (this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getName, resources.getName())) != null) { if (this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getName, resources.getName())) != null) {
throw new EntityExistException(Role.class, "username", resources.getName()); throw new EntityExistException(Role.class, "username", resources.getName());
} }
if (this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getName, resources.getName())) != null) { if (this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getName, resources.getName())) != null) {
throw new EntityExistException(Role.class, "username", resources.getName()); throw new EntityExistException(Role.class, "username", resources.getName());
} }
this.save(resources); this.save(resources);
@ -216,12 +215,12 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
public void update(Role resources) { public void update(Role resources) {
Role role = this.getById(resources.getId()); Role role = this.getById(resources.getId());
Role role1 = this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getName, resources.getName())); Role role1 = this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getName, resources.getName()));
if (role1 != null && !role1.getId().equals(role.getId())) { if (role1 != null && !role1.getId().equals(role.getId())) {
throw new EntityExistException(Role.class, "username", resources.getName()); throw new EntityExistException(Role.class, "username", resources.getName());
} }
role1 = this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getPermission, resources.getPermission())); role1 = this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getPermission, resources.getPermission()));
if (role1 != null && !role1.getId().equals(role.getId())) { if (role1 != null && !role1.getId().equals(role.getId())) {
throw new EntityExistException(Role.class, "permission", resources.getPermission()); throw new EntityExistException(Role.class, "permission", resources.getPermission());
} }

View File

@ -32,7 +32,7 @@ import co.yixiang.utils.RedisUtils;
import co.yixiang.utils.SecurityUtils; import co.yixiang.utils.SecurityUtils;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.ValidationUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -172,9 +172,9 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
*/ */
@Override @Override
public void updateAvatar(MultipartFile multipartFile) { public void updateAvatar(MultipartFile multipartFile) {
User user = this.getOne(new QueryWrapper<User>().lambda() User user = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getUsername,SecurityUtils.getUsername())); .eq(User::getUsername,SecurityUtils.getUsername()));
UserAvatar userAvatar = userAvatarService.getOne(new QueryWrapper<UserAvatar>().lambda() UserAvatar userAvatar = userAvatarService.getOne(new LambdaQueryWrapper<UserAvatar>()
.eq(UserAvatar::getId,user.getAvatarId())); .eq(UserAvatar::getId,user.getAvatarId()));
String oldPath = ""; String oldPath = "";
if(userAvatar != null){ if(userAvatar != null){
@ -217,12 +217,12 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
//@CacheEvict(allEntries = true) //@CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean create(User resources) { public boolean create(User resources) {
User userName = this.getOne(new QueryWrapper<User>().lambda() User userName = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getUsername,resources.getUsername())); .eq(User::getUsername,resources.getUsername()));
if(userName != null){ if(userName != null){
throw new EntityExistException(User.class,"username",resources.getUsername()); throw new EntityExistException(User.class,"username",resources.getUsername());
} }
User userEmail = this.getOne(new QueryWrapper<User>().lambda() User userEmail = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getEmail,resources.getEmail())); .eq(User::getEmail,resources.getEmail()));
if(userEmail != null){ if(userEmail != null){
throw new EntityExistException(User.class,"email",resources.getEmail()); throw new EntityExistException(User.class,"email",resources.getEmail());
@ -251,12 +251,12 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
//@CacheEvict(allEntries = true) //@CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(User resources) { public void update(User resources) {
User user = this.getOne(new QueryWrapper<User>().lambda() User user = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getId,resources.getId())); .eq(User::getId,resources.getId()));
ValidationUtil.isNull(user.getId(),"User","id",resources.getId()); ValidationUtil.isNull(user.getId(),"User","id",resources.getId());
User user1 = this.getOne(new QueryWrapper<User>().lambda() User user1 = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getUsername,resources.getUsername())); .eq(User::getUsername,resources.getUsername()));
User user2 = this.getOne(new QueryWrapper<User>().lambda() User user2 = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getEmail,resources.getEmail())); .eq(User::getEmail,resources.getEmail()));
if(user1 !=null&&!user.getId().equals(user1.getId())){ if(user1 !=null&&!user.getId().equals(user1.getId())){

View File

@ -9,7 +9,6 @@ import co.yixiang.common.bean.LocalUser;
import co.yixiang.logging.domain.Log; import co.yixiang.logging.domain.Log;
import co.yixiang.logging.service.LogService; import co.yixiang.logging.service.LogService;
import co.yixiang.utils.RequestHolder; import co.yixiang.utils.RequestHolder;
import co.yixiang.utils.SecurityUtils;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import co.yixiang.utils.ThrowableUtil; import co.yixiang.utils.ThrowableUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@ -36,7 +36,7 @@ import co.yixiang.modules.services.CreatShareProductService;
import co.yixiang.modules.shop.service.YxSystemConfigService; import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.user.domain.YxUser; import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService; import co.yixiang.modules.user.service.YxUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -203,8 +203,8 @@ public class StoreBargainController {
return ApiResult.ok(map); return ApiResult.ok(map);
} }
YxStoreBargainUserHelp storeBargainUserHelp = storeBargainUserHelpService YxStoreBargainUserHelp storeBargainUserHelp = storeBargainUserHelpService
.getOne(new QueryWrapper<YxStoreBargainUserHelp>() .getOne(new LambdaQueryWrapper<YxStoreBargainUserHelp>()
.lambda().eq(YxStoreBargainUserHelp::getBargainId,bargainId) .eq(YxStoreBargainUserHelp::getBargainId,bargainId)
.eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId()) .eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId())
.eq(YxStoreBargainUserHelp::getUid,uid).last("limit 1")); .eq(YxStoreBargainUserHelp::getUid,uid).last("limit 1"));
if(ObjectUtil.isNull(storeBargainUserHelp)){ if(ObjectUtil.isNull(storeBargainUserHelp)){

View File

@ -34,5 +34,6 @@ public class BaseDomain implements Serializable {
@TableLogic @TableLogic
@JsonIgnore @JsonIgnore
@TableField(fill= FieldFill.INSERT)
private Integer isDel; private Integer isDel;
} }

View File

@ -10,7 +10,7 @@ import co.yixiang.gen.domain.GenConfig;
import co.yixiang.gen.service.GenConfigService; import co.yixiang.gen.service.GenConfigService;
import co.yixiang.gen.service.mapper.GenConfigMapper; import co.yixiang.gen.service.mapper.GenConfigMapper;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.File; import java.io.File;
@ -26,7 +26,7 @@ public class GenConfigServiceImpl extends BaseServiceImpl<GenConfigMapper, GenCo
@Override @Override
// @Cacheable(key = "#p0") // @Cacheable(key = "#p0")
public GenConfig find(String tableName) { public GenConfig find(String tableName) {
GenConfig genConfig = this.getOne(new QueryWrapper<GenConfig>().eq("table_name",tableName)); GenConfig genConfig = this.getOne(new LambdaQueryWrapper<GenConfig>().eq(GenConfig::getTableName,tableName));
if(genConfig == null){ if(genConfig == null){
return new GenConfig(tableName); return new GenConfig(tableName);
} }

View File

@ -19,7 +19,7 @@ import co.yixiang.gen.utils.GenUtil;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.PageUtil; import co.yixiang.utils.PageUtil;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -61,8 +61,8 @@ public class GeneratorServiceImpl extends BaseServiceImpl<ColumnInfoMapper, Colu
@Override @Override
public List<ColumnConfig> getColumns(String tableName) { public List<ColumnConfig> getColumns(String tableName) {
List<ColumnConfig> columnInfos = this.list(new QueryWrapper<ColumnConfig>() List<ColumnConfig> columnInfos = this.list(new LambdaQueryWrapper<ColumnConfig>()
.eq("table_name",tableName).orderByAsc("id")); .eq(ColumnConfig::getTableName,tableName).orderByAsc(ColumnConfig::getId));
if(CollectionUtil.isNotEmpty(columnInfos)){ if(CollectionUtil.isNotEmpty(columnInfos)){
return columnInfos; return columnInfos;
} else { } else {

View File

@ -34,7 +34,7 @@ import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.vo.YxUserQueryVo; import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -304,9 +304,9 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
@Override @Override
public List<YxStoreBargainQueryVo> getList(int page, int limit) { public List<YxStoreBargainQueryVo> getList(int page, int limit) {
Page<YxStoreBargain> pageModel = new Page<>(page, limit); Page<YxStoreBargain> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreBargain> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>();
Date nowTime = new Date(); Date nowTime = new Date();
wrapper.lambda().eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) wrapper.eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.lt(YxStoreBargain::getStartTime,nowTime) .lt(YxStoreBargain::getStartTime,nowTime)
.gt(YxStoreBargain::getStopTime,nowTime); .gt(YxStoreBargain::getStopTime,nowTime);

View File

@ -19,7 +19,7 @@ import co.yixiang.modules.activity.service.mapper.YxStoreBargainUserHelpMapper;
import co.yixiang.modules.activity.vo.YxStoreBargainUserHelpQueryVo; import co.yixiang.modules.activity.vo.YxStoreBargainUserHelpQueryVo;
import co.yixiang.modules.user.domain.YxUser; import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService; import co.yixiang.modules.user.service.YxUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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 lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -74,8 +74,8 @@ public class YxStoreBargainUserHelpServiceImpl extends BaseServiceImpl<YxStoreBa
return Collections.emptyList(); return Collections.emptyList();
} }
Page<YxStoreBargainUserHelp> pageModel = new Page<>(page, limit); Page<YxStoreBargainUserHelp> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreBargainUserHelp> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreBargainUserHelp> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId()) wrapper.eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId())
.orderByDesc(YxStoreBargainUserHelp::getId); .orderByDesc(YxStoreBargainUserHelp::getId);
List<YxStoreBargainUserHelpQueryVo> storeBargainUserHelpQueryVos = generator List<YxStoreBargainUserHelpQueryVo> storeBargainUserHelpQueryVos = generator
.convert(yxStoreBargainUserHelpMapper.selectPage(pageModel,wrapper).getRecords(), .convert(yxStoreBargainUserHelpMapper.selectPage(pageModel,wrapper).getRecords(),

View File

@ -22,7 +22,7 @@ import co.yixiang.modules.activity.service.YxStoreBargainUserHelpService;
import co.yixiang.modules.activity.service.YxStoreBargainUserService; import co.yixiang.modules.activity.service.YxStoreBargainUserService;
import co.yixiang.modules.activity.service.mapper.YxStoreBargainUserMapper; import co.yixiang.modules.activity.service.mapper.YxStoreBargainUserMapper;
import co.yixiang.modules.activity.vo.YxStoreBargainUserQueryVo; import co.yixiang.modules.activity.vo.YxStoreBargainUserQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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 lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -188,8 +188,8 @@ public class YxStoreBargainUserServiceImpl extends BaseServiceImpl<YxStoreBargai
*/ */
@Override @Override
public YxStoreBargainUser getBargainUserInfo(Long bargainId, Long uid) { public YxStoreBargainUser getBargainUserInfo(Long bargainId, Long uid) {
QueryWrapper<YxStoreBargainUser> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreBargainUser> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreBargainUser::getBargainId,bargainId) wrapper.eq(YxStoreBargainUser::getBargainId,bargainId)
.eq(YxStoreBargainUser::getUid,uid) .eq(YxStoreBargainUser::getUid,uid)
.last("limit 1"); .last("limit 1");
return yxStoreBargainUserMapper.selectOne(wrapper); return yxStoreBargainUserMapper.selectOne(wrapper);
@ -217,7 +217,7 @@ public class YxStoreBargainUserServiceImpl extends BaseServiceImpl<YxStoreBargai
// */ // */
// @Override // @Override
// public List<YxStoreBargainUserQueryVo> getBargainUserList(int bargainId, int status) { // public List<YxStoreBargainUserQueryVo> getBargainUserList(int bargainId, int status) {
// QueryWrapper<YxStoreBargainUser> wrapper = new QueryWrapper<>(); // LambdaQueryWrapper<YxStoreBargainUser> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq("bargain_id",bargainId).eq("status",status); // wrapper.eq("bargain_id",bargainId).eq("status",status);
// return generator.convert(yxStoreBargainUserMapper.selectList(wrapper), // return generator.convert(yxStoreBargainUserMapper.selectList(wrapper),
// YxStoreBargainUserQueryVo.class); // YxStoreBargainUserQueryVo.class);

View File

@ -50,7 +50,7 @@ import co.yixiang.modules.template.domain.YxShippingTemplates;
import co.yixiang.modules.template.service.YxShippingTemplatesService; import co.yixiang.modules.template.service.YxShippingTemplatesService;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.RedisUtil; import co.yixiang.utils.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -178,8 +178,8 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
CombinationQueryVo combinationQueryVo = new CombinationQueryVo(); CombinationQueryVo combinationQueryVo = new CombinationQueryVo();
Date nowTime = new Date(); Date nowTime = new Date();
Page<YxStoreCombination> pageModel = new Page<>(page, limit); Page<YxStoreCombination> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreCombination> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreCombination> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda() wrapper
.eq(YxStoreCombination::getIsShow,1) .eq(YxStoreCombination::getIsShow,1)
.le(YxStoreCombination::getStartTime,nowTime) .le(YxStoreCombination::getStartTime,nowTime)
.ge(YxStoreCombination::getStopTime,nowTime) .ge(YxStoreCombination::getStopTime,nowTime)
@ -208,15 +208,15 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
List<YxStoreCombinationDto> combinationDTOS = generator.convert(page.getList(),YxStoreCombinationDto.class); List<YxStoreCombinationDto> combinationDTOS = generator.convert(page.getList(),YxStoreCombinationDto.class);
for (YxStoreCombinationDto combinationDTO : combinationDTOS) { for (YxStoreCombinationDto combinationDTO : combinationDTOS) {
//参与人数 //参与人数
combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new QueryWrapper<YxStorePink>().lambda() combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getCid,combinationDTO.getId()))); .eq(YxStorePink::getCid,combinationDTO.getId())));
//成团人数 //成团人数
combinationDTO.setCountPeoplePink(yxStorePinkMapper.selectCount(new QueryWrapper<YxStorePink>().lambda() combinationDTO.setCountPeoplePink(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getCid,combinationDTO.getId()) .eq(YxStorePink::getCid,combinationDTO.getId())
.eq(YxStorePink::getKId,0)));//团长 .eq(YxStorePink::getKId,0)));//团长
//获取查看拼团产品人数 //获取查看拼团产品人数
combinationDTO.setCountPeopleBrowse(yxStoreVisitMapper.selectCount(new QueryWrapper<YxStoreVisit>().lambda() combinationDTO.setCountPeopleBrowse(yxStoreVisitMapper.selectCount(new LambdaQueryWrapper<YxStoreVisit>()
.eq(YxStoreVisit::getProductId,combinationDTO.getId()) .eq(YxStoreVisit::getProductId,combinationDTO.getId())
.eq(YxStoreVisit::getProductType,"combination"))); .eq(YxStoreVisit::getProductType,"combination")));
} }

View File

@ -31,7 +31,7 @@ import co.yixiang.modules.cart.vo.YxStoreCartQueryVo;
import co.yixiang.modules.user.domain.YxUser; import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService; import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -264,8 +264,8 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
*/ */
private void checkInvalidCoupon() { private void checkInvalidCoupon() {
Date nowTime = new Date(); Date nowTime = new Date();
QueryWrapper<YxStoreCouponUser> wrapper= new QueryWrapper<>(); LambdaQueryWrapper<YxStoreCouponUser> wrapper= new LambdaQueryWrapper<>();
wrapper.lambda().lt(YxStoreCouponUser::getEndTime,nowTime) wrapper.lt(YxStoreCouponUser::getEndTime,nowTime)
.eq(YxStoreCouponUser::getStatus,CouponEnum.STATUS_0.getValue()); .eq(YxStoreCouponUser::getStatus,CouponEnum.STATUS_0.getValue());
YxStoreCouponUser couponUser = new YxStoreCouponUser(); YxStoreCouponUser couponUser = new YxStoreCouponUser();
couponUser.setStatus(CouponEnum.STATUS_2.getValue()); couponUser.setStatus(CouponEnum.STATUS_2.getValue());
@ -284,7 +284,7 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
PageInfo<YxStoreCouponUser> page = new PageInfo<>(queryAll(criteria)); PageInfo<YxStoreCouponUser> page = new PageInfo<>(queryAll(criteria));
List<YxStoreCouponUserDto> storeOrderDTOS = generator.convert(page.getList(),YxStoreCouponUserDto.class); List<YxStoreCouponUserDto> storeOrderDTOS = generator.convert(page.getList(),YxStoreCouponUserDto.class);
for (YxStoreCouponUserDto couponUserDTO : storeOrderDTOS) { for (YxStoreCouponUserDto couponUserDTO : storeOrderDTOS) {
couponUserDTO.setNickname(userService.getOne(new QueryWrapper<YxUser>().lambda() couponUserDTO.setNickname(userService.getOne(new LambdaQueryWrapper<YxUser>()
.eq(YxUser::getUid,couponUserDTO.getUid())).getNickname()); .eq(YxUser::getUid,couponUserDTO.getUid())).getNickname());
} }
Map<String,Object> map = new LinkedHashMap<>(2); Map<String,Object> map = new LinkedHashMap<>(2);

View File

@ -43,7 +43,6 @@ import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.modules.user.vo.YxUserQueryVo; import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -135,7 +134,7 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
//把团长下个人设置为团长 //把团长下个人设置为团长
if(ObjectUtil.isNotNull(nextPinkT)){ if(ObjectUtil.isNotNull(nextPinkT)){
QueryWrapper<YxStorePink> wrapperO = new QueryWrapper<>(); LambdaQueryWrapper<YxStorePink> wrapperO = new LambdaQueryWrapper<>();
YxStorePink storePinkO = new YxStorePink(); YxStorePink storePinkO = new YxStorePink();
storePinkO.setKId(0L); //设置团长 storePinkO.setKId(0L); //设置团长
storePinkO.setStatus(OrderInfoEnum.PINK_STATUS_1.getValue()); storePinkO.setStatus(OrderInfoEnum.PINK_STATUS_1.getValue());
@ -144,7 +143,7 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
yxStorePinkMapper.updateById(storePinkO); yxStorePinkMapper.updateById(storePinkO);
//原有团长的数据变更成新团长下面 //原有团长的数据变更成新团长下面
wrapperO.lambda().eq(YxStorePink::getKId,pinkT.getId()); wrapperO.eq(YxStorePink::getKId,pinkT.getId());
YxStorePink storePinkT = new YxStorePink(); YxStorePink storePinkT = new YxStorePink();
storePinkT.setKId(nextPinkT.getId()); storePinkT.setKId(nextPinkT.getId());
yxStorePinkMapper.update(storePinkT,wrapperO); yxStorePinkMapper.update(storePinkT,wrapperO);
@ -519,8 +518,8 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
int pinkBool = PinkEnum.PINK_BOOL_0.getValue(); int pinkBool = PinkEnum.PINK_BOOL_0.getValue();
if(pinkStatus){ if(pinkStatus){
//更改状态 //更改状态
QueryWrapper<YxStorePink> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStorePink> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().in(YxStorePink::getId,idAll); wrapper.in(YxStorePink::getId,idAll);
YxStorePink storePink = new YxStorePink(); YxStorePink storePink = new YxStorePink();
storePink.setStopTime(new Date()); storePink.setStopTime(new Date());
@ -546,14 +545,14 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
*/ */
private void orderPinkFailAfter(Long uid, Long pid) { private void orderPinkFailAfter(Long uid, Long pid) {
YxStorePink yxStorePink = new YxStorePink(); YxStorePink yxStorePink = new YxStorePink();
QueryWrapper<YxStorePink> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStorePink> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStorePink::getId,pid); wrapper.eq(YxStorePink::getId,pid);
yxStorePink.setStatus(OrderInfoEnum.PINK_STATUS_3.getValue()); yxStorePink.setStatus(OrderInfoEnum.PINK_STATUS_3.getValue());
yxStorePink.setStopTime(new Date()); yxStorePink.setStopTime(new Date());
yxStorePinkMapper.update(yxStorePink,wrapper); yxStorePinkMapper.update(yxStorePink,wrapper);
QueryWrapper<YxStorePink> wrapperT = new QueryWrapper<>(); LambdaQueryWrapper<YxStorePink> wrapperT = new LambdaQueryWrapper<>();
wrapperT.lambda().eq(YxStorePink::getKId,pid); wrapperT.eq(YxStorePink::getKId,pid);
yxStorePinkMapper.update(yxStorePink,wrapperT); yxStorePinkMapper.update(yxStorePink,wrapperT);
//todo 模板消息 //todo 模板消息
} }
@ -625,8 +624,8 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
* @return int * @return int
*/ */
private int getPinkPeople(Long kid, int people) { private int getPinkPeople(Long kid, int people) {
QueryWrapper<YxStorePink> wrapper= new QueryWrapper<>(); LambdaQueryWrapper<YxStorePink> wrapper= new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStorePink::getKId,kid) wrapper.eq(YxStorePink::getKId,kid)
.eq(YxStorePink::getIsRefund, OrderInfoEnum.PINK_REFUND_STATUS_0.getValue()); .eq(YxStorePink::getIsRefund, OrderInfoEnum.PINK_REFUND_STATUS_0.getValue());
//加上团长自己 //加上团长自己
int count = yxStorePinkMapper.selectCount(wrapper) + 1; int count = yxStorePinkMapper.selectCount(wrapper) + 1;

View File

@ -41,7 +41,7 @@ import co.yixiang.modules.template.service.YxShippingTemplatesService;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.RedisUtil; import co.yixiang.utils.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -82,7 +82,7 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
// @Override // @Override
// public YxStoreSeckill getSeckill(int id) { // public YxStoreSeckill getSeckill(int id) {
// QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>(); // LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
// int nowTime = OrderUtil.getSecondTimestampTwo(); // int nowTime = OrderUtil.getSecondTimestampTwo();
// wrapper.eq("id",id).eq("is_del",0).eq("status",1) // wrapper.eq("id",id).eq("is_del",0).eq("status",1)
// .le("start_time",nowTime).ge("stop_time",nowTime); // .le("start_time",nowTime).ge("stop_time",nowTime);
@ -145,8 +145,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
public List<YxStoreSeckillQueryVo> getList(int page, int limit, int time) { public List<YxStoreSeckillQueryVo> getList(int page, int limit, int time) {
Date nowTime = new Date(); Date nowTime = new Date();
Page<YxStoreSeckill> pageModel = new Page<>(page, limit); Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxStoreSeckill::getTimeId,time) .eq(YxStoreSeckill::getTimeId,time)
.le(YxStoreSeckill::getStartTime,nowTime) .le(YxStoreSeckill::getStartTime,nowTime)
.ge(YxStoreSeckill::getStopTime,nowTime) .ge(YxStoreSeckill::getStopTime,nowTime)
@ -171,8 +171,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
public List<YxStoreSeckillQueryVo> getList(int page, int limit) { public List<YxStoreSeckillQueryVo> getList(int page, int limit) {
Date nowTime = new Date(); Date nowTime = new Date();
Page<YxStoreSeckill> pageModel = new Page<>(page, limit); Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxStoreSeckill::getIsHot,1) .eq(YxStoreSeckill::getIsHot,1)
.le(YxStoreSeckill::getStartTime,nowTime) .le(YxStoreSeckill::getStartTime,nowTime)
.ge(YxStoreSeckill::getStopTime,nowTime) .ge(YxStoreSeckill::getStopTime,nowTime)

View File

@ -229,7 +229,7 @@ public class YxUserExtractServiceImpl extends BaseServiceImpl<YxUserExtractMappe
/** /**
boolean isTest = true; boolean isTest = true;
if(!isTest){ if(!isTest){
YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new QueryWrapper<YxWechatUser>().eq("uid",resources.getUid())),YxWechatUserDto.class); YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new LambdaQueryWrapper<YxWechatUser>().eq("uid",resources.getUid())),YxWechatUserDto.class);
if(ObjectUtil.isNotNull(wechatUser)){ if(ObjectUtil.isNotNull(wechatUser)){
try { try {
payService.entPay(wechatUser.getOpenid(),resources.getId().toString(), payService.entPay(wechatUser.getOpenid(),resources.getId().toString(),

View File

@ -42,7 +42,7 @@ import co.yixiang.modules.product.service.YxStoreProductService;
import co.yixiang.modules.product.vo.YxStoreProductQueryVo; import co.yixiang.modules.product.vo.YxStoreProductQueryVo;
import co.yixiang.modules.user.service.YxUserService; import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -163,15 +163,15 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
*/ */
@Override @Override
public Map<String, Object> getUserProductCartList(Long uid, String cartIds, Integer status) { public Map<String, Object> getUserProductCartList(Long uid, String cartIds, Integer status) {
QueryWrapper<YxStoreCart> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreCart> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreCart::getUid, uid) wrapper.eq(YxStoreCart::getUid, uid)
.eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue()) .eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue())
.orderByDesc(YxStoreCart::getId); .orderByDesc(YxStoreCart::getId);
if (status == null) { if (status == null) {
wrapper.lambda().eq(YxStoreCart::getIsNew, CartTypeEnum.NEW_0.getValue()); wrapper.eq(YxStoreCart::getIsNew, CartTypeEnum.NEW_0.getValue());
} }
if (StrUtil.isNotEmpty(cartIds)) { if (StrUtil.isNotEmpty(cartIds)) {
wrapper.lambda().in(YxStoreCart::getId, Arrays.asList(cartIds.split(","))); wrapper.in(YxStoreCart::getId, Arrays.asList(cartIds.split(",")));
} }
List<YxStoreCart> carts = yxStoreCartMapper.selectList(wrapper); List<YxStoreCart> carts = yxStoreCartMapper.selectList(wrapper);
@ -284,8 +284,8 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
Integer isNew, Long combinationId, Long seckillId, Long bargainId) { Integer isNew, Long combinationId, Long seckillId, Long bargainId) {
this.checkProductStock(uid, productId, cartNum, productAttrUnique, combinationId, seckillId, bargainId); this.checkProductStock(uid, productId, cartNum, productAttrUnique, combinationId, seckillId, bargainId);
QueryWrapper<YxStoreCart> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreCart> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreCart::getUid, uid) wrapper.eq(YxStoreCart::getUid, uid)
.eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue()) .eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreCart::getProductId, productId) .eq(YxStoreCart::getProductId, productId)
.eq(YxStoreCart::getIsNew, isNew) .eq(YxStoreCart::getIsNew, isNew)

View File

@ -20,7 +20,7 @@ import co.yixiang.modules.category.service.mapper.StoreCategoryMapper;
import co.yixiang.utils.CateDTO; import co.yixiang.utils.CateDTO;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.TreeUtil; import co.yixiang.utils.TreeUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
@ -59,8 +59,8 @@ public class YxStoreCategoryServiceImpl extends BaseServiceImpl<StoreCategoryMap
*/ */
@Override @Override
public List<CateDTO> getList() { public List<CateDTO> getList() {
QueryWrapper<YxStoreCategory> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue()) wrapper.eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByAsc(YxStoreCategory::getSort); .orderByAsc(YxStoreCategory::getSort);
List<CateDTO> list = generator.convert(baseMapper.selectList(wrapper),CateDTO.class); List<CateDTO> list = generator.convert(baseMapper.selectList(wrapper),CateDTO.class);
return TreeUtil.list2TreeConverter(list,0); return TreeUtil.list2TreeConverter(list,0);

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.order.service.dto.YxStoreOrderCartInfoQueryCriteria;
import co.yixiang.modules.order.service.mapper.StoreOrderCartInfoMapper; import co.yixiang.modules.order.service.mapper.StoreOrderCartInfoMapper;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -47,8 +47,8 @@ public class YxStoreOrderCartInfoServiceImpl extends BaseServiceImpl<StoreOrderC
@Override @Override
public YxStoreOrderCartInfo findByUni(String unique) { public YxStoreOrderCartInfo findByUni(String unique) {
QueryWrapper<YxStoreOrderCartInfo> wrapper= new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper= new LambdaQueryWrapper<>();
wrapper.eq("`unique`",unique); wrapper.eq(YxStoreOrderCartInfo::getUnique,unique);
return this.baseMapper.selectOne(wrapper); return this.baseMapper.selectOne(wrapper);
} }

View File

@ -97,7 +97,6 @@ import co.yixiang.utils.RedisUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -1035,49 +1034,49 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/ */
@Override @Override
public List<YxStoreOrderQueryVo> orderList(Long uid, int type, int page, int limit) { public List<YxStoreOrderQueryVo> orderList(Long uid, int type, int page, int limit) {
QueryWrapper<YxStoreOrder> wrapper= new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapper= new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapper.lambda().eq(YxStoreOrder::getUid,uid); wrapper.eq(YxStoreOrder::getUid,uid);
} }
wrapper.lambda().orderByDesc(YxStoreOrder::getId); wrapper.orderByDesc(YxStoreOrder::getId);
switch (OrderStatusEnum.toType(type)){ switch (OrderStatusEnum.toType(type)){
case STATUS_0://未支付 case STATUS_0://未支付
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
break; break;
case STATUS_1://待发货 case STATUS_1://待发货
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
break; break;
case STATUS_2://待收货 case STATUS_2://待收货
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue());
break; break;
case STATUS_3://待评价 case STATUS_3://待评价
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue());
break; break;
case STATUS_4://已完成 case STATUS_4://已完成
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue());
break; break;
case STATUS_MINUS_1://退款中 case STATUS_MINUS_1://退款中
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_1.getValue()); .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_1.getValue());
break; break;
case STATUS_MINUS_2://已退款 case STATUS_MINUS_2://已退款
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_2.getValue()); .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_2.getValue());
break; break;
case STATUS_MINUS_3://退款 case STATUS_MINUS_3://退款
String[] strs = {"1","2"}; String[] strs = {"1","2"};
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.in(YxStoreOrder::getRefundStatus, Arrays.asList(strs)); .in(YxStoreOrder::getRefundStatus, Arrays.asList(strs));
break; break;
} }
@ -1110,7 +1109,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
.beginOfMonth(new Date())); .beginOfMonth(new Date()));
double price = 0d; double price = 0d;
List<ChartDataDto> list = null; List<ChartDataDto> list = null;
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("paid",1).eq("refund_status",0).eq("is_del",0); wrapper.eq("paid",1).eq("refund_status",0).eq("is_del",0);
switch (OrderCountEnum.toType(cate)){ switch (OrderCountEnum.toType(cate)){
@ -1157,8 +1156,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
ShoperOrderTimeDataVo orderTimeDataVo = new ShoperOrderTimeDataVo(); ShoperOrderTimeDataVo orderTimeDataVo = new ShoperOrderTimeDataVo();
//今日成交额 //今日成交额
QueryWrapper<YxStoreOrder> wrapperOne = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperOne = new LambdaQueryWrapper<>();
wrapperOne.lambda() wrapperOne
.ge(YxStoreOrder::getPayTime,today) .ge(YxStoreOrder::getPayTime,today)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) .eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()); .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
@ -1167,8 +1166,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setTodayCount(yxStoreOrderMapper.selectCount(wrapperOne)); orderTimeDataVo.setTodayCount(yxStoreOrderMapper.selectCount(wrapperOne));
//昨日成交额 //昨日成交额
QueryWrapper<YxStoreOrder> wrapperTwo = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperTwo = new LambdaQueryWrapper<>();
wrapperTwo.lambda() wrapperTwo
.lt(YxStoreOrder::getPayTime,today) .lt(YxStoreOrder::getPayTime,today)
.ge(YxStoreOrder::getPayTime,yesterday) .ge(YxStoreOrder::getPayTime,yesterday)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) .eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
@ -1178,8 +1177,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setProCount(yxStoreOrderMapper.selectCount(wrapperTwo)); orderTimeDataVo.setProCount(yxStoreOrderMapper.selectCount(wrapperTwo));
//本月成交额 //本月成交额
QueryWrapper<YxStoreOrder> wrapperThree = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperThree = new LambdaQueryWrapper<>();
wrapperThree.lambda() wrapperThree
.ge(YxStoreOrder::getPayTime,nowMonth) .ge(YxStoreOrder::getPayTime,nowMonth)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) .eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()); .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
@ -1188,8 +1187,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setMonthCount(yxStoreOrderMapper.selectCount(wrapperThree)); orderTimeDataVo.setMonthCount(yxStoreOrderMapper.selectCount(wrapperThree));
//上周成交额 //上周成交额
QueryWrapper<YxStoreOrder> wrapperLastWeek = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperLastWeek = new LambdaQueryWrapper<>();
wrapperLastWeek.lambda() wrapperLastWeek
.lt(YxStoreOrder::getPayTime,today) .lt(YxStoreOrder::getPayTime,today)
.ge(YxStoreOrder::getPayTime,lastWeek) .ge(YxStoreOrder::getPayTime,lastWeek)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) .eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
@ -1223,11 +1222,11 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
public UserOrderCountVo orderData(Long uid) { public UserOrderCountVo orderData(Long uid) {
//订单支付没有退款 数量 //订单支付没有退款 数量
QueryWrapper<YxStoreOrder> wrapperOne = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperOne = new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapperOne.lambda().eq(YxStoreOrder::getUid,uid); wrapperOne.eq(YxStoreOrder::getUid,uid);
} }
wrapperOne.lambda().eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) wrapperOne.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue()); .eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue());
Integer orderCount = yxStoreOrderMapper.selectCount(wrapperOne); Integer orderCount = yxStoreOrderMapper.selectCount(wrapperOne);
@ -1235,62 +1234,62 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
double sumPrice = yxStoreOrderMapper.sumPrice(uid); double sumPrice = yxStoreOrderMapper.sumPrice(uid);
//订单待支付 数量 //订单待支付 数量
QueryWrapper<YxStoreOrder> wrapperTwo = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperTwo = new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapperTwo.lambda().eq(YxStoreOrder::getUid,uid); wrapperTwo.eq(YxStoreOrder::getUid,uid);
} }
wrapperTwo.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue()) wrapperTwo.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
Integer unpaidCount = yxStoreOrderMapper.selectCount(wrapperTwo); Integer unpaidCount = yxStoreOrderMapper.selectCount(wrapperTwo);
//订单待发货 数量 //订单待发货 数量
QueryWrapper<YxStoreOrder> wrapperThree = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperThree = new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapperThree.lambda().eq(YxStoreOrder::getUid,uid); wrapperThree.eq(YxStoreOrder::getUid,uid);
} }
wrapperThree.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue()) wrapperThree.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
Integer unshippedCount = yxStoreOrderMapper.selectCount(wrapperThree); Integer unshippedCount = yxStoreOrderMapper.selectCount(wrapperThree);
//订单待收货 数量 //订单待收货 数量
QueryWrapper<YxStoreOrder> wrapperFour = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperFour = new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapperFour.lambda().eq(YxStoreOrder::getUid,uid); wrapperFour.eq(YxStoreOrder::getUid,uid);
} }
wrapperFour.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue()) wrapperFour.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue());
Integer receivedCount = yxStoreOrderMapper.selectCount(wrapperFour); Integer receivedCount = yxStoreOrderMapper.selectCount(wrapperFour);
//订单待评价 数量 //订单待评价 数量
QueryWrapper<YxStoreOrder> wrapperFive = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperFive = new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapperFive.lambda().eq(YxStoreOrder::getUid,uid); wrapperFive.eq(YxStoreOrder::getUid,uid);
} }
wrapperFive.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue()) wrapperFive.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue());
Integer evaluatedCount = yxStoreOrderMapper.selectCount(wrapperFive); Integer evaluatedCount = yxStoreOrderMapper.selectCount(wrapperFive);
//订单已完成 数量 //订单已完成 数量
QueryWrapper<YxStoreOrder> wrapperSix= new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperSix= new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapperSix.lambda().eq(YxStoreOrder::getUid,uid); wrapperSix.eq(YxStoreOrder::getUid,uid);
} }
wrapperSix.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue()) wrapperSix.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue()) .eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue()); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue());
Integer completeCount = yxStoreOrderMapper.selectCount(wrapperSix); Integer completeCount = yxStoreOrderMapper.selectCount(wrapperSix);
//订单退款 //订单退款
QueryWrapper<YxStoreOrder> wrapperSeven= new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapperSeven= new LambdaQueryWrapper<>();
if(uid != null) { if(uid != null) {
wrapperSeven.lambda().eq(YxStoreOrder::getUid,uid); wrapperSeven.eq(YxStoreOrder::getUid,uid);
} }
String[] strArr = {"1","2"}; String[] strArr = {"1","2"};
wrapperSeven.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue()) wrapperSeven.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.in(YxStoreOrder::getRefundStatus,Arrays.asList(strArr)); .in(YxStoreOrder::getRefundStatus,Arrays.asList(strArr));
Integer refundCount = yxStoreOrderMapper.selectCount(wrapperSeven); Integer refundCount = yxStoreOrderMapper.selectCount(wrapperSeven);
@ -1314,8 +1313,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/ */
@Override @Override
public YxStoreOrderQueryVo handleOrder(YxStoreOrderQueryVo order) { public YxStoreOrderQueryVo handleOrder(YxStoreOrderQueryVo order) {
QueryWrapper<YxStoreOrderCartInfo> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreOrderCartInfo::getOid,order.getId()); wrapper.eq(YxStoreOrderCartInfo::getOid,order.getId());
List<YxStoreOrderCartInfo> cartInfos = orderCartInfoService.list(wrapper); List<YxStoreOrderCartInfo> cartInfos = orderCartInfoService.list(wrapper);
List<YxStoreCartQueryVo> cartInfo = cartInfos.stream() List<YxStoreCartQueryVo> cartInfo = cartInfos.stream()
@ -1414,8 +1413,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,null); YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,null);
//更新订单状态 //更新订单状态
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreOrder::getOrderId,orderId); wrapper.eq(YxStoreOrder::getOrderId,orderId);
YxStoreOrder storeOrder = new YxStoreOrder(); YxStoreOrder storeOrder = new YxStoreOrder();
storeOrder.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue()); storeOrder.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue());
storeOrder.setPayType(payType); storeOrder.setPayType(payType);
@ -1535,12 +1534,12 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/ */
@Override @Override
public YxStoreOrderQueryVo getOrderInfo(String unique,Long uid) { public YxStoreOrderQueryVo getOrderInfo(String unique,Long uid) {
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().and( wrapper.and(
i->i.eq(YxStoreOrder::getOrderId,unique).or().eq(YxStoreOrder::getUnique,unique).or() i->i.eq(YxStoreOrder::getOrderId,unique).or().eq(YxStoreOrder::getUnique,unique).or()
.eq(YxStoreOrder::getExtendOrderId,unique)); .eq(YxStoreOrder::getExtendOrderId,unique));
if(uid != null) { if(uid != null) {
wrapper.lambda().eq(YxStoreOrder::getUid,uid); wrapper.eq(YxStoreOrder::getUid,uid);
} }
return generator.convert(yxStoreOrderMapper.selectOne(wrapper),YxStoreOrderQueryVo.class); return generator.convert(yxStoreOrderMapper.selectOne(wrapper),YxStoreOrderQueryVo.class);
@ -1667,8 +1666,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|| OrderStatusEnum.STATUS_MINUS_2.getValue().equals(order.getStatus())){ || OrderStatusEnum.STATUS_MINUS_2.getValue().equals(order.getStatus())){
return; return;
} }
QueryWrapper<YxStoreOrderCartInfo> wrapper= new QueryWrapper<>(); LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper= new LambdaQueryWrapper<>();
wrapper.lambda().in(YxStoreOrderCartInfo::getCartId, Arrays.asList(order.getCartId().split(","))); wrapper.in(YxStoreOrderCartInfo::getCartId, Arrays.asList(order.getCartId().split(",")));
List<YxStoreOrderCartInfo> cartInfoList = orderCartInfoService.list(wrapper); List<YxStoreOrderCartInfo> cartInfoList = orderCartInfoService.list(wrapper);
for (YxStoreOrderCartInfo cartInfo : cartInfoList) { for (YxStoreOrderCartInfo cartInfo : cartInfoList) {
@ -2107,7 +2106,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(YxStoreOrder resources) { public void update(YxStoreOrder resources) {
YxStoreOrder yxStoreOrder = this.getById(resources.getId()); YxStoreOrder yxStoreOrder = this.getById(resources.getId());
YxStoreOrder yxStoreOrder1 = this.getOne(new QueryWrapper<YxStoreOrder>().lambda() YxStoreOrder yxStoreOrder1 = this.getOne(new LambdaQueryWrapper<YxStoreOrder>()
.eq(YxStoreOrder::getUnique,resources.getUnique())); .eq(YxStoreOrder::getUnique,resources.getUnique()));
if(yxStoreOrder1 != null && !yxStoreOrder1.getId().equals(yxStoreOrder.getId())){ if(yxStoreOrder1 != null && !yxStoreOrder1.getId().equals(yxStoreOrder.getId())){
throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique()); throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique());
@ -2228,7 +2227,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
yxStoreOrderDto.setStoreOrderStatusList(orderStatusDtos); yxStoreOrderDto.setStoreOrderStatusList(orderStatusDtos);
//添加购物车详情 //添加购物车详情
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list( List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId())); new LambdaQueryWrapper<YxStoreOrderCartInfo>().eq(YxStoreOrderCartInfo::getOid,yxStoreOrder.getId()));
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>(); List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
for (YxStoreOrderCartInfo cartInfo : cartInfos) { for (YxStoreOrderCartInfo cartInfo : cartInfos) {
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto(); StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
@ -2247,7 +2246,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
@Override @Override
public Map<String, Object> queryAll(List<String> ids) { public Map<String, Object> queryAll(List<String> ids) {
List<YxStoreOrder> yxStoreOrders = this.list(new QueryWrapper<YxStoreOrder>().in("order_id",ids)); List<YxStoreOrder> yxStoreOrders = this.list(new LambdaQueryWrapper<YxStoreOrder>().in(YxStoreOrder::getOrderId,ids));
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>(); List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
for (YxStoreOrder yxStoreOrder :yxStoreOrders) { for (YxStoreOrder yxStoreOrder :yxStoreOrders) {
this.orderList(storeOrderDTOS, yxStoreOrder); this.orderList(storeOrderDTOS, yxStoreOrder);
@ -2303,7 +2302,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
yxStoreOrder.getShippingType())); yxStoreOrder.getShippingType()));
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list( List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId())); new LambdaQueryWrapper<YxStoreOrderCartInfo>().eq(YxStoreOrderCartInfo::getOid,yxStoreOrder.getId()));
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>(); List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
for (YxStoreOrderCartInfo cartInfo : cartInfos) { for (YxStoreOrderCartInfo cartInfo : cartInfos) {
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto(); StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
@ -2336,7 +2335,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
Long bargainId,Integer shippingType) { Long bargainId,Integer shippingType) {
String str = "[普通订单]"; String str = "[普通订单]";
if(pinkId > 0 || combinationId > 0){ if(pinkId > 0 || combinationId > 0){
YxStorePink storePink = storePinkService.getOne(new QueryWrapper<YxStorePink>().lambda() YxStorePink storePink = storePinkService.getOne(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getOrderIdKey,id)); .eq(YxStorePink::getOrderIdKey,id));
if(ObjectUtil.isNull(storePink)) { if(ObjectUtil.isNull(storePink)) {
str = "[拼团订单]"; str = "[拼团订单]";

View File

@ -27,7 +27,7 @@ import co.yixiang.modules.product.vo.YxStoreProductReplyQueryVo;
import co.yixiang.modules.user.service.YxUserService; import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -186,8 +186,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
@Override @Override
public int getInfoCount(Integer oid, String unique) { public int getInfoCount(Integer oid, String unique) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("`unique`",unique).eq("oid",oid); wrapper.eq(YxStoreProductReply::getUnique,unique).eq(YxStoreProductReply::getOid,oid);
return this.baseMapper.selectCount(wrapper); return this.baseMapper.selectCount(wrapper);
} }
@ -201,8 +201,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
@Override @Override
public int replyCount(String unique) { public int replyCount(String unique) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("`unique`",unique); wrapper.eq(YxStoreProductReply::getUnique,unique);
return this.baseMapper.selectCount(wrapper); return this.baseMapper.selectCount(wrapper);
} }
@ -213,8 +213,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
*/ */
@Override @Override
public String replyPer(long productId) { public String replyPer(long productId) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreProductReply::getProductId,productId) wrapper.eq(YxStoreProductReply::getProductId,productId)
.eq(YxStoreProductReply::getIsDel,ShopCommonEnum.DELETE_0.getValue()) .eq(YxStoreProductReply::getIsDel,ShopCommonEnum.DELETE_0.getValue())
.eq(YxStoreProductReply::getProductScore,5); .eq(YxStoreProductReply::getProductScore,5);
int productScoreCount = this.baseMapper.selectCount(wrapper); int productScoreCount = this.baseMapper.selectCount(wrapper);

View File

@ -171,8 +171,8 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override @Override
public YxStoreProduct getProductInfo(int id) { public YxStoreProduct getProductInfo(int id) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("is_del", 0).eq("is_show", 1).eq("id", id); wrapper.eq(YxStoreProduct::getIsShow, 1).eq(YxStoreProduct::getId, id);
YxStoreProduct storeProduct = this.baseMapper.selectOne(wrapper); YxStoreProduct storeProduct = this.baseMapper.selectOne(wrapper);
if (ObjectUtil.isNull(storeProduct)) { if (ObjectUtil.isNull(storeProduct)) {
throw new ErrorRequestException("商品不存在或已下架"); throw new ErrorRequestException("商品不存在或已下架");
@ -230,7 +230,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override @Override
public List<YxStoreProductQueryVo> getGoodsList(YxStoreProductQueryParam productQueryParam) { public List<YxStoreProductQueryVo> getGoodsList(YxStoreProductQueryParam productQueryParam) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>(); QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, CommonEnum.SHOW_STATUS_1.getValue()); wrapper.lambda().eq(YxStoreProduct::getIsShow, CommonEnum.SHOW_STATUS_1.getValue());
//多字段模糊查询分类搜索 //多字段模糊查询分类搜索
@ -296,8 +296,8 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
*/ */
@Override @Override
public ProductVo goodsDetail(Long id, Long uid, String latitude, String longitude) { public ProductVo goodsDetail(Long id, Long uid, String latitude, String longitude) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue()) wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.eq(YxStoreProduct::getId, id); .eq(YxStoreProduct::getId, id);
YxStoreProduct storeProduct = storeProductMapper.selectOne(wrapper); YxStoreProduct storeProduct = storeProductMapper.selectOne(wrapper);
if (ObjectUtil.isNull(storeProduct)) { if (ObjectUtil.isNull(storeProduct)) {
@ -402,26 +402,26 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override @Override
public List<YxStoreProductQueryVo> getList(int page, int limit, int order) { public List<YxStoreProductQueryVo> getList(int page, int limit, int order) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue()) wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByDesc(YxStoreProduct::getSort); .orderByDesc(YxStoreProduct::getSort);
// order // order
switch (ProductEnum.toType(order)) { switch (ProductEnum.toType(order)) {
case TYPE_1: case TYPE_1:
wrapper.lambda().eq(YxStoreProduct::getIsBest, wrapper.eq(YxStoreProduct::getIsBest,
ShopCommonEnum.IS_STATUS_1.getValue()); //精品推荐 ShopCommonEnum.IS_STATUS_1.getValue()); //精品推荐
break; break;
case TYPE_3: case TYPE_3:
wrapper.lambda().eq(YxStoreProduct::getIsNew, wrapper.eq(YxStoreProduct::getIsNew,
ShopCommonEnum.IS_STATUS_1.getValue());//// 首发新品 ShopCommonEnum.IS_STATUS_1.getValue());//// 首发新品
break; break;
case TYPE_4: case TYPE_4:
wrapper.lambda().eq(YxStoreProduct::getIsBenefit, wrapper.eq(YxStoreProduct::getIsBenefit,
ShopCommonEnum.IS_STATUS_1.getValue()); //// 猜你喜欢 ShopCommonEnum.IS_STATUS_1.getValue()); //// 猜你喜欢
break; break;
case TYPE_2: case TYPE_2:
wrapper.lambda().eq(YxStoreProduct::getIsHot, wrapper.eq(YxStoreProduct::getIsHot,
ShopCommonEnum.IS_STATUS_1.getValue());//// 热门榜单 ShopCommonEnum.IS_STATUS_1.getValue());//// 热门榜单
break; break;
} }

View File

@ -13,7 +13,7 @@ import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.modules.shop.domain.YxSystemAttachment; import co.yixiang.modules.shop.domain.YxSystemAttachment;
import co.yixiang.modules.shop.service.YxSystemAttachmentService; import co.yixiang.modules.shop.service.YxSystemAttachmentService;
import co.yixiang.modules.shop.service.mapper.YxSystemAttachmentMapper; import co.yixiang.modules.shop.service.mapper.YxSystemAttachmentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -43,8 +43,8 @@ public class YxSystemAttachmentServiceImpl extends BaseServiceImpl<YxSystemAttac
*/ */
@Override @Override
public YxSystemAttachment getInfo(String name) { public YxSystemAttachment getInfo(String name) {
QueryWrapper<YxSystemAttachment> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxSystemAttachment> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxSystemAttachment::getName,name) wrapper.eq(YxSystemAttachment::getName,name)
.last("limit 1"); .last("limit 1");
return yxSystemAttachmentMapper.selectOne(wrapper); return yxSystemAttachmentMapper.selectOne(wrapper);
} }
@ -56,8 +56,8 @@ public class YxSystemAttachmentServiceImpl extends BaseServiceImpl<YxSystemAttac
*/ */
@Override @Override
public YxSystemAttachment getByCode(String code) { public YxSystemAttachment getByCode(String code) {
QueryWrapper<YxSystemAttachment> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxSystemAttachment> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxSystemAttachment::getInviteCode,code) wrapper.eq(YxSystemAttachment::getInviteCode,code)
.last("limit 1"); .last("limit 1");
return yxSystemAttachmentMapper.selectOne(wrapper); return yxSystemAttachmentMapper.selectOne(wrapper);
} }

View File

@ -19,7 +19,7 @@ import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria;
import co.yixiang.modules.shop.service.mapper.SystemConfigMapper; import co.yixiang.modules.shop.service.mapper.SystemConfigMapper;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.RedisUtils; import co.yixiang.utils.RedisUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -59,8 +59,8 @@ public class YxSystemConfigServiceImpl extends BaseServiceImpl<SystemConfigMappe
return result; return result;
} }
QueryWrapper<YxSystemConfig> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxSystemConfig> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxSystemConfig::getMenuName,name); wrapper.eq(YxSystemConfig::getMenuName,name);
YxSystemConfig systemConfig = this.baseMapper.selectOne(wrapper); YxSystemConfig systemConfig = this.baseMapper.selectOne(wrapper);
if(systemConfig == null) { if(systemConfig == null) {
return ""; return "";
@ -103,7 +103,7 @@ public class YxSystemConfigServiceImpl extends BaseServiceImpl<SystemConfigMappe
@Override @Override
public YxSystemConfig findByKey(String key) { public YxSystemConfig findByKey(String key) {
return this.getOne(new QueryWrapper<YxSystemConfig>().lambda() return this.getOne(new LambdaQueryWrapper<YxSystemConfig>()
.eq(YxSystemConfig::getMenuName,key)); .eq(YxSystemConfig::getMenuName,key));
} }
} }

View File

@ -29,7 +29,7 @@ import co.yixiang.modules.user.service.mapper.UserBillMapper;
import co.yixiang.modules.user.service.mapper.YxUserTaskFinishMapper; import co.yixiang.modules.user.service.mapper.YxUserTaskFinishMapper;
import co.yixiang.modules.user.vo.YxSystemUserTaskQueryVo; import co.yixiang.modules.user.vo.YxSystemUserTaskQueryVo;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -112,8 +112,8 @@ public class YxSystemUserTaskServiceImpl extends BaseServiceImpl<SystemUserTaskM
*/ */
@Override @Override
public TaskDto getTaskList(int levelId, Long uid) { public TaskDto getTaskList(int levelId, Long uid) {
QueryWrapper<YxSystemUserTask> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxSystemUserTask> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxSystemUserTask::getLevelId,levelId) wrapper.eq(YxSystemUserTask::getLevelId,levelId)
.eq(YxSystemUserTask::getIsShow, ShopCommonEnum.SHOW_1.getValue()) .eq(YxSystemUserTask::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByDesc(YxSystemUserTask::getSort); .orderByDesc(YxSystemUserTask::getSort);
List<YxSystemUserTaskQueryVo> list = generator.convert(yxSystemUserTaskMapper List<YxSystemUserTaskQueryVo> list = generator.convert(yxSystemUserTaskMapper

View File

@ -20,7 +20,6 @@ import co.yixiang.modules.user.service.YxUserAddressService;
import co.yixiang.modules.user.service.mapper.YxUserAddressMapper; import co.yixiang.modules.user.service.mapper.YxUserAddressMapper;
import co.yixiang.modules.user.vo.YxUserAddressQueryVo; import co.yixiang.modules.user.vo.YxUserAddressQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -58,7 +57,7 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
YxUserAddress address = new YxUserAddress(); YxUserAddress address = new YxUserAddress();
address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue()); address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
yxUserAddressMapper.update(address, yxUserAddressMapper.update(address,
new QueryWrapper<YxUserAddress>().lambda().eq(YxUserAddress::getUid,uid)); new LambdaQueryWrapper<YxUserAddress>().eq(YxUserAddress::getUid,uid));
YxUserAddress userAddress = new YxUserAddress(); YxUserAddress userAddress = new YxUserAddress();
userAddress.setIsDefault(ShopCommonEnum.DEFAULT_1.getValue()); userAddress.setIsDefault(ShopCommonEnum.DEFAULT_1.getValue());
@ -90,7 +89,7 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
//新增地址如果是默认,把之前的状态改掉 //新增地址如果是默认,把之前的状态改掉
YxUserAddress address = new YxUserAddress(); YxUserAddress address = new YxUserAddress();
address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue()); address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
baseMapper.update(address,new QueryWrapper<YxUserAddress>().lambda().eq(YxUserAddress::getUid,uid)); baseMapper.update(address,new LambdaQueryWrapper<YxUserAddress>().eq(YxUserAddress::getUid,uid));
}else{ }else{
userAddress.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue()); userAddress.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
} }
@ -136,8 +135,8 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
*/ */
@Override @Override
public YxUserAddress getUserDefaultAddress(Long uid) { public YxUserAddress getUserDefaultAddress(Long uid) {
QueryWrapper<YxUserAddress> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserAddress> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxUserAddress::getIsDefault,1). wrapper.eq(YxUserAddress::getIsDefault,1).
eq(YxUserAddress::getUid,uid) eq(YxUserAddress::getUid,uid)
.last("limit 1"); .last("limit 1");
return getOne(wrapper); return getOne(wrapper);

View File

@ -26,7 +26,7 @@ import co.yixiang.modules.user.vo.YxUserBillQueryVo;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -124,9 +124,9 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/ */
@Override @Override
public int cumulativeAttendance(Long uid) { public int cumulativeAttendance(Long uid) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("uid",uid).eq("category","integral") wrapper.eq(YxUserBill::getUid,uid).eq(YxUserBill::getCategory,"integral")
.eq("type","sign").eq("pm",1); .eq(YxUserBill::getType,"sign").eq(YxUserBill::getPm,1);
return yxUserBillMapper.selectCount(wrapper); return yxUserBillMapper.selectCount(wrapper);
} }
@ -139,11 +139,11 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/ */
@Override @Override
public Map<String, Object> spreadOrder(Long uid, int page, int limit) { public Map<String, Object> spreadOrder(Long uid, int page, int limit) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().in(YxUserBill::getUid, uid) wrapper.in(YxUserBill::getUid, uid)
.eq(YxUserBill::getType, BillDetailEnum.TYPE_2.getValue()) .eq(YxUserBill::getType, BillDetailEnum.TYPE_2.getValue())
.eq(YxUserBill::getCategory, BillDetailEnum.CATEGORY_1.getValue()); .eq(YxUserBill::getCategory, BillDetailEnum.CATEGORY_1.getValue());
wrapper.orderByDesc("time").groupBy("time"); wrapper.orderByDesc(YxUserBill::getCreateTime).groupBy(YxUserBill::getCreateTime);
Page<YxUserBill> pageModel = new Page<>(page, limit); Page<YxUserBill> pageModel = new Page<>(page, limit);
List<String> list = yxUserBillMapper.getBillOrderList(wrapper, pageModel); List<String> list = yxUserBillMapper.getBillOrderList(wrapper, pageModel);
@ -180,39 +180,39 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/ */
@Override @Override
public List<BillVo> getUserBillList(int page, int limit, long uid, int type) { public List<BillVo> getUserBillList(int page, int limit, long uid, int type) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxUserBill::getUid,uid).orderByDesc(YxUserBill::getId); wrapper.eq(YxUserBill::getUid,uid).orderByDesc(YxUserBill::getId);
wrapper.groupBy("time"); wrapper.groupBy(YxUserBill::getCreateTime);
switch (BillInfoEnum.toType(type)){ switch (BillInfoEnum.toType(type)){
case PAY_PRODUCT: case PAY_PRODUCT:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue()); wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_3.getValue()); wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_3.getValue());
break; break;
case RECHAREGE: case RECHAREGE:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue()); wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_1.getValue()); wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_1.getValue());
break; break;
case BROKERAGE: case BROKERAGE:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue()); wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_2.getValue()); wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_2.getValue());
break; break;
case EXTRACT: case EXTRACT:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue()); wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_4.getValue()); wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_4.getValue());
break; break;
case SIGN_INTEGRAL: case SIGN_INTEGRAL:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_2.getValue()); wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_2.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_10.getValue()); wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_10.getValue());
break; break;
default: default:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue()); wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
} }
Page<YxUserBill> pageModel = new Page<>(page, limit); Page<YxUserBill> pageModel = new Page<>(page, limit);
List<BillVo> billDTOList = yxUserBillMapper.getBillList(wrapper,pageModel); List<BillVo> billDTOList = yxUserBillMapper.getBillList(wrapper,pageModel);
for (BillVo billDTO : billDTOList) { for (BillVo billDTO : billDTOList) {
QueryWrapper<YxUserBill> wrapperT = new QueryWrapper<>(); LambdaQueryWrapper<YxUserBill> wrapperT = new LambdaQueryWrapper<>();
wrapperT.lambda().in(YxUserBill::getId,Arrays.asList(billDTO.getIds().split(","))); wrapperT.in(YxUserBill::getId,Arrays.asList(billDTO.getIds().split(",")));
billDTO.setList(yxUserBillMapper.getUserBillList(wrapperT)); billDTO.setList(yxUserBillMapper.getUserBillList(wrapperT));
} }
@ -245,8 +245,8 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/ */
@Override @Override
public List<YxUserBillQueryVo> userBillList(Long uid,String category,int page,int limit) { public List<YxUserBillQueryVo> userBillList(Long uid,String category,int page,int limit) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda() wrapper
.eq(YxUserBill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) .eq(YxUserBill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserBill::getUid,uid) .eq(YxUserBill::getUid,uid)
.eq(YxUserBill::getCategory,category) .eq(YxUserBill::getCategory,category)

View File

@ -22,7 +22,7 @@ import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.modules.user.service.mapper.SystemUserTaskMapper; import co.yixiang.modules.user.service.mapper.SystemUserTaskMapper;
import co.yixiang.modules.user.service.mapper.YxUserLevelMapper; import co.yixiang.modules.user.service.mapper.YxUserLevelMapper;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -92,13 +92,13 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
*/ */
@Override @Override
public YxUserLevel getUserLevel(Long uid, Integer grade) { public YxUserLevel getUserLevel(Long uid, Integer grade) {
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda() wrapper
.eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) .eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid) .eq(YxUserLevel::getUid,uid)
.orderByDesc(YxUserLevel::getGrade); .orderByDesc(YxUserLevel::getGrade);
if(grade != null) { if(grade != null) {
wrapper.lambda().lt(YxUserLevel::getGrade,grade); wrapper.lt(YxUserLevel::getGrade,grade);
} }
YxUserLevel userLevel = this.getOne(wrapper,false); YxUserLevel userLevel = this.getOne(wrapper,false);
if(ObjectUtil.isNull(userLevel)) { if(ObjectUtil.isNull(userLevel)) {
@ -133,8 +133,8 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
int validTime = systemUserLevelQueryVo.getValidDate() * 86400; int validTime = systemUserLevelQueryVo.getValidDate() * 86400;
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxUserLevel::getStatus,ShopCommonEnum.IS_STATUS_1.getValue()) wrapper.eq(YxUserLevel::getStatus,ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid) .eq(YxUserLevel::getUid,uid)
.eq(YxUserLevel::getLevelId,levelId) .eq(YxUserLevel::getLevelId,levelId)
.last("limit 1"); .last("limit 1");

View File

@ -46,7 +46,7 @@ import co.yixiang.modules.user.service.mapper.UserMapper;
import co.yixiang.modules.user.vo.YxUserQueryVo; import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -356,8 +356,8 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
*/ */
@Override @Override
public double setLevelPrice(double price, long uid) { public double setLevelPrice(double price, long uid) {
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda().eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) wrapper.eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid) .eq(YxUserLevel::getUid,uid)
.orderByDesc(YxUserLevel::getGrade) .orderByDesc(YxUserLevel::getGrade)
.last("limit 1"); .last("limit 1");

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.activity.domain.YxStorePink;
import co.yixiang.modules.activity.service.YxStorePinkService; import co.yixiang.modules.activity.service.YxStorePinkService;
import co.yixiang.modules.order.domain.YxStoreOrder; import co.yixiang.modules.order.domain.YxStoreOrder;
import co.yixiang.modules.order.service.YxStoreOrderService; import co.yixiang.modules.order.service.YxStoreOrderService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.Message; import org.springframework.data.redis.connection.Message;
@ -61,7 +61,7 @@ public class RedisKeyExpirationListener implements MessageListener {
body = body.replace(ShopConstants.REDIS_ORDER_OUTTIME_UNPAY, ""); body = body.replace(ShopConstants.REDIS_ORDER_OUTTIME_UNPAY, "");
log.info("body:{}",body); log.info("body:{}",body);
String orderId = body; String orderId = body;
YxStoreOrder order = storeOrderService.getOne(new QueryWrapper<YxStoreOrder>().lambda() YxStoreOrder order = storeOrderService.getOne(new LambdaQueryWrapper<YxStoreOrder>()
.eq(YxStoreOrder::getId, orderId) .eq(YxStoreOrder::getId, orderId)
.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())); .eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue()));
//只有待支付的订单能取消 //只有待支付的订单能取消
@ -75,7 +75,7 @@ public class RedisKeyExpirationListener implements MessageListener {
body = body.replace(ShopConstants.REDIS_ORDER_OUTTIME_UNCONFIRM, ""); body = body.replace(ShopConstants.REDIS_ORDER_OUTTIME_UNCONFIRM, "");
log.info("body:{}",body); log.info("body:{}",body);
String orderId = body; String orderId = body;
YxStoreOrder order = storeOrderService.getOne(new QueryWrapper<YxStoreOrder>().lambda() YxStoreOrder order = storeOrderService.getOne(new LambdaQueryWrapper<YxStoreOrder>()
.eq(YxStoreOrder::getId, orderId) .eq(YxStoreOrder::getId, orderId)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue()) .eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue())); .eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue()));

View File

@ -58,8 +58,12 @@ public class MetaHandler implements MetaObjectHandler {
log.debug("自动插入 delFlag"); log.debug("自动插入 delFlag");
this.setFieldValByName("delFlag", false, metaObject); this.setFieldValByName("delFlag", false, metaObject);
} }
if(metaObject.hasSetter("addTime")){ if (metaObject.hasSetter("isDel")) {
String timestamp = String.valueOf(System.currentTimeMillis()/1000); log.debug("自动插入 isDel");
this.setFieldValByName("isDel", 0, metaObject);
}
if (metaObject.hasSetter("addTime")) {
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
this.setFieldValByName("addTime", Integer.valueOf(timestamp), metaObject); this.setFieldValByName("addTime", Integer.valueOf(timestamp), metaObject);
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -15,7 +15,7 @@ import co.yixiang.modules.mp.config.WxMpConfiguration;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import me.chanjar.weixin.common.bean.menu.WxMenu; import me.chanjar.weixin.common.bean.menu.WxMenu;
@ -50,7 +50,7 @@ public class WechatMenuController {
@GetMapping(value = "/YxWechatMenu") @GetMapping(value = "/YxWechatMenu")
@PreAuthorize("hasAnyRole('admin','YxWechatMenu_ALL','YxWechatMenu_SELECT')") @PreAuthorize("hasAnyRole('admin','YxWechatMenu_ALL','YxWechatMenu_SELECT')")
public ResponseEntity getYxWechatMenus(){ public ResponseEntity getYxWechatMenus(){
return new ResponseEntity(YxWechatMenuService.getOne(new QueryWrapper<YxWechatMenu>().lambda() return new ResponseEntity(YxWechatMenuService.getOne(new LambdaQueryWrapper<YxWechatMenu>()
.eq(YxWechatMenu::getKey,ShopConstants.WECHAT_MENUS)),HttpStatus.OK); .eq(YxWechatMenu::getKey,ShopConstants.WECHAT_MENUS)),HttpStatus.OK);
} }

View File

@ -23,7 +23,7 @@ import co.yixiang.utils.TranslatorUtil;
import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.ValidationUtil;
import co.yixiang.utils.YshopConstant; import co.yixiang.utils.YshopConstant;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -115,7 +115,7 @@ public class PictureServiceImpl extends BaseServiceImpl<PictureMapper, Picture>
public Picture upload(MultipartFile multipartFile, String username) { public Picture upload(MultipartFile multipartFile, String username) {
File file = FileUtil.toFile(multipartFile); File file = FileUtil.toFile(multipartFile);
// 验证是否重复上传 // 验证是否重复上传
Picture picture = this.getOne(new QueryWrapper<Picture>().eq("md5code",FileUtil.getMd5(file))); Picture picture = this.getOne(new LambdaQueryWrapper<Picture>().eq(Picture::getMd5code,FileUtil.getMd5(file)));
if(picture != null){ if(picture != null){
return picture; return picture;
} }
@ -174,7 +174,7 @@ public class PictureServiceImpl extends BaseServiceImpl<PictureMapper, Picture>
JSONObject jsonObject = JSONUtil.parseObj(result); JSONObject jsonObject = JSONUtil.parseObj(result);
List<Picture> pictures = JSON.parseArray(jsonObject.get("data").toString(), Picture.class); List<Picture> pictures = JSON.parseArray(jsonObject.get("data").toString(), Picture.class);
for (Picture picture : pictures) { for (Picture picture : pictures) {
if(this.getOne(new QueryWrapper<Picture>().eq("url",picture.getUrl()))==null){ if(this.getOne(new LambdaQueryWrapper<Picture>().eq(Picture::getUrl,picture.getUrl()))==null){
picture.setSize(FileUtil.getSize(Integer.parseInt(picture.getSize()))); picture.setSize(FileUtil.getSize(Integer.parseInt(picture.getSize())));
picture.setUsername("System Sync"); picture.setUsername("System Sync");
picture.setMd5code(null); picture.setMd5code(null);

View File

@ -16,7 +16,7 @@ import co.yixiang.tools.service.dto.QiniuQueryCriteria;
import co.yixiang.tools.utils.QiNiuUtil; import co.yixiang.tools.utils.QiNiuUtil;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qiniu.common.QiniuException; import com.qiniu.common.QiniuException;
import com.qiniu.http.Response; import com.qiniu.http.Response;
import com.qiniu.storage.BucketManager; import com.qiniu.storage.BucketManager;
@ -109,7 +109,7 @@ public class QiNiuServiceImpl implements QiNiuService {
String upToken = auth.uploadToken(qiniuConfig.getBucket()); String upToken = auth.uploadToken(qiniuConfig.getBucket());
try { try {
String key = file.getOriginalFilename(); String key = file.getOriginalFilename();
if(qiniuContentService.getOne(new QueryWrapper<QiniuContent>().eq("name",key)) != null) { if(qiniuContentService.getOne(new LambdaQueryWrapper<QiniuContent>().eq(QiniuContent::getName,key)) != null) {
key = QiNiuUtil.getKey(key); key = QiNiuUtil.getKey(key);
} }
Response response = uploadManager.put(file.getBytes(), key, upToken); Response response = uploadManager.put(file.getBytes(), key, upToken);
@ -117,7 +117,7 @@ public class QiNiuServiceImpl implements QiNiuService {
DefaultPutRet putRet = JSON.parseObject(response.bodyString(), DefaultPutRet.class); DefaultPutRet putRet = JSON.parseObject(response.bodyString(), DefaultPutRet.class);
QiniuContent content = qiniuContentService.getOne(new QueryWrapper<QiniuContent>().eq("name",FileUtil.getFileNameNoEx(putRet.key))); QiniuContent content = qiniuContentService.getOne(new LambdaQueryWrapper<QiniuContent>().eq(QiniuContent::getName,FileUtil.getFileNameNoEx(putRet.key)));
if (content == null) { if (content == null) {
//存入数据库 //存入数据库
QiniuContent qiniuContent = new QiniuContent(); QiniuContent qiniuContent = new QiniuContent();
@ -199,7 +199,7 @@ public class QiNiuServiceImpl implements QiNiuService {
QiniuContent qiniuContent; QiniuContent qiniuContent;
FileInfo[] items = fileListIterator.next(); FileInfo[] items = fileListIterator.next();
for (FileInfo item : items) { for (FileInfo item : items) {
if(qiniuContentService.getOne(new QueryWrapper<QiniuContent>().eq("name",FileUtil.getFileNameNoEx(item.key))) if(qiniuContentService.getOne(new LambdaQueryWrapper<QiniuContent>().eq(QiniuContent::getName,FileUtil.getFileNameNoEx(item.key)))
== null){ == null){
qiniuContent = new QiniuContent(); qiniuContent = new QiniuContent();
qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(item.fsize+""))); qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(item.fsize+"")));

View File

@ -17,7 +17,7 @@ import co.yixiang.tools.domain.VerificationCode;
import co.yixiang.tools.domain.vo.EmailVo; import co.yixiang.tools.domain.vo.EmailVo;
import co.yixiang.tools.service.VerificationCodeService; import co.yixiang.tools.service.VerificationCodeService;
import co.yixiang.tools.service.mapper.VerificationCodeMapper; import co.yixiang.tools.service.mapper.VerificationCodeMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@ -45,8 +45,8 @@ public class VerificationCodeServiceImpl extends BaseServiceImpl<VerificationCod
public EmailVo sendEmail(VerificationCode code) { public EmailVo sendEmail(VerificationCode code) {
EmailVo emailVo; EmailVo emailVo;
String content; String content;
VerificationCode verificationCode = this.getOne(new QueryWrapper<VerificationCode>() VerificationCode verificationCode = this.getOne(new LambdaQueryWrapper<VerificationCode>()
.eq("scenes",code.getScenes()).eq("type",code.getType()).eq("value",code.getValue())); .eq(VerificationCode::getScenes,code.getScenes()).eq(VerificationCode::getType,code.getType()).eq(VerificationCode::getValue,code.getValue()));
// 如果不存在有效的验证码,就创建一个新的 // 如果不存在有效的验证码,就创建一个新的
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
Template template = engine.getTemplate("email/email.ftl"); Template template = engine.getTemplate("email/email.ftl");
@ -66,9 +66,9 @@ public class VerificationCodeServiceImpl extends BaseServiceImpl<VerificationCod
@Override @Override
public void validated(VerificationCode code) { public void validated(VerificationCode code) {
VerificationCode verificationCode = this.getOne(new QueryWrapper<VerificationCode>() VerificationCode verificationCode = this.getOne(new LambdaQueryWrapper<VerificationCode>()
.eq("scenes",code.getScenes()).eq("type",code.getType()).eq("value",code.getValue()) .eq(VerificationCode::getScenes,code.getScenes()).eq(VerificationCode::getType,code.getType()).eq(VerificationCode::getValue,code.getValue())
.eq("status",true)); .eq(VerificationCode::getStatus,true));
if(verificationCode == null || !verificationCode.getCode().equals(code.getCode())){ if(verificationCode == null || !verificationCode.getCode().equals(code.getCode())){
throw new BadRequestException("无效验证码"); throw new BadRequestException("无效验证码");
} else { } else {

View File

@ -32,7 +32,6 @@ import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.StringUtils; import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -268,8 +267,8 @@ public class YxWechatLiveServiceImpl extends BaseServiceImpl<YxWechatLiveMapper,
@Override @Override
public List<YxWechatLiveDto> getList(int page, int limit, int order) { public List<YxWechatLiveDto> getList(int page, int limit, int order) {
//todo 添加状态判断 //todo 添加状态判断
QueryWrapper<YxWechatLive> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<YxWechatLive> wrapper = new LambdaQueryWrapper<>();
wrapper.lambda() wrapper
.orderByDesc(YxWechatLive::getStartTime); .orderByDesc(YxWechatLive::getStartTime);

View File

@ -14,7 +14,7 @@ import co.yixiang.modules.mp.service.YxWechatMenuService;
import co.yixiang.modules.mp.service.dto.YxWechatMenuDto; import co.yixiang.modules.mp.service.dto.YxWechatMenuDto;
import co.yixiang.modules.mp.service.dto.YxWechatMenuQueryCriteria; import co.yixiang.modules.mp.service.dto.YxWechatMenuQueryCriteria;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -79,7 +79,7 @@ public class YxWechatMenuServiceImpl extends BaseServiceImpl<WechatMenuMapper, Y
@Override @Override
public Boolean isExist(String wechat_menus) { public Boolean isExist(String wechat_menus) {
YxWechatMenu yxWechatMenu = this.getOne(new QueryWrapper<YxWechatMenu>().lambda() YxWechatMenu yxWechatMenu = this.getOne(new LambdaQueryWrapper<YxWechatMenu>()
.eq(YxWechatMenu::getKey,wechat_menus)); .eq(YxWechatMenu::getKey,wechat_menus));
if(yxWechatMenu == null){ if(yxWechatMenu == null){
return false; return false;

View File

@ -15,7 +15,7 @@ import co.yixiang.modules.mp.service.YxWechatReplyService;
import co.yixiang.modules.mp.service.dto.YxWechatReplyDto; import co.yixiang.modules.mp.service.dto.YxWechatReplyDto;
import co.yixiang.modules.mp.service.dto.YxWechatReplyQueryCriteria; import co.yixiang.modules.mp.service.dto.YxWechatReplyQueryCriteria;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -83,7 +83,7 @@ public class YxWechatReplyServiceImpl extends BaseServiceImpl<WechatReplyMapper,
@Override @Override
public YxWechatReply isExist(String key) { public YxWechatReply isExist(String key) {
YxWechatReply yxWechatReply = this.getOne(new QueryWrapper<YxWechatReply>().lambda() YxWechatReply yxWechatReply = this.getOne(new LambdaQueryWrapper<YxWechatReply>()
.eq(YxWechatReply::getKey,key)); .eq(YxWechatReply::getKey,key));
return yxWechatReply; return yxWechatReply;
} }

View File

@ -14,7 +14,7 @@ import co.yixiang.modules.mp.service.dto.YxWechatTemplateQueryCriteria;
import co.yixiang.modules.mp.service.dto.YxWechatTemplateDto; import co.yixiang.modules.mp.service.dto.YxWechatTemplateDto;
import co.yixiang.modules.mp.service.mapper.WechatTemplateMapper; import co.yixiang.modules.mp.service.mapper.WechatTemplateMapper;
import co.yixiang.utils.FileUtil; import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -83,7 +83,7 @@ public class YxWechatTemplateServiceImpl extends BaseServiceImpl<WechatTemplateM
@Override @Override
public YxWechatTemplate findByTempkey(String recharge_success_key) { public YxWechatTemplate findByTempkey(String recharge_success_key) {
return this.getOne(new QueryWrapper<YxWechatTemplate>().lambda() return this.getOne(new LambdaQueryWrapper<YxWechatTemplate>()
.eq(YxWechatTemplate::getTempkey,recharge_success_key)); .eq(YxWechatTemplate::getTempkey,recharge_success_key));
} }
} }