添加店铺初始化支付方式

This commit is contained in:
张松 2025-03-24 21:24:06 +08:00
parent 6c0b731be7
commit 6d866f4116
4 changed files with 13 additions and 4 deletions

View File

@ -19,4 +19,6 @@ public interface ShopPayTypeService extends IService<ShopPayType> {
Boolean add(Long shopId, ShopPayType shopPayType);
Boolean edit(Long shopId, ShopPayTypeDTO shopPayTypeDTO);
void addInfo(Long shopId);
}

View File

@ -59,6 +59,8 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
private ShopExtendService shopExtendService;
@Resource
private RedisService redisService;
@Resource
private ShopPayTypeService shopPayTypeService;
@DubboReference
private SysParamsService sysParamsService;
@ -144,6 +146,9 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
if (StrUtil.isNotBlank(shopInfoAddDTO.getActivateCode())) {
activateShop(shopInfo, shopInfoAddDTO.getActivateCode());
}
// 增加支付方式
shopPayTypeService.addInfo(shopInfo.getId());
return updateById(shopInfo);
}

View File

@ -29,11 +29,13 @@ public class ShopPayTypeServiceImpl extends ServiceImpl<ShopPayTypeMapper, ShopP
"cash", "现金",
"bank", "银行卡",
"scanCode", "扫码支付",
"deposit", "储值卡"
"deposit", "储值卡",
"virtual", "挂账支付"
);
private void addInfo(Long shopId) {
payTypeMap.forEach((k, v) -> save(new ShopPayType().setPayType(k).setPayName(v).setShopId(shopId)));
@Override
public void addInfo(Long shopId) {
payTypeMap.forEach((k, v) -> save(new ShopPayType().setPayType(k).setPayName(v).setShopId(shopId).setIsShowShortcut("挂账支付".equals(v) ? 0 : 1)));
}
@Override

View File

@ -15,7 +15,7 @@
and a.area_id=#{areaId}
</if>
<if test="tableCode != null and tableCode != ''">
and a.area_id=#{areaId}
and a.table_code=#{tableCode}
</if>
<if test="status != null and status != ''">
and a.status=#{status}