Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fd1d507f
authored
Jun 17, 2026
by
范富荣
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
精品升级查询商品列表新增活动商品标识
1 parent
245fda8b
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
160 additions
and
0 deletions
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/ActivityPackageItemDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityProductBatchReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/MarketingActivityRemote.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/MarketingActivityProductItemMapper.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/MarketingActivityProductMapper.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/MarketingActivityRemoteImpl.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/MarketingActivityService.java
rpc-dj-strategy/src/main/resources/META-INF/orm/MarketingActivityProductItemMapper.xml
rpc-dj-strategy/src/main/resources/META-INF/orm/MarketingActivityProductMapper.xml
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/ActivityPackageItemDTO.java
0 → 100644
View file @
fd1d507
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* 活动套餐子商品查询结果DTO
*/
@Data
public
class
ActivityPackageItemDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 套餐编码 */
private
String
packageCode
;
/** 子商品编码 */
private
String
goodsCode
;
/** 优惠价 */
private
BigDecimal
discountPrice
;
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityProductBatchReqDTO.java
0 → 100644
View file @
fd1d507
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 批量查询活动商品请求DTO
*/
@Data
public
class
MarketingActivityProductBatchReqDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 门店号(商户号) */
private
Integer
merchantId
;
/** 上架商品编码列表 */
private
List
<
String
>
goodsCodes
;
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/MarketingActivityRemote.java
View file @
fd1d507
package
cn
.
com
.
glsx
.
dj
.
strategy
.
remote
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
remote
;
import
cn.com.glsx.dj.strategy.dto.*
;
import
cn.com.glsx.dj.strategy.dto.*
;
import
cn.com.glsx.dj.strategy.model.MarketingActivityProduct
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
import
cn.com.glsx.framework.core.annotation.ApiParam
;
import
cn.com.glsx.framework.core.annotation.ApiParam
;
import
cn.com.glsx.framework.core.annotation.ApiResponse
;
import
cn.com.glsx.framework.core.annotation.ApiResponse
;
...
@@ -8,6 +9,8 @@ import cn.com.glsx.framework.core.annotation.ApiService;
...
@@ -8,6 +9,8 @@ import cn.com.glsx.framework.core.annotation.ApiService;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
java.util.List
;
/**
/**
* 营销活动 Remote 接口
* 营销活动 Remote 接口
*
*
...
@@ -77,4 +80,14 @@ public interface MarketingActivityRemote {
...
@@ -77,4 +80,14 @@ public interface MarketingActivityRemote {
@ApiParam
(
name
=
"activityId"
,
notes
=
"活动ID"
,
dataType
=
ApiParam
.
DataTypeEnum
.
INT
,
required
=
true
)
@ApiParam
(
name
=
"activityId"
,
notes
=
"活动ID"
,
dataType
=
ApiParam
.
DataTypeEnum
.
INT
,
required
=
true
)
@ApiResponse
(
"结果"
)
@ApiResponse
(
"结果"
)
RpcResponse
<
Boolean
>
cease
(
Integer
activityId
);
RpcResponse
<
Boolean
>
cease
(
Integer
activityId
);
@ApiMethod
(
"批量查询活动商品(按门店+商品编码)"
)
@ApiParam
(
name
=
"request"
,
notes
=
"查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"活动商品列表"
)
RpcResponse
<
List
<
MarketingActivityProduct
>>
batchQueryActivityProducts
(
MarketingActivityProductBatchReqDTO
request
);
@ApiMethod
(
"批量查询活动套餐子商品(按门店+套餐编码)"
)
@ApiParam
(
name
=
"request"
,
notes
=
"查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"活动套餐子商品列表"
)
RpcResponse
<
List
<
ActivityPackageItemDTO
>>
batchQueryActivityPackageItems
(
MarketingActivityProductBatchReqDTO
request
);
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/MarketingActivityProductItemMapper.java
View file @
fd1d507
package
cn
.
com
.
glsx
.
dj
.
strategy
.
mapper
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
mapper
;
import
cn.com.glsx.dj.strategy.dto.ActivityPackageItemDTO
;
import
cn.com.glsx.dj.strategy.model.MarketingActivityProductItem
;
import
cn.com.glsx.dj.strategy.model.MarketingActivityProductItem
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -36,4 +37,11 @@ public interface MarketingActivityProductItemMapper extends OreMapper<MarketingA
...
@@ -36,4 +37,11 @@ public interface MarketingActivityProductItemMapper extends OreMapper<MarketingA
* 按 productId 列表批量查询子商品
* 按 productId 列表批量查询子商品
*/
*/
List
<
MarketingActivityProductItem
>
selectByActivityProductIds
(
@Param
(
"productIds"
)
List
<
Integer
>
productIds
);
List
<
MarketingActivityProductItem
>
selectByActivityProductIds
(
@Param
(
"productIds"
)
List
<
Integer
>
productIds
);
/**
* 按门店+套餐编码查询有效活动套餐子商品
*/
List
<
ActivityPackageItemDTO
>
selectActiveByMerchantIdAndPackageCodes
(
@Param
(
"merchantId"
)
Integer
merchantId
,
@Param
(
"packageCodes"
)
List
<
String
>
packageCodes
);
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/MarketingActivityProductMapper.java
View file @
fd1d507
...
@@ -45,4 +45,11 @@ public interface MarketingActivityProductMapper extends OreMapper<MarketingActiv
...
@@ -45,4 +45,11 @@ public interface MarketingActivityProductMapper extends OreMapper<MarketingActiv
* 更新单个字段(优惠价/激励等)
* 更新单个字段(优惠价/激励等)
*/
*/
int
updateSelective
(
MarketingActivityProduct
record
);
int
updateSelective
(
MarketingActivityProduct
record
);
/**
* 按门店+商品编码查询有效活动商品
*/
List
<
MarketingActivityProduct
>
selectActiveByMerchantIdAndGoodsCodes
(
@Param
(
"merchantId"
)
Integer
merchantId
,
@Param
(
"goodsCodes"
)
List
<
String
>
goodsCodes
);
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/MarketingActivityRemoteImpl.java
View file @
fd1d507
package
cn
.
com
.
glsx
.
dj
.
strategy
.
remote
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
remote
;
import
cn.com.glsx.dj.strategy.dto.*
;
import
cn.com.glsx.dj.strategy.dto.*
;
import
cn.com.glsx.dj.strategy.model.MarketingActivityProduct
;
import
cn.com.glsx.dj.strategy.service.MarketingActivityService
;
import
cn.com.glsx.dj.strategy.service.MarketingActivityService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
...
@@ -10,6 +11,8 @@ import lombok.RequiredArgsConstructor;
...
@@ -10,6 +11,8 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
java.util.List
;
/**
/**
* 营销活动 Remote 实现
* 营销活动 Remote 实现
*
*
...
@@ -187,4 +190,34 @@ public class MarketingActivityRemoteImpl implements MarketingActivityRemote {
...
@@ -187,4 +190,34 @@ public class MarketingActivityRemoteImpl implements MarketingActivityRemote {
return
RpcResponse
.
error
(
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
@Override
public
RpcResponse
<
List
<
MarketingActivityProduct
>>
batchQueryActivityProducts
(
MarketingActivityProductBatchReqDTO
request
)
{
try
{
List
<
MarketingActivityProduct
>
result
=
marketingActivityService
.
batchQueryActivityProducts
(
request
.
getMerchantId
(),
request
.
getGoodsCodes
());
return
RpcResponse
.
success
(
result
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"批量查询活动商品发生业务异常"
,
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"批量查询活动商品发生异常"
,
e
);
return
RpcResponse
.
error
(
e
);
}
}
@Override
public
RpcResponse
<
List
<
ActivityPackageItemDTO
>>
batchQueryActivityPackageItems
(
MarketingActivityProductBatchReqDTO
request
)
{
try
{
List
<
ActivityPackageItemDTO
>
result
=
marketingActivityService
.
batchQueryActivityPackageItems
(
request
.
getMerchantId
(),
request
.
getGoodsCodes
());
return
RpcResponse
.
success
(
result
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"批量查询活动套餐子商品发生业务异常"
,
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"批量查询活动套餐子商品发生异常"
,
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/MarketingActivityService.java
View file @
fd1d507
...
@@ -330,6 +330,26 @@ public class MarketingActivityService {
...
@@ -330,6 +330,26 @@ public class MarketingActivityService {
return
0
;
return
0
;
}
}
/**
* 按门店+商品编码批量查询有效活动商品
*/
public
List
<
MarketingActivityProduct
>
batchQueryActivityProducts
(
Integer
merchantId
,
List
<
String
>
goodsCodes
)
{
if
(
merchantId
==
null
||
CollectionUtils
.
isEmpty
(
goodsCodes
))
{
return
Collections
.
emptyList
();
}
return
marketingActivityProductMapper
.
selectActiveByMerchantIdAndGoodsCodes
(
merchantId
,
goodsCodes
);
}
/**
* 按门店+套餐编码查询有效活动套餐子商品
*/
public
List
<
ActivityPackageItemDTO
>
batchQueryActivityPackageItems
(
Integer
merchantId
,
List
<
String
>
packageCodes
)
{
if
(
merchantId
==
null
||
CollectionUtils
.
isEmpty
(
packageCodes
))
{
return
Collections
.
emptyList
();
}
return
marketingActivityProductItemMapper
.
selectActiveByMerchantIdAndPackageCodes
(
merchantId
,
packageCodes
);
}
// ==================== 定时任务 ====================
// ==================== 定时任务 ====================
/**
/**
...
...
rpc-dj-strategy/src/main/resources/META-INF/orm/MarketingActivityProductItemMapper.xml
View file @
fd1d507
...
@@ -32,4 +32,23 @@
...
@@ -32,4 +32,23 @@
WHERE activity_product_id = #{activityProductId}
WHERE activity_product_id = #{activityProductId}
</update>
</update>
<select
id=
"selectActiveByMerchantIdAndPackageCodes"
resultType=
"cn.com.glsx.dj.strategy.dto.ActivityPackageItemDTO"
>
SELECT i.package_code AS packageCode, i.goods_code AS goodsCode, i.discount_price AS discountPrice
FROM dj_marketing_activity_product_item i
INNER JOIN dj_marketing_activity_product p ON i.activity_product_id = p.id
INNER JOIN dj_marketing_activity a ON p.activity_id = a.id
INNER JOIN dj_marketing_activity_store s ON s.activity_id = a.id
WHERE s.merchant_id = #{merchantId}
AND a.status = 1
AND p.product_type = 0
AND i.deleted_flag = 'N'
AND p.deleted_flag = 'N'
AND a.deleted_flag = 'N'
AND s.deleted_flag = 'N'
AND p.package_code IN
<foreach
collection=
"packageCodes"
item=
"code"
open=
"("
close=
")"
separator=
","
>
#{code}
</foreach>
</select>
</mapper>
</mapper>
rpc-dj-strategy/src/main/resources/META-INF/orm/MarketingActivityProductMapper.xml
View file @
fd1d507
...
@@ -43,4 +43,21 @@
...
@@ -43,4 +43,21 @@
</if>
</if>
</update>
</update>
<select
id=
"selectActiveByMerchantIdAndGoodsCodes"
resultType=
"cn.com.glsx.dj.strategy.model.MarketingActivityProduct"
>
SELECT p.id, p.activity_id, p.goods_code, p.discount_price, p.sales_incentive
FROM dj_marketing_activity_product p
INNER JOIN dj_marketing_activity a ON p.activity_id = a.id
INNER JOIN dj_marketing_activity_store s ON s.activity_id = a.id
WHERE s.merchant_id = #{merchantId}
AND a.status = 1
AND p.product_type = 1
AND p.deleted_flag = 'N'
AND a.deleted_flag = 'N'
AND s.deleted_flag = 'N'
AND p.goods_code IN
<foreach
collection=
"goodsCodes"
item=
"code"
open=
"("
close=
")"
separator=
","
>
#{code}
</foreach>
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment