Skip to content

Commit

Permalink
feat: 增加操作日志(商品、用户、促销相关修改操作)
Browse files Browse the repository at this point in the history
  • Loading branch information
lele0626 committed Jan 4, 2024
1 parent e2fff23 commit b40533c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import cn.lili.modules.store.entity.vos.StoreVO;
import cn.lili.modules.store.service.FreightTemplateService;
import cn.lili.modules.store.service.StoreService;
import cn.lili.modules.system.aspect.annotation.SystemLogPoint;
import cn.lili.modules.system.entity.dos.Setting;
import cn.lili.modules.system.entity.dto.GoodsSetting;
import cn.lili.modules.system.entity.enums.SettingEnum;
Expand Down Expand Up @@ -165,6 +166,7 @@ public final long getGoodsCountByCategory(String categoryId) {

@Override
@Transactional(rollbackFor = Exception.class)
@SystemLogPoint(description = "添加商品", customerLog = "'新增商品名称:['+#goodsOperationDTO.goodsName+']'")
public void addGoods(GoodsOperationDTO goodsOperationDTO) {
Goods goods = new Goods(goodsOperationDTO);
//检查商品
Expand Down Expand Up @@ -192,6 +194,7 @@ public void addGoods(GoodsOperationDTO goodsOperationDTO) {

@Override
@Transactional(rollbackFor = Exception.class)
@SystemLogPoint(description = "修改商品", customerLog = "'操作的商品ID:['+#goodsId+']'")
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
Goods goods = new Goods(goodsOperationDTO);
goods.setId(goodsId);
Expand Down Expand Up @@ -290,6 +293,7 @@ public List<Goods> queryListByParams(GoodsSearchParams goodsSearchParams) {
}

@Override
@SystemLogPoint(description = "审核商品", customerLog = "'操作的商品ID:['+#goodsIds+']', '操作后商品状态:['+#goodsAuthEnum+']'")
@Transactional(rollbackFor = Exception.class)
public boolean auditGoods(List<String> goodsIds, GoodsAuthEnum goodsAuthEnum) {
List<String> goodsCacheKeys = new ArrayList<>();
Expand All @@ -312,6 +316,7 @@ public boolean auditGoods(List<String> goodsIds, GoodsAuthEnum goodsAuthEnum) {

@Override
@Transactional(rollbackFor = Exception.class)
@SystemLogPoint(description = "商品状态操作", customerLog = "'操作类型:['+#goodsStatusEnum+']', 操作对象:['+#goodsIds+']', 操作原因:['+#underReason+']'")
public Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
boolean result;

Expand Down Expand Up @@ -343,6 +348,7 @@ public Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum good
* @return 更新结果
*/
@Override
@SystemLogPoint(description = "店铺关闭下架商品", customerLog = "'操作类型:['+#goodsStatusEnum+']', 操作对象:['+#storeId+']', 操作原因:['+#underReason+']'")
public Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum goodsStatusEnum, String underReason) {


Expand All @@ -358,6 +364,7 @@ public Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum go
}

@Override
@SystemLogPoint(description = "管理员关闭下架商品", customerLog = "'操作类型:['+#goodsStatusEnum+']', 操作对象:['+#goodsIds+']', 操作原因:['+#underReason+']'")
@Transactional(rollbackFor = Exception.class)
public Boolean managerUpdateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason) {
boolean result;
Expand Down Expand Up @@ -386,6 +393,7 @@ public Boolean managerUpdateGoodsMarketAble(List<String> goodsIds, GoodsStatusEn

@Override
@Transactional(rollbackFor = Exception.class)
@SystemLogPoint(description = "删除商品", customerLog = "操作对象:['+#goodsIds+']'")
public Boolean deleteGoods(List<String> goodsIds) {

LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
Expand Down Expand Up @@ -432,6 +440,7 @@ public Boolean freight(List<String> goodsIds, String templateId) {
}

@Override
@SystemLogPoint(description = "修改商品库存", customerLog = "操作的商品ID:['+#goodsId+']', 修改后的库存:['+#quantity+']'")
public void updateStock(String goodsId, Integer quantity) {
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import cn.lili.modules.promotion.tools.PromotionTools;
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
import cn.lili.modules.search.service.EsGoodsIndexService;
import cn.lili.modules.system.aspect.annotation.SystemLogPoint;
import cn.lili.mybatis.util.PageUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
Expand Down Expand Up @@ -273,6 +274,7 @@ public void updatePromotionGoodsStock(List<PromotionGoods> promotionGoodsList) {
}

@Override
@SystemLogPoint(description = "更新促销活动商品库存", customerLog = "操作的skuId:['+#skuId+']', 修改后的库存:['+#quantity+']'")
public void updatePromotionGoodsStock(String skuId, Integer quantity) {
LambdaQueryWrapper<PromotionGoods> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PromotionGoods::getSkuId, skuId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import cn.lili.modules.member.entity.vo.MemberSearchVO;
import cn.lili.modules.member.entity.vo.MemberVO;
import cn.lili.modules.member.service.MemberService;
import cn.lili.modules.system.aspect.annotation.SystemLogPoint;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
Expand Down Expand Up @@ -51,6 +52,7 @@ public ResultMessage<MemberVO> get(@PathVariable String id) {
}

@ApiOperation(value = "添加会员")
@SystemLogPoint(description = "添加会员", customerLog = "'新增会员名称: ['+#member.username+']'")
@PostMapping
public ResultMessage<Member> save(@Valid MemberAddDTO member) {

Expand All @@ -59,6 +61,7 @@ public ResultMessage<Member> save(@Valid MemberAddDTO member) {

@DemoSite
@PreventDuplicateSubmissions
@SystemLogPoint(description = "修改会员信息", customerLog = "'修改的会员名称: ['+#managerMemberEditDTO.username+']'")
@ApiOperation(value = "修改会员基本信息")
@PutMapping
public ResultMessage<Member> update(@Valid ManagerMemberEditDTO managerMemberEditDTO) {
Expand All @@ -67,6 +70,7 @@ public ResultMessage<Member> update(@Valid ManagerMemberEditDTO managerMemberEdi

@DemoSite
@PreventDuplicateSubmissions
@SystemLogPoint(description = "修改会员状态", customerLog = "'修改的会员名称: ['+#memberIds+']', '是否开启: ['+#disabled+']'")
@ApiOperation(value = "修改会员状态,开启关闭会员")
@ApiImplicitParams({
@ApiImplicitParam(name = "memberIds", value = "会员ID", required = true, dataType = "String", allowMultiple = true, paramType = "query"),
Expand Down

0 comments on commit b40533c

Please sign in to comment.