引流配置修改
This commit is contained in:
parent
b2c287d368
commit
47cea3310c
|
|
@ -33,7 +33,7 @@ public class BirthdayGiftController {
|
|||
@SaAdminCheckPermission(value = "birthdayGift:detail", name = "生日有礼详情")
|
||||
@GetMapping
|
||||
public CzgResult<MkBirthdayGiftVO> detail() {
|
||||
return CzgResult.success(service.detail(StpKit.USER.getShopId()));
|
||||
return CzgResult.success(service.detail(StpKit.USER.getMainShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,7 +43,7 @@ public class BirthdayGiftController {
|
|||
@SaAdminCheckPermission(value = "birthdayGift:edit", name = "生日有礼修改")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkBirthdayGiftDTO giftDTO) {
|
||||
return CzgResult.success(service.edit(StpKit.USER.getShopId(), giftDTO));
|
||||
return CzgResult.success(service.edit(StpKit.USER.getMainShopId(), giftDTO));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ public class BirthdayGiftController {
|
|||
@SaAdminCheckPermission(value = "birthdayGift:record", name = "生日有礼记录")
|
||||
@GetMapping("/record")
|
||||
public CzgResult<Page<MkBirthdayGiftRecordVO>> record(@RequestParam(required = false) LocalDateTime dateTime, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(service.getRecord(StpKit.USER.getShopId(), key, dateTime));
|
||||
return CzgResult.success(service.getRecord(StpKit.USER.getMainShopId(), key, dateTime));
|
||||
// return null;
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public class BirthdayGiftController {
|
|||
@SaAdminCheckPermission(value = "birthdayGift:summary", name = "生日有礼概述")
|
||||
@GetMapping("/summary")
|
||||
public CzgResult<MkBirthdayGiftRecordSummaryVO> summary(@RequestParam(required = false) LocalDateTime dateTime, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(service.summary(StpKit.USER.getShopId(), key, dateTime));
|
||||
return CzgResult.success(service.summary(StpKit.USER.getMainShopId(), key, dateTime));
|
||||
// return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class ConsumeCashbackController {
|
|||
@SaAdminCheckPermission(value = "consumeDiscount:detail", name = "消费返现详情")
|
||||
@GetMapping
|
||||
public CzgResult<MkConsumeCashbackVO> detail() {
|
||||
return CzgResult.success(service.detail(StpKit.USER.getShopId()));
|
||||
return CzgResult.success(service.detail(StpKit.USER.getMainShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -58,7 +58,7 @@ public class ConsumeCashbackController {
|
|||
@GetMapping("/record")
|
||||
public CzgResult<Map<String, Object>> record(@RequestParam(required = false) Long shopId, @RequestParam(required = false) String key,
|
||||
@RequestParam(required = false)String startTime, @RequestParam(required = false) String endTime) {
|
||||
return CzgResult.success(consumeCashbackRecordService.getRecord(StpKit.USER.getShopId(), shopId, key,
|
||||
return CzgResult.success(consumeCashbackRecordService.getRecord(StpKit.USER.getMainShopId(), shopId, key,
|
||||
StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,8 +85,12 @@ public class MyStpLogic {
|
|||
if (!isMain && parentId1 == null) {
|
||||
session.set("headId", headId);
|
||||
}
|
||||
|
||||
// 设置主店id
|
||||
Object mainShopId = session.get("mainShopId");
|
||||
session.set("userId", id).set("isAdmin", isAdmin).set("isManager", loginType.equals(LoginType.MANAGER))
|
||||
.set("loginType", loginType).set("account", account).set("shopId", shopId).set("shopName", shopName);
|
||||
.set("loginType", loginType).set("account", account).set("shopId", shopId).set("shopName", shopName)
|
||||
.set("mainShopId", mainShopId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -108,10 +112,10 @@ public class MyStpLogic {
|
|||
if (shopId != null) {
|
||||
session.set("shopId", shopId);
|
||||
}
|
||||
if (headShopId != null) {
|
||||
if (!isMainShop) {
|
||||
session.set("headShopId", headShopId);
|
||||
session.set("mainShopId", headShopId);
|
||||
}
|
||||
session.set("mainShopId", headShopId);
|
||||
if (shopName != null) {
|
||||
session.set("shopName", shopName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ public class Main {
|
|||
// String packageName = "system";
|
||||
// String packageName = "account";
|
||||
// String packageName = "product";
|
||||
String packageName = "account";
|
||||
String packageName = "market";
|
||||
|
||||
String tableName = "sys_image_library";
|
||||
String tableName = "mk_drainage_config";
|
||||
String author = "zs";
|
||||
//是否生成DTO实体 默认生成
|
||||
boolean isGenerateDto = false;
|
||||
|
|
|
|||
|
|
@ -152,9 +152,13 @@ public class MkBirthdayGiftServiceImpl extends ServiceImpl<MkBirthdayGiftMapper,
|
|||
JSONArray.parseArray(birthdayGift.getConfigList()).toJavaList(MkBirthdayGiftConfig.class).forEach(config -> {
|
||||
LocalDate current = DateUtil.date().toLocalDateTime().toLocalDate();
|
||||
if ("day".equals(config.getDeliverDate())) {
|
||||
current = current.plusDays(config.getDeliverTime());
|
||||
if (config.getDeliverTime() != 1) {
|
||||
current = current.plusDays(config.getDeliverTime());
|
||||
}
|
||||
}else {
|
||||
current = current.plusDays(config.getDeliverTime() * 30);
|
||||
DateTime now = DateUtil.date();
|
||||
// 获取当月第一天
|
||||
current = DateUtil.beginOfMonth(now).toLocalDateTime().toLocalDate();
|
||||
}
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper().isNotNull(ShopUser::getBirthDay)
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.czg.account.service.ShopInfoService;
|
||||
import com.czg.market.dto.MkConsumeCashbackDTO;
|
||||
import com.czg.market.dto.MkDrainageConfigDTO;
|
||||
import com.czg.market.entity.MkConsumeCashback;
|
||||
import com.czg.market.vo.MkDrainageConfigVO;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
|
|
@ -36,7 +34,7 @@ public class MkDrainageConfigServiceImpl extends ServiceImpl<MkDrainageConfigMap
|
|||
config.setMainShopId(mainShopId);
|
||||
config.setShopId(shopId);
|
||||
save(config);
|
||||
config = getOne(new QueryWrapper().eq(MkConsumeCashback::getMainShopId, shopId));
|
||||
config = getOne(new QueryWrapper().eq(MkDrainageConfig::getShopId, shopId));
|
||||
}
|
||||
MkDrainageConfigVO info = BeanUtil.copyProperties(config, MkDrainageConfigVO.class, "useType");
|
||||
if (StrUtil.isNotBlank(config.getUseType())) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue