耗材记录接口修改
This commit is contained in:
parent
b915389954
commit
d76ccdfbb0
|
|
@ -97,6 +97,7 @@ public class ConsStockFlowDTO implements Serializable {
|
|||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
private String productName;
|
||||
/**
|
||||
* sku id
|
||||
*/
|
||||
|
|
@ -127,4 +128,4 @@ public class ConsStockFlowDTO implements Serializable {
|
|||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.service.product.mapper;
|
||||
|
||||
import com.czg.product.dto.ConsStockFlowDTO;
|
||||
import com.czg.product.entity.ConsStockFlow;
|
||||
import com.czg.product.param.ConsInfoParam;
|
||||
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<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.util.WxAccountUtil;
|
||||
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.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
|
|
@ -217,19 +219,8 @@ public class ConsStockFlowServiceImpl extends ServiceImpl<ConsStockFlowMapper, C
|
|||
@Override
|
||||
public Page<ConsStockFlowDTO> findConsStockFlowPage(ConsStockFlowParam param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||
queryWrapper.eq(ConsStockFlow::getShopId, shopId);
|
||||
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);
|
||||
PageHelper.startPage(PageUtil.buildPageHelp());
|
||||
return PageUtil.convert(new PageInfo<>(mapper.findConsStockFlowPage(shopId, param.getInOutType(), param.getInOutItem(), param.getConId())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -264,4 +255,4 @@ public class ConsStockFlowServiceImpl extends ServiceImpl<ConsStockFlowMapper, C
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,19 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue