提交 4fbc758a 作者: xiaowang

删除

上级 8cfdb013
......@@ -346,7 +346,9 @@ public enum ResultEnum implements BaseErrorInfoInterface {
GOODS_NOT_EXIST_OR_ALREADY_DOWN_SHELF("30913", "商品不存在或已下架"),
GOODS_NAME_IS_NOT_NULL("30914", "商品名称不能为空或名字长度不能大于60"),
GOODS_DELETE_FAIL("30915", "批量删除商品失败,商品已被其他商品绑定"),
BRAND_DELETE_FAIL("30916", "删除失败,产品管理中有产品绑定该品牌名称"),
BRAND_DELETE_FAIL("30916", "删除失败,有产品绑定该品牌"),
TYPE_DELETE_FAIL("30917", "删除失败,有产品绑定该类型"),
DEVICE_MODE_DELETE_FAIL("30918", "删除失败,有产品绑定该型号"),
// 返祖
RETURN_SHARE_ORDER_ERROR("40000", "设备返祖订单相关信息找不到,请重新输入订单号"),
RETURN_SHARE_ORDER_NOT_FINISH_ERROR("40001", "此设备的订单未完成,请添加其他设备"),
......
......@@ -36,7 +36,7 @@ public class BrandManageController {
return ResultBody.success(brandManageService.listBrandInfo(pageNo, pageSize));
}
@ApiOperation(value = "删除品牌---待与运营沟通")
@ApiOperation(value = "删除品牌")
@GetMapping("deleteBrandInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody deleteBrandInfo(Integer id) {
......@@ -71,5 +71,10 @@ public class BrandManageController {
return brandManageService.editMode(param);
}
@ApiOperation(value = "删除型号")
@GetMapping("deleteMode")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody deleteMode(Integer id) {
return brandManageService.deleteMode(id);
}
}
......@@ -77,6 +77,8 @@ public interface BrandManageDao {
int countModeInfoByName(ModeInfoVO param);
int countLeaseGoodsByDeviceModeId(Integer id);
void insertModeInfo(DeviceModeDO modeInfoDO);
int countModeInfo(ModeInfoQO param);
......@@ -86,4 +88,6 @@ public interface BrandManageDao {
void updateModeInfo(DeviceModeDO modeInfoDO);
List<DeviceModeDO> listDeviceModeByBrandId(List<Integer> ids);
void removeModeInfoById(Integer id);
}
......@@ -24,103 +24,103 @@ import java.util.Set;
@Mapper
public interface ProductDao {
int countSkuName(ProductSkuVO param);
int countSkuName(ProductSkuVO param);
int insertProductSku(ProductDO productDO);
int insertProductSku(ProductDO productDO);
int countProductIsExist(Integer id);
int countProductIsExist(Integer id);
ProductDO getProductDetail(Integer id);
ProductDO getProductDetail(Integer id);
int updateProductSku(ProductDO productDO);
int updateProductSku(ProductDO productDO);
int countListPageProductSku(ProductSkuQO productSkuQO);
int countListPageProductSku(ProductSkuQO productSkuQO);
List<ProductDO> listPageProductSku(ProductSkuQO productSkuQO);
List<ProductDO> 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(@Param("id") Integer id, @Param("keyword") String keyword);
int countListPageProductSpec(@Param("id") Integer id, @Param("keyword") String keyword);
List<ProductSpecDO> listPageProductSpec(
@Param(value = "pageNo") Integer pageNo,
@Param(value = "pageSize") Integer pageSize,
@Param(value = "productId") Integer productId,
@Param(value = "keyword") String keyword);
List<ProductSpecDO> listPageProductSpec(
@Param(value = "pageNo") Integer pageNo,
@Param(value = "pageSize") Integer pageSize,
@Param(value = "productId") Integer productId,
@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<ProductDO> listProductSkuDO(List<Integer> productId);
List<ProductDO> listProductSkuDO(List<Integer> productId);
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);
void removeProductSku(Integer id);
void removeProductSku(Integer 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);
List<BigDecimal> feignGetUnitPriceByTag(PriceAcquisition priceAcquisition);
List<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);
/**
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List<ProductSpecPriceDO> listProductSpecPrice(Integer tagInfoId, Set<Integer> prodSkuSpecIds);
ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId);
ProductSpecPriceDTO feignGetUnitPrice(Integer id, Integer tagId);
List<ProductSpecDO> getProductSpecList(List<Integer> productIds);
List<ProductSpecDO> getProductSpecList(List<Integer> productIds);
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);
List<ProductSpecPriceDO> getProductSpecPriceList(List<Integer> specIds);
ProductSpecPriceDO getProductSpecPriceById(Integer id);
ProductSpecPriceDO getProductSpecPriceById(Integer id);
List<DirectoryDO> productDirectoryList();
List<DirectoryDO> productDirectoryList();
List<ProductSpecPriceDO> listAllProductSpecPriceByType(
@Param("prodSkuSpecIds") Set<Integer> prodSkuSpecIds);
List<ProductSpecPriceDO> listAllProductSpecPriceByType(
@Param("prodSkuSpecIds") Set<Integer> prodSkuSpecIds);
int countSpecByProdSkuId(Integer id);
int countSpecByProdSkuId(Integer id);
BigDecimal getMarketplacePrice(PriceAcquisition priceAcquisition);
BigDecimal getMarketplacePrice(PriceAcquisition priceAcquisition);
int countLeaseGoodsByBrandId(Integer id);
}
......@@ -30,4 +30,5 @@ public interface ProductAttributeDao {
int updateProductAttribute(Integer id, Date createTime);
int countLeaseGoodsByTypeId(Integer id);
}
......@@ -54,4 +54,6 @@ public interface BrandManageService {
PageResult modeList(ModeInfoQO param);
ResultBody editMode(ModeInfoVO param);
ResultBody deleteMode(Integer id);
}
......@@ -47,6 +47,11 @@ public class ProductAttributeServiceImpl implements ProductAttributeService {
@Override
public ResultBody removeType(Integer id) {
// 判断该类型是否绑定产品信息
int count = productAttributeDao.countLeaseGoodsByTypeId(id);
if (count > 0) {
return ResultBody.error(ResultEnum.TYPE_DELETE_FAIL);
}
productAttributeDao.removeType(id);
return ResultBody.success();
}
......
......@@ -86,7 +86,7 @@ public class BrandManageServiceImpl implements BrandManageService {
@Override
public ResultBody deleteBrandInfo(Integer id) {
// 判断该品牌是否绑定产品信息
int count = productDao.countProductSpecByBrandId(id);
int count = productDao.countLeaseGoodsByBrandId(id);
if (count > 0) {
return ResultBody.error(ResultEnum.BRAND_DELETE_FAIL);
}
......@@ -142,5 +142,14 @@ public class BrandManageServiceImpl implements BrandManageService {
return ResultBody.success();
}
@Override
public ResultBody deleteMode(Integer id) {
// 判断该品牌是否绑定产品信息
int count = brandManageDao.countLeaseGoodsByDeviceModeId(id);
if (count > 0) {
return ResultBody.error(ResultEnum.DEVICE_MODE_DELETE_FAIL);
}
brandManageDao.removeModeInfoById(id);
return ResultBody.success();
}
}
......@@ -34,6 +34,11 @@
tag = #{tag}
where id = #{id}
</update>
<delete id="removeModeInfoById">
delete
from device_mode
where id = #{id}
</delete>
<select id="countBrandInfoByName" resultType="java.lang.Integer">
select count(*)
......@@ -114,4 +119,10 @@
#{item}
</foreach>)
</select>
<select id="countLeaseGoodsByDeviceModeId" resultType="java.lang.Integer">
select count(*)
from lease_goods
where device_mode_id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -5,8 +5,8 @@
<mapper namespace="com.mmc.pms.dao.ProductDao">
<insert id="insertProductSku" parameterType="com.mmc.pms.entity.ProductDO"
useGeneratedKeys="true" keyProperty="id">
insert into product (product_name, model, brand_info_id, customize,`type`)
values (#{productName}, #{model}, #{brandInfoId}, #{customize},#{type})
insert into product (product_name, model, brand_info_id, customize, `type`)
values (#{productName}, #{model}, #{brandInfoId}, #{customize}, #{type})
</insert>
<insert id="insertProductSpec" keyProperty="id" useGeneratedKeys="true"
parameterType="com.mmc.pms.entity.ProductSpecDO">
......@@ -192,15 +192,14 @@
</select>
<select id="getProductSpecPrice" resultType="com.mmc.pms.entity.ProductSpecPriceDO">
select id,
product_spec_id productSpecId,
cooperation_tag cooperationTag,
price,
create_time createTime,
lease_term
product_spec_id productSpecId,
cooperation_tag cooperationTag,
price,
create_time createTime,
lease_term
from product_spec_price
where
product_spec_id = #{productSpecId}
and `type` =#{type}
where product_spec_id = #{productSpecId}
and `type` = #{type}
</select>
<select id="listProductSpec" resultType="com.mmc.pms.entity.ProductSpecDO">
select id,
......@@ -263,12 +262,6 @@
#{item}
</foreach>
</select>
<select id="countProductSpecByBrandId" resultType="java.lang.Integer">
select count(*)
from product
where brand_info_id = #{id}
and is_deleted = 0
</select>
<select id="countSpecByproductId" resultType="java.lang.Integer">
select count(*)
from product_spec
......@@ -523,7 +516,7 @@
where `type` = 1
and lease_term = #{day}
and cooperation_tag = 0
and product_spec_id = #{specsId}
and product_spec_id = #{specsId}
</select>
<select id="feignGetUnitPriceByTag" resultType="java.math.BigDecimal">
select price
......@@ -532,9 +525,15 @@
product_spec_id = #{specsId}
and `type` = 1
and lease_term = #{day}
<foreach collection="channelLevelId" index="index" separator="," open="and cooperation_tag in(" close=")" item="d">
<foreach collection="channelLevelId" index="index" separator="," open="and cooperation_tag in(" close=")"
item="d">
#{d}
</foreach>
</where>
</select>
<select id="countLeaseGoodsByBrandId" resultType="java.lang.Integer">
select count(*)
from lease_goods
where brand_info_id = #{id}
</select>
</mapper>
......@@ -53,4 +53,9 @@
order by create_time desc
limit #{pageNo}, #{pageSize}
</select>
<select id="countLeaseGoodsByTypeId" resultType="java.lang.Integer">
select count(*)
from lease_goods
where product_type_id = #{id}
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论