耗材记录接口修改
This commit is contained in:
parent
b915389954
commit
d76ccdfbb0
|
|
@ -97,6 +97,7 @@ public class ConsStockFlowDTO implements Serializable {
|
||||||
* 商品id
|
* 商品id
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
private String productName;
|
||||||
/**
|
/**
|
||||||
* sku id
|
* sku id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.czg.service.product.mapper;
|
package com.czg.service.product.mapper;
|
||||||
|
|
||||||
|
import com.czg.product.dto.ConsStockFlowDTO;
|
||||||
import com.czg.product.entity.ConsStockFlow;
|
import com.czg.product.entity.ConsStockFlow;
|
||||||
import com.czg.product.param.ConsInfoParam;
|
import com.czg.product.param.ConsInfoParam;
|
||||||
import com.czg.product.vo.ConsStatisticsVo;
|
import com.czg.product.vo.ConsStatisticsVo;
|
||||||
|
|
@ -24,4 +25,6 @@ public interface ConsStockFlowMapper extends BaseMapper<ConsStockFlow> {
|
||||||
List<ShopVendorBillRecordVO> selectByVendorId(@Param("shopId") Long shopId, @Param("vendorId") Integer vendorId, @Param("key") String key);
|
List<ShopVendorBillRecordVO> selectByVendorId(@Param("shopId") Long shopId, @Param("vendorId") Integer vendorId, @Param("key") String key);
|
||||||
|
|
||||||
List<ConsStockFlow> selectUnPaid(@Param("shopId") Long shopId, @Param("vendorIds") @NotEmpty List<Long> vendorIds);
|
List<ConsStockFlow> selectUnPaid(@Param("shopId") Long shopId, @Param("vendorIds") @NotEmpty List<Long> vendorIds);
|
||||||
|
|
||||||
|
List<ConsStockFlowDTO> findConsStockFlowPage(@Param("shopId") Long shopId, @Param("inOutType") String inOutType, @Param("inOutItem") String inOutItem, @Param("conId") Long conId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ import com.czg.service.product.mapper.ConsStockFlowMapper;
|
||||||
import com.czg.service.product.mapper.ProductMapper;
|
import com.czg.service.product.mapper.ProductMapper;
|
||||||
import com.czg.service.product.util.WxAccountUtil;
|
import com.czg.service.product.util.WxAccountUtil;
|
||||||
import com.czg.utils.PageUtil;
|
import com.czg.utils.PageUtil;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
|
@ -217,19 +219,8 @@ public class ConsStockFlowServiceImpl extends ServiceImpl<ConsStockFlowMapper, C
|
||||||
@Override
|
@Override
|
||||||
public Page<ConsStockFlowDTO> findConsStockFlowPage(ConsStockFlowParam param) {
|
public Page<ConsStockFlowDTO> findConsStockFlowPage(ConsStockFlowParam param) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
PageHelper.startPage(PageUtil.buildPageHelp());
|
||||||
queryWrapper.eq(ConsStockFlow::getShopId, shopId);
|
return PageUtil.convert(new PageInfo<>(mapper.findConsStockFlowPage(shopId, param.getInOutType(), param.getInOutItem(), param.getConId())));
|
||||||
if (StrUtil.isNotBlank(param.getInOutType())) {
|
|
||||||
queryWrapper.eq(ConsStockFlow::getInOutType, param.getInOutType());
|
|
||||||
}
|
|
||||||
if (StrUtil.isNotBlank(param.getInOutItem())) {
|
|
||||||
queryWrapper.eq(ConsStockFlow::getInOutItem, param.getInOutItem());
|
|
||||||
}
|
|
||||||
if (ObjUtil.isNotNull(param.getConId())) {
|
|
||||||
queryWrapper.eq(ConsStockFlow::getConId, param.getConId());
|
|
||||||
}
|
|
||||||
queryWrapper.orderBy(ConsStockFlow::getId, false);
|
|
||||||
return pageAs(PageUtil.buildPage(), queryWrapper, ConsStockFlowDTO.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,19 @@
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findConsStockFlowPage" resultType="com.czg.product.dto.ConsStockFlowDTO">
|
||||||
|
select a.*, b.name as productName from tb_cons_stock_flow as a
|
||||||
|
left join tb_product as b on a.product_id = b.id
|
||||||
|
where a.shop_id=#{shopId}
|
||||||
|
<if test="inOutType != null and inOutType != ''">
|
||||||
|
and a.in_out_type = #{inOutType}
|
||||||
|
</if>
|
||||||
|
<if test="inOutItem != null and inOutItem != ''">
|
||||||
|
and a.in_out_item = #{inOutItem}
|
||||||
|
</if>
|
||||||
|
<if test="conId != null">
|
||||||
|
and a.con_id = #{conId}
|
||||||
|
</if>
|
||||||
|
order by a.id desc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue