提交 262bfee5 作者: xiaowang

新增:租赁设备列表条件查询

上级 e15f88ea
package com.mmc.pms.controller.mini; package com.mmc.pms.controller.common;
import com.mmc.pms.common.Page; import com.mmc.pms.common.Page;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.constant.TokenConstant;
import com.mmc.pms.controller.BaseController; import com.mmc.pms.controller.BaseController;
import com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO; import com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO;
import com.mmc.pms.model.qo.WareInfoQO; import com.mmc.pms.model.qo.WareInfoQO;
...@@ -21,20 +22,24 @@ import javax.servlet.http.HttpServletRequest; ...@@ -21,20 +22,24 @@ import javax.servlet.http.HttpServletRequest;
/** /**
* @Author LW * @Author LW
* @date 2023/6/8 17:16 *
* 概要: * @date 2023/6/8 17:16 概要:
*/ */
@Api(tags = {"v1.0.1-设备租赁-相关接口"}) @Api(tags = {"v1.0.1-设备租赁-相关接口"})
@RestController @RestController
@RequestMapping("/lease/goods") @RequestMapping("/lease/goods")
public class MiniLeaseGoodsController extends BaseController { public class LeaseGoodsController extends BaseController {
@Autowired @Autowired private WebDeviceService webDeviceService;
private WebDeviceService webDeviceService;
@ApiOperation(value = "设备列表筛选") @ApiOperation(value = "设备列表筛选")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = LeaseGoodsInfoDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = LeaseGoodsInfoDTO.class)})
@PostMapping("/deviceList") @PostMapping("/deviceList")
public ResultBody listWareInfoPage(@RequestBody @Validated(Page.class) WareInfoQO param, HttpServletRequest request) { public ResultBody listWareInfoPage(
return webDeviceService.listWareInfoPage(param, request, this.getUserLoginInfoFromRedis(request).getUserAccountId()); @RequestBody @Validated(Page.class) WareInfoQO param, HttpServletRequest request) {
if (request.getHeader(TokenConstant.TOKEN) == null) {
return webDeviceService.listWareInfoPage(param, null, null);
} }
return webDeviceService.listWareInfoPage(
param, request, this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
} }
...@@ -19,102 +19,101 @@ import java.util.Set; ...@@ -19,102 +19,101 @@ import java.util.Set;
/** /**
* @author 23214 * @author 23214
* @description 针对表【product_sku(产品sku表)】的数据库操作Mapper * @description 针对表【product_sku(产品sku表)】的数据库操作Mapper
* @createDate 2023-05-25 14:55:56 * @createDate 2023-05-25 14:55:56 @Entity com.mmc.pms.entity.ProductSku
* @Entity com.mmc.pms.entity.ProductSku
*/ */
@Mapper @Mapper
public interface ProductDao { public interface ProductDao {
int countSkuName(ProductSkuVO param); int countSkuName(ProductSkuVO param);
int insertProductSku(ProductSkuDO productSkuDO); int insertProductSku(ProductSkuDO productSkuDO);
int countSkuIsExist(Integer id); int countSkuIsExist(Integer id);
ProductSkuDO getProductSkuDetail(Integer id); ProductSkuDO getProductSkuDetail(Integer id);
int updateProductSku(ProductSkuDO productSkuDO); int updateProductSku(ProductSkuDO productSkuDO);
int countListPageProductSku(ProductSkuQO productSkuQO); int countListPageProductSku(ProductSkuQO productSkuQO);
List<ProductSkuDO> listPageProductSku(ProductSkuQO productSkuQO); List<ProductSkuDO> listPageProductSku(ProductSkuQO productSkuQO);
int countSpecName(ProductSpecVO param); int countSpecName(ProductSpecVO param);
int insertProductSpec(ProductSpecDO productSpecDO); int insertProductSpec(ProductSpecDO productSpecDO);
int updateProductSpec(ProductSpecDO productSpecDO); int updateProductSpec(ProductSpecDO productSpecDO);
int countSpecIsExist(Integer id); int countSpecIsExist(Integer id);
ProductSpecDO getProductSpecDetail(Integer id); ProductSpecDO getProductSpecDetail(Integer id);
int countListPageProductSpec(Integer productSkuId); int countListPageProductSpec(@Param("id") Integer id, @Param("keyword") String keyword);
List<ProductSpecDO> listPageProductSpec(int pageNo, Integer pageSize, Integer productSkuId); List<ProductSpecDO> listPageProductSpec(
@Param(value = "pageNo") Integer pageNo,
@Param(value = "pageSize") Integer pageSize,
@Param(value = "productSkuId") Integer productSkuId,
@Param(value = "keyword") String keyword);
int batchInsertSpecPrice(List<ProductSpecPriceDO> list); int batchInsertSpecPrice(List<ProductSpecPriceDO> list);
void batchInsertLeaseSpecPrice(List<ProductSpecPriceDO> list);
void batchInsertLeaseSpecPrice(List<ProductSpecPriceDO> list); void removeProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
void removeProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO); List<ProductSpecPriceDO> getProductSpecPrice(ProductSpecCPQVO productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPrice(ProductSpecCPQVO productSpecCPQVO); void insertMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
void insertMallProdSkuInfo(MallProdInfoDO mallProdInfoDO); List<ProductSpecDO> listProductSpec(Integer id);
List<ProductSpecDO> listProductSpec(Integer id); List<ProductSkuDO> listProductSkuDO(List<Integer> productSkuId);
List<ProductSkuDO> listProductSkuDO(List<Integer> productSkuId); List<InventorySpecDO> listInventorySpecInfo(List<Integer> industryProductInventoryIds);
List<InventorySpecDO> listInventorySpecInfo(List<Integer> industryProductInventoryIds); List<ProductSpecDO> listProductSpecInfo(List<Integer> productSpecIds);
List<ProductSpecDO> listProductSpecInfo(List<Integer> productSpecIds); void batchUpdateMallProdSpec(List<Integer> delProductSpecId);
void batchUpdateMallProdSpec(List<Integer> delProductSpecId); int countProductSpecByBrandId(Integer id);
int countProductSpecByBrandId(Integer id); int countSpecByProdSkuId(Integer id);
int countSpecByProdSkuId(Integer id); void removeProductSku(Integer id);
void removeProductSku(Integer id); List<MallProdInfoDO> listMallProdInfo(String id);
List<MallProdInfoDO> listMallProdInfo(String id); void removeProductSpec(Integer id);
void removeProductSpec(Integer id); List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds);
List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds); List<InventorySpecDO> listInventorySpec(Integer id);
List<InventorySpecDO> listInventorySpec(Integer id); BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition); List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds); /**
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List<ProductSpecPriceDO> listProductSpecPrice(Integer tagInfoId, Set<Integer> prodSkuSpecIds);
/** ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId);
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List<ProductSpecPriceDO> listProductSpecPrice(Integer tagInfoId, Set<Integer> prodSkuSpecIds);
ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId); List<ProductSpecDO> getProductSpecList(List<Integer> productSkuIds);
List<ProductSpecDO> getProductSpecList(List<Integer> productSkuIds); List<MallProdSkuInfoSpecDO> getProductSpecByIds(List<Integer> delProductSpecId);
List<MallProdSkuInfoSpecDO> getProductSpecByIds(List<Integer> delProductSpecId); Set<Integer> listProductSpecIds(@Param("mallProdSkuSpecIds") Set<Integer> mallProdSkuSpecIds);
Set<Integer> listProductSpecIds(@Param("mallProdSkuSpecIds") Set<Integer> mallProdSkuSpecIds); List<OrderGoodsProdDTO> listProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
List<OrderGoodsProdDTO> listProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO); List<MallProdSkuInfoSpecDO> listMallProductSpec(Integer id);
List<MallProdSkuInfoSpecDO> listMallProductSpec(Integer id);
List<ProductSpecPriceDO> getProductSpecPriceList(List<Integer> specIds);
} }
package com.mmc.pms.model.lease.dto;
import com.mmc.pms.model.sale.dto.GoodsDetailInfoDTO;
import com.mmc.pms.model.sale.dto.GoodsImgDTO;
import com.mmc.pms.model.sale.dto.GoodsOtherServiceDTO;
import com.mmc.pms.model.sale.dto.GoodsSpecDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
/**
* @Author LW
*
* @date 2022/11/8 15:57 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class LeaseGoodsDetailDTO implements Serializable {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "pid")
private Integer pid;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "云享飞服务id")
private Integer shareFlyServiceId;
@ApiModelProperty(value = "云仓配件id")
private Integer repoId;
@ApiModelProperty(value = "规格信息")
private List<GoodsSpecDTO> goodsSpec;
@ApiModelProperty(value = "商品图片")
private List<GoodsImgDTO> images;
@ApiModelProperty(value = "商品视频")
private String goodsVideo;
@ApiModelProperty(value = "商品视频id")
private Integer goodsVideoId;
@ApiModelProperty(value = "商品详情")
private GoodsDetailInfoDTO goodsDetail;
@ApiModelProperty(value = "所属目录")
private Integer sortTypeId;
@ApiModelProperty(value = "一级分类id")
private Integer categoryByOne;
@ApiModelProperty(value = "二级分类id")
private Integer categoryByTwo;
@ApiModelProperty(value = "商品标签")
private String tag;
@ApiModelProperty(value = "其他服务: 1:免费配送,2:专业飞手培训2日, 3:半年保修, 4:一年保修 ")
private List<GoodsOtherServiceDTO> otherService;
}
...@@ -9,6 +9,7 @@ import lombok.experimental.Accessors; ...@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author small @Date 2023/5/16 15:30 @Version 1.0 * @Author small @Date 2023/5/16 15:30 @Version 1.0
...@@ -19,26 +20,29 @@ import java.util.Date; ...@@ -19,26 +20,29 @@ import java.util.Date;
@Builder @Builder
@Accessors @Accessors
public class ProductSpecDTO implements Serializable { public class ProductSpecDTO implements Serializable {
private static final long serialVersionUID = -2681122778843398310L; private static final long serialVersionUID = -2681122778843398310L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "productSkuId") @ApiModelProperty(value = "productSkuId")
private Integer productSkuId; private Integer productSkuId;
@ApiModelProperty(value = "规格名称") @ApiModelProperty(value = "规格名称")
private String specName; private String specName;
@ApiModelProperty(value = "规格图片") @ApiModelProperty(value = "规格图片")
private String specImage; private String specImage;
@ApiModelProperty(value = "料号") @ApiModelProperty(value = "料号")
private String partNo; private String partNo;
@ApiModelProperty(value = "版本描述") @ApiModelProperty(value = "版本描述")
private String versionDesc; private String versionDesc;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@ApiModelProperty(value = "价格配置")
private List<ProductSpecPriceDTO> priceList;
} }
...@@ -18,32 +18,32 @@ import java.util.List; ...@@ -18,32 +18,32 @@ import java.util.List;
*/ */
public interface ProductSkuService { public interface ProductSkuService {
ResultBody addProductSku(ProductSkuVO param); ResultBody addProductSku(ProductSkuVO param);
ResultBody getProductSkuDetail(Integer id); ResultBody getProductSkuDetail(Integer id);
ResultBody editProductSku(ProductSkuVO param); ResultBody editProductSku(ProductSkuVO param);
ResultBody listPageProductSku(ProductSkuQO productSkuQO); ResultBody listPageProductSku(ProductSkuQO productSkuQO);
ResultBody addOrEditProductSpec(ProductSpecVO param); ResultBody addOrEditProductSpec(ProductSpecVO param);
ResultBody getProductSpecDetail(Integer id); ResultBody getProductSpecDetail(Integer id);
ResultBody listPageProductSpec(Integer pageNo, Integer pageSize, Integer productSkuId); ResultBody listPageProductSpec(
Integer pageNo, Integer pageSize, Integer productSkuId, String keyword);
ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO); ResultBody productSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
List<ProductSpecPriceDO> getProductSpecPriceDOS(ProductSpecCPQVO productSpecCPQVO); List<ProductSpecPriceDO> getProductSpecPriceDOS(ProductSpecCPQVO productSpecCPQVO);
ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO); ResultBody updateProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO); ResultBody getProductSpecCPQ(ProductSpecCPQVO productSpecCPQVO);
ResultBody removeProductSku(Integer id); ResultBody removeProductSku(Integer id);
ResultBody removeProductSpec(Integer id); ResultBody removeProductSpec(Integer id);
BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
BigDecimal feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
} }
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
and product_name like CONCAT ('%',#{productName},'%') and product_name like CONCAT ('%',#{productName},'%')
</if> </if>
<if test="categoryId != null"> <if test="categoryId != null">
and categories = #{categoryId} and categories_id = #{categoryId}
</if> </if>
<if test="directoryId != null"> <if test="directoryId != null">
and directory_id = #{directoryId} and directory_id = #{directoryId}
...@@ -178,22 +178,32 @@ ...@@ -178,22 +178,32 @@
<select id="countListPageProductSpec" resultType="java.lang.Integer"> <select id="countListPageProductSpec" resultType="java.lang.Integer">
select count(*) select count(*)
from product_spec from product_spec
where is_deleted = 0 <where>
and product_id = #{id} is_deleted = 0
and product_sku_id = #{id}
<if test="keyword != null and keyword != ''">
and spec_name like CONCAT('%',#{keyword},'%')
</if>
</where>
</select> </select>
<select id="listPageProductSpec" resultType="com.mmc.pms.entity.ProductSpecDO"> <select id="listPageProductSpec" resultType="com.mmc.pms.entity.ProductSpecDO">
select id, select id,
product_id productSkuId, product_id productSkuId,
spec_name specName, spec_name specName,
spec_image specImage, spec_image specImage,
part_no partNo, part_no partNo,
version_desc versionDesc, version_desc versionDesc,
create_time createTime create_time createTime
from product_spec from product_spec
where is_deleted = 0 <where>
and product_id = #{productSkuId} is_deleted = 0
and product_id = #{productSkuId}
<if test="keyword != null and keyword != ''">
and spec_name like CONCAT('%',#{keyword},'%')
</if>
</where>
order by create_time desc order by create_time desc
limit #{pageNo}, #{pageSize} limit #{pageNo}, #{pageSize}
</select> </select>
<select id="getProductSpecPrice" resultType="com.mmc.pms.entity.ProductSpecPriceDO"> <select id="getProductSpecPrice" resultType="com.mmc.pms.entity.ProductSpecPriceDO">
select id, select id,
...@@ -479,4 +489,17 @@ ...@@ -479,4 +489,17 @@
AND mp.is_deleted = 0 AND mp.is_deleted = 0
AND gi.is_deleted = 0 AND gi.is_deleted = 0
</select> </select>
<select id="getProductSpecPriceList" resultType="com.mmc.pms.entity.ProductSpecPriceDO">
SELECT
id,
product_spec_id productSpecId,
tag_info_id tagInfoId,
price
FROM
product_spec_price
WHERE product_spec_id in (
<foreach collection="list" separator="," index="index" item="d">
#{d}
</foreach>)
</select>
</mapper> </mapper>
...@@ -153,14 +153,12 @@ ...@@ -153,14 +153,12 @@
</select> </select>
<select id="countListWareInfoPage" parameterType="com.mmc.pms.entity.GoodsInfo" resultType="int"> <select id="countListWareInfoPage" parameterType="com.mmc.pms.entity.GoodsInfo" resultType="int">
SELECT SELECT count(*)
count(*) FROM goods_info gi
FROM
goods_info gi
INNER JOIN goods_img img ON gi.id = img.goods_info_id INNER JOIN goods_img img ON gi.id = img.goods_info_id
<where> <where>
gi.is_deleted = 0 and gi.shelf_status = 0 gi.is_deleted = 0 and gi.shelf_status = 0
<if test="categoryIds != null"> <if test="categoryIds != null and categoryIds.size != 0">
<foreach collection="categoryIds" item="item" index="index" open="and gi.category_by_one IN (" close=")" <foreach collection="categoryIds" item="item" index="index" open="and gi.category_by_one IN (" close=")"
separator=","> separator=",">
#{item} #{item}
......
...@@ -7,3 +7,5 @@ data-filter: ...@@ -7,3 +7,5 @@ data-filter:
- /pms/swagger-resources/** - /pms/swagger-resources/**
- /pms/webjars/** - /pms/webjars/**
- /pms/product/spec/feignGetSpecLeaseUnitPrice - /pms/product/spec/feignGetSpecLeaseUnitPrice
- /pms//lease/goods/deviceList
- /pms/classify/queryCategoryInfoByType
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论