产品分页列表
parent
ff8ce551db
commit
a93c0588c0
|
|
@ -1,22 +0,0 @@
|
||||||
package com.njzscloud.dispose.cst.order.pojo.vo;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author ljw
|
|
||||||
* @apiNote
|
|
||||||
* @date 2025/12/20
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Scope {
|
|
||||||
|
|
||||||
private String strategy;
|
|
||||||
|
|
||||||
@TableField(typeHandler = JsonTypeHandler.class)
|
|
||||||
private List<Long> ids;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.core.ex.Exceptions;
|
import com.njzscloud.common.core.ex.Exceptions;
|
||||||
import com.njzscloud.common.core.fastjson.Fastjson;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.common.security.util.SecurityUtil;
|
import com.njzscloud.common.security.util.SecurityUtil;
|
||||||
|
|
@ -23,11 +22,11 @@ import com.njzscloud.dispose.cst.order.pojo.entity.OrderExpenseItemsEntity;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
import com.njzscloud.dispose.cst.order.pojo.entity.OrderTransEntity;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.param.*;
|
import com.njzscloud.dispose.cst.order.pojo.param.*;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.result.OrderTransResult;
|
import com.njzscloud.dispose.cst.order.pojo.result.OrderTransResult;
|
||||||
import com.njzscloud.dispose.cst.order.pojo.vo.Scope;
|
|
||||||
import com.njzscloud.dispose.cst.truck.mapper.TruckMapper;
|
import com.njzscloud.dispose.cst.truck.mapper.TruckMapper;
|
||||||
import com.njzscloud.dispose.cst.truck.pojo.entity.TruckEntity;
|
import com.njzscloud.dispose.cst.truck.pojo.entity.TruckEntity;
|
||||||
import com.njzscloud.dispose.finance.constant.ScopeStrategy;
|
import com.njzscloud.dispose.finance.constant.ScopeStrategy;
|
||||||
import com.njzscloud.dispose.finance.pojo.entity.ExpenseItemEntity;
|
import com.njzscloud.dispose.finance.pojo.entity.ExpenseItemEntity;
|
||||||
|
import com.njzscloud.dispose.finance.pojo.entity.ScopeStrategyConfig;
|
||||||
import com.njzscloud.dispose.finance.service.ExpenseItemService;
|
import com.njzscloud.dispose.finance.service.ExpenseItemService;
|
||||||
import com.njzscloud.dispose.sys.auth.pojo.result.MyResult;
|
import com.njzscloud.dispose.sys.auth.pojo.result.MyResult;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -386,9 +385,9 @@ public class OrderService extends ServiceImpl<OrderMapper, OrderEntity> {
|
||||||
|
|
||||||
List<OrderExpenseItemsEntity> extraItems = itemEntityList.stream()
|
List<OrderExpenseItemsEntity> extraItems = itemEntityList.stream()
|
||||||
.filter(cfg -> {
|
.filter(cfg -> {
|
||||||
Scope userScope = Fastjson.toBean(cfg.getUserScope(), Scope.class);
|
ScopeStrategyConfig userScope = cfg.getUserScope();
|
||||||
Scope goodsScope = Fastjson.toBean(cfg.getGoodsScope(), Scope.class);
|
ScopeStrategyConfig goodsScope = cfg.getGoodsScope();
|
||||||
Scope stationsScope = Fastjson.toBean(cfg.getStationScope(), Scope.class);
|
ScopeStrategyConfig stationsScope = cfg.getStationScope();
|
||||||
List<Long> companyIds = userScope != null ? userScope.getIds() : null;
|
List<Long> companyIds = userScope != null ? userScope.getIds() : null;
|
||||||
List<Long> goodsIds = goodsScope != null ? goodsScope.getIds() : null;
|
List<Long> goodsIds = goodsScope != null ? goodsScope.getIds() : null;
|
||||||
List<Long> stationsIds = stationsScope != null ? stationsScope.getIds() : null;
|
List<Long> stationsIds = stationsScope != null ? stationsScope.getIds() : null;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
||||||
import com.njzscloud.dispose.common.pojo.entity.BaseEntity;
|
import com.njzscloud.dispose.common.pojo.entity.BaseEntity;
|
||||||
import com.njzscloud.dispose.finance.constant.ExpenseItemCategory;
|
import com.njzscloud.dispose.finance.constant.ExpenseItemCategory;
|
||||||
import com.njzscloud.dispose.finance.constant.ExpenseStrategy;
|
import com.njzscloud.dispose.finance.constant.ExpenseStrategy;
|
||||||
|
|
@ -94,17 +95,20 @@ public class ExpenseItemEntity extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 适用用户;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
* 适用用户;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
||||||
*/
|
*/
|
||||||
private String userScope;
|
@TableField(typeHandler = JsonTypeHandler.class)
|
||||||
|
private ScopeStrategyConfig userScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 适用站点;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
* 适用站点;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
||||||
*/
|
*/
|
||||||
private String stationScope;
|
@TableField(typeHandler = JsonTypeHandler.class)
|
||||||
|
private ScopeStrategyConfig stationScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 适用产品;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
* 适用产品;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
||||||
*/
|
*/
|
||||||
private String goodsScope;
|
@TableField(typeHandler = JsonTypeHandler.class)
|
||||||
|
private ScopeStrategyConfig goodsScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否可用;0-->否、1-->是
|
* 是否可用;0-->否、1-->是
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
package com.njzscloud.dispose.finance.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.finance.constant.ExpenseItemCategory;
|
||||||
|
import com.njzscloud.dispose.finance.constant.ExpenseStrategy;
|
||||||
|
import com.njzscloud.dispose.finance.constant.Payer;
|
||||||
|
import com.njzscloud.dispose.finance.pojo.entity.ScopeStrategyConfig;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费项目
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchExpenseItemResult {
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费项目类型,QiTa-->其他、ChanPin-->产品、YunFei-->运费
|
||||||
|
*/
|
||||||
|
private ExpenseItemCategory expenseItemCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付费项名称
|
||||||
|
*/
|
||||||
|
private String expenseItemName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计费策略;字典代码:expense_strategy
|
||||||
|
*/
|
||||||
|
private ExpenseStrategy expenseStrategy;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位;字典代码:unit
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 税率
|
||||||
|
*/
|
||||||
|
private BigDecimal taxRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付费方;字典代码:payer
|
||||||
|
*/
|
||||||
|
private Payer payer;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单价;单位:元,弹性模式-->每档价格
|
||||||
|
*/
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起步价;单位:元,<= 起步量 固定费用
|
||||||
|
*/
|
||||||
|
private BigDecimal initialPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起步量
|
||||||
|
*/
|
||||||
|
private Integer initialQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每档的量
|
||||||
|
*/
|
||||||
|
private Integer everyQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用用户;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
||||||
|
*/
|
||||||
|
private ScopeStrategyConfig userScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用站点;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
||||||
|
*/
|
||||||
|
private ScopeStrategyConfig stationScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用产品;结构类型:{strategy: Wu | ZhiDing | SuoYou,ids:long[]}
|
||||||
|
*/
|
||||||
|
private ScopeStrategyConfig goodsScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
private Long goodsId;
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
||||||
import com.njzscloud.dispose.goods.pojo.param.AddGoodsParam;
|
import com.njzscloud.dispose.goods.pojo.param.AddGoodsParam;
|
||||||
import com.njzscloud.dispose.goods.pojo.param.ModifyGoodsParam;
|
import com.njzscloud.dispose.goods.pojo.param.ModifyGoodsParam;
|
||||||
|
import com.njzscloud.dispose.goods.pojo.result.SearchGoodsResult;
|
||||||
import com.njzscloud.dispose.goods.service.GoodsService;
|
import com.njzscloud.dispose.goods.service.GoodsService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -77,7 +78,7 @@ public class GoodsController {
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/paging")
|
@GetMapping("/paging")
|
||||||
public R<PageResult<GoodsEntity>> paging(PageParam pageParam, GoodsEntity goodsEntity) {
|
public R<PageResult<SearchGoodsResult>> paging(PageParam pageParam, GoodsEntity goodsEntity) {
|
||||||
return R.success(goodsService.paging(pageParam, goodsEntity));
|
return R.success(goodsService.paging(pageParam, goodsEntity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
package com.njzscloud.dispose.goods.mapper;
|
package com.njzscloud.dispose.goods.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
||||||
|
import com.njzscloud.dispose.goods.pojo.result.SearchGoodsResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品
|
* 产品
|
||||||
|
|
@ -10,6 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface GoodsMapper extends BaseMapper<GoodsEntity> {
|
public interface GoodsMapper extends BaseMapper<GoodsEntity> {
|
||||||
|
IPage<SearchGoodsResult> paging(Page<Object> page, @Param("ew") QueryWrapper<Object> ew);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.njzscloud.dispose.goods.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.goods.contant.BizType;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品分类
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchGoodsCategoryResult {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型;字典代码:biz_type
|
||||||
|
*/
|
||||||
|
private BizType bizType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类名称
|
||||||
|
*/
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String picture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.njzscloud.dispose.goods.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.ienum.DictItem;
|
||||||
|
import com.njzscloud.common.core.ienum.DictKey;
|
||||||
|
import com.njzscloud.dispose.finance.pojo.result.SearchExpenseItemResult;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchGoodsResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品类型 Id
|
||||||
|
*/
|
||||||
|
private Long goodsCategoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编码
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格
|
||||||
|
*/
|
||||||
|
private String specParams;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String picture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位;字典代码:unit
|
||||||
|
*/
|
||||||
|
@DictKey("unit")
|
||||||
|
private DictItem unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用;0-->否、1-->是
|
||||||
|
*/
|
||||||
|
private Boolean canuse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String memo;
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联收费项目信息(返回用)
|
||||||
|
*/
|
||||||
|
private SearchExpenseItemResult expenseItem;
|
||||||
|
private SearchGoodsCategoryResult goodsCategory;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
||||||
import com.njzscloud.dispose.goods.pojo.param.AddGoodsParam;
|
import com.njzscloud.dispose.goods.pojo.param.AddGoodsParam;
|
||||||
import com.njzscloud.dispose.goods.pojo.param.ModifyGoodsParam;
|
import com.njzscloud.dispose.goods.pojo.param.ModifyGoodsParam;
|
||||||
|
import com.njzscloud.dispose.goods.pojo.result.SearchGoodsResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -23,7 +24,7 @@ public interface GoodsService extends IService<GoodsEntity> {
|
||||||
|
|
||||||
GoodsEntity detail(Long id);
|
GoodsEntity detail(Long id);
|
||||||
|
|
||||||
PageResult<GoodsEntity> paging(PageParam pageParam, GoodsEntity goodsEntity);
|
PageResult<SearchGoodsResult> paging(PageParam pageParam, GoodsEntity goodsEntity);
|
||||||
|
|
||||||
void enable(Long id, Boolean enable);
|
void enable(Long id, Boolean enable);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package com.njzscloud.dispose.goods.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
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.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
|
@ -14,10 +13,10 @@ import com.njzscloud.dispose.finance.pojo.param.ModifyExpenseItemParam;
|
||||||
import com.njzscloud.dispose.finance.service.ExpenseItemService;
|
import com.njzscloud.dispose.finance.service.ExpenseItemService;
|
||||||
import com.njzscloud.dispose.goods.mapper.GoodsCategoryMapper;
|
import com.njzscloud.dispose.goods.mapper.GoodsCategoryMapper;
|
||||||
import com.njzscloud.dispose.goods.mapper.GoodsMapper;
|
import com.njzscloud.dispose.goods.mapper.GoodsMapper;
|
||||||
import com.njzscloud.dispose.goods.pojo.entity.GoodsCategoryEntity;
|
|
||||||
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
import com.njzscloud.dispose.goods.pojo.entity.GoodsEntity;
|
||||||
import com.njzscloud.dispose.goods.pojo.param.AddGoodsParam;
|
import com.njzscloud.dispose.goods.pojo.param.AddGoodsParam;
|
||||||
import com.njzscloud.dispose.goods.pojo.param.ModifyGoodsParam;
|
import com.njzscloud.dispose.goods.pojo.param.ModifyGoodsParam;
|
||||||
|
import com.njzscloud.dispose.goods.pojo.result.SearchGoodsResult;
|
||||||
import com.njzscloud.dispose.goods.service.GoodsService;
|
import com.njzscloud.dispose.goods.service.GoodsService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -94,16 +93,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<GoodsEntity> paging(PageParam pageParam, GoodsEntity goodsEntity) {
|
public PageResult<SearchGoodsResult> paging(PageParam pageParam, GoodsEntity goodsEntity) {
|
||||||
Page<GoodsEntity> page = this.page(pageParam.toPage(), Wrappers.query(goodsEntity));
|
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.query()));
|
||||||
for (GoodsEntity goods : page.getRecords()) {
|
|
||||||
goods.setExpenseItem(expenseItemService.getOne(Wrappers.<ExpenseItemEntity>lambdaQuery()
|
|
||||||
.eq(ExpenseItemEntity::getGoodsId, goods.getId())));
|
|
||||||
goods.setGoodsCategoryName(goodsCategoryMapper.selectOne(Wrappers.<GoodsCategoryEntity>lambdaQuery()
|
|
||||||
.eq(GoodsCategoryEntity::getId, goods.getGoodsCategoryId())).getCategoryName());
|
|
||||||
|
|
||||||
}
|
|
||||||
return PageResult.of(page);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njzscloud.dispose.goods.mapper.GoodsMapper">
|
||||||
|
<resultMap id="SearchGoodsResultMap" autoMapping="true" type="com.njzscloud.dispose.goods.pojo.result.SearchGoodsResult">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<association property="goodsCategory"
|
||||||
|
javaType="com.njzscloud.dispose.goods.pojo.result.SearchGoodsCategoryResult"
|
||||||
|
autoMapping="true">
|
||||||
|
<id property="id" column="goods_category_id"/>
|
||||||
|
<result property="createTime" column="b_create_time"/>
|
||||||
|
<result property="sort" column="b_sort"/>
|
||||||
|
<result property="picture" column="b_picture"/>
|
||||||
|
</association>
|
||||||
|
<association property="expenseItem"
|
||||||
|
javaType="com.njzscloud.dispose.finance.pojo.result.SearchExpenseItemResult"
|
||||||
|
autoMapping="true">
|
||||||
|
<id property="id" column="c_id"/>
|
||||||
|
<result property="createTime" column="c_create_time"/>
|
||||||
|
<result property="canuse" column="c_canuse"/>
|
||||||
|
<result property="memo" column="c_memo"/>
|
||||||
|
<result property="unit" column="c_unit"/>
|
||||||
|
<result property="userScope" column="user_scope" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
|
||||||
|
<result property="stationScope" column="station_scope" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
|
||||||
|
<result property="goodsScope" column="goods_scope" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
|
||||||
|
</association>
|
||||||
|
</resultMap>
|
||||||
|
<select id="paging" resultMap="SearchGoodsResultMap">
|
||||||
|
SELECT a.id,
|
||||||
|
a.goods_category_id,
|
||||||
|
a.sn,
|
||||||
|
a.goods_name,
|
||||||
|
a.spec_params,
|
||||||
|
a.picture,
|
||||||
|
a.unit,
|
||||||
|
a.sort,
|
||||||
|
a.canuse,
|
||||||
|
a.memo,
|
||||||
|
a.create_time,
|
||||||
|
b.biz_type,
|
||||||
|
b.category_name,
|
||||||
|
b.picture b_picture,
|
||||||
|
b.sort b_sort,
|
||||||
|
b.create_time b_create_time,
|
||||||
|
c.id c_id,
|
||||||
|
c.expense_item_category,
|
||||||
|
c.expense_item_name,
|
||||||
|
c.expense_strategy,
|
||||||
|
c.unit c_unit,
|
||||||
|
c.tax_rate,
|
||||||
|
c.payer,
|
||||||
|
c.unit_price,
|
||||||
|
c.initial_price,
|
||||||
|
c.initial_quantity,
|
||||||
|
c.every_quantity,
|
||||||
|
c.user_scope,
|
||||||
|
c.station_scope,
|
||||||
|
c.goods_scope,
|
||||||
|
c.canuse c_canuse,
|
||||||
|
c.memo c_memo,
|
||||||
|
c.create_time c_create_time
|
||||||
|
FROM gds_goods a
|
||||||
|
INNER JOIN gds_goods_category b ON a.goods_category_id = b.id
|
||||||
|
LEFT JOIN fin_expense_item c ON c.goods_id = a.id
|
||||||
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue