提交 e1059dbb authored 作者: douxy's avatar douxy

CP计划小程序改造,新增模板改造,导出飞书文件改造

上级 e5ea8462
package com.wangxiaolu.promotion.controller.activity.temporary; package com.wangxiaolu.promotion.controller.activity.temporary;
import com.wangxiaolu.promotion.controller.user.tem.TemporaryInfoQueryController;
import com.wangxiaolu.promotion.domain.user.dao.TemporaryInfoDao; import com.wangxiaolu.promotion.domain.user.dao.TemporaryInfoDao;
import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus; import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus;
import com.wangxiaolu.promotion.exception.DataException; import com.wangxiaolu.promotion.exception.DataException;
...@@ -14,6 +15,7 @@ import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCloc ...@@ -14,6 +15,7 @@ import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCloc
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityQueryService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityQueryService;
import com.wangxiaolu.promotion.service.wechat.WeChatUserQueryService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -41,6 +43,9 @@ public class TemporaryActivityCoreController { ...@@ -41,6 +43,9 @@ public class TemporaryActivityCoreController {
@Autowired @Autowired
private TemporaryActivityClockCoreService tempActivityClockCoreService; private TemporaryActivityClockCoreService tempActivityClockCoreService;
@Autowired
private WeChatUserQueryService weChatUserQueryService;
/** /**
* 促销员[今日活动]数据保存 * 促销员[今日活动]数据保存
* 返回活动生成id * 返回活动生成id
...@@ -54,6 +59,11 @@ public class TemporaryActivityCoreController { ...@@ -54,6 +59,11 @@ public class TemporaryActivityCoreController {
TemporaryActivityReportedDto temActDto = new TemporaryActivityReportedDto(); TemporaryActivityReportedDto temActDto = new TemporaryActivityReportedDto();
BeanUtils.copyProperties(activityVo, temActDto); BeanUtils.copyProperties(activityVo, temActDto);
temActDto.setId(activityVo.getActivityReportedId()); temActDto.setId(activityVo.getActivityReportedId());
//保存促销员电话号码
String temporaryPhone = weChatUserQueryService.findUserPhoneByID(activityVo.getTemporaryId());
temActDto.setTemporaryPhone(temporaryPhone);
/** /**
* 已有id,修改任务 * 已有id,修改任务
*/ */
...@@ -78,7 +88,8 @@ public class TemporaryActivityCoreController { ...@@ -78,7 +88,8 @@ public class TemporaryActivityCoreController {
.setActivityPatternId(clockDto.getActivityPatternId()) .setActivityPatternId(clockDto.getActivityPatternId())
.setActivityPattern(clockDto.getActivityPattern()) .setActivityPattern(clockDto.getActivityPattern())
.setProvince(clockDto.getClockProvince()) .setProvince(clockDto.getClockProvince())
.setCity(clockDto.getClockCity()); .setCity(clockDto.getClockCity()).setTemporaryPhone(clockDto.getPhone())
;
long reportedId = tempActivityCoreService.activityDataReportedSave(temActDto); long reportedId = tempActivityCoreService.activityDataReportedSave(temActDto);
......
...@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.File;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.YearMonth; import java.time.YearMonth;
......
package com.wangxiaolu.promotion.controller.user.location;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.user.TencentLocationQueryService;
import com.wangxiaolu.promotion.utils.TencentMapUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: DouXinYu
* @Date: 2026-01-12 11:10
* @Description:
*/
@RestController
@RequestMapping("/user/location/query")
public class TencentLocationController {
@Autowired
TencentLocationQueryService tencentLocationQueryService;
@GetMapping("/reverse")
public R getDefaultLocation(@RequestParam("lng") double lng, @RequestParam("lat") double lat){
TencentMapUtil.AddressInfo addressByLngLat = tencentLocationQueryService.getAddressByLngLat(lng, lat);
return R.success(addressByLngLat);
}
@GetMapping("/list")
public R getProvinceDistinctList(){
return R.success(tencentLocationQueryService.getAddressList());
}
}
...@@ -77,4 +77,5 @@ public class ActivityPlanInfoVo { ...@@ -77,4 +77,5 @@ public class ActivityPlanInfoVo {
private String lineName; private String lineName;
} }
...@@ -158,14 +158,24 @@ public class ActivityPlanInfoDto implements Serializable { ...@@ -158,14 +158,24 @@ public class ActivityPlanInfoDto implements Serializable {
*/ */
// private BigDecimal incidentals; // private BigDecimal incidentals;
/** /**
* 是否有试吃台 * 门店是否已配试吃台
*/ */
private String temWlSct; private String temWlSct;
/** /**
* 活动品项:老品/黑鸭/散称 * 活动品项:老品/黑鸭/散称/礼盒
*/ */
private String prdClass; private String prdClass;
/**
* 活动执行方式:经销商/第三方
*/
private String planExecuteMode;
/**
* 门店是否允许使用试吃台
*/
private String isCanUseTasteCounter;
/** /**
* 是否执行:1:执行;0:未执行; * 是否执行:1:执行;0:未执行;
*/ */
......
...@@ -80,12 +80,21 @@ public class ActivityPlanOperVo { ...@@ -80,12 +80,21 @@ public class ActivityPlanOperVo {
private LocalDateTime noonClockInTime; private LocalDateTime noonClockInTime;
/** /**
* 是否有试吃台 * 门店是否可用试吃台
*/
private String isCanUseTasteCounter;
/**
* 门店是否配有试吃台
*/ */
private String temWlSct; private String temWlSct;
/** /**
* 活动品项:老品/黑鸭/散称 * 活动品项:老品/黑鸭/散称/礼盒
*/ */
private String prdClass; private String prdClass;
/**
* 执行方式
*/
private String planExecuteMode;
private List<Long> planIds; private List<Long> planIds;
} }
...@@ -18,6 +18,7 @@ import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto; ...@@ -18,6 +18,7 @@ import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityMarketCellDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityMarketCellDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityMarketCellVo; import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityMarketCellVo;
import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode; import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService;
...@@ -88,6 +89,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -88,6 +89,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
// 保存图片 // 保存图片
saveActivityPhotoV2(temActDto); saveActivityPhotoV2(temActDto);
// 售卖单元新增保存 // 售卖单元新增保存
// String key = temMarketCellRedisKey(temActDto.getTemporaryId()); // String key = temMarketCellRedisKey(temActDto.getTemporaryId());
// temporaryActivityMarketCellDao.saveList(reportedId,redisCache.getToJsonArray(key)); // temporaryActivityMarketCellDao.saveList(reportedId,redisCache.getToJsonArray(key));
...@@ -113,6 +115,8 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -113,6 +115,8 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
}else { }else {
temActDto.setApproveStatus(TemActApproveStatus.SUBMITTED); temActDto.setApproveStatus(TemActApproveStatus.SUBMITTED);
} }
WxTemporaryInfoDto wxTemporaryInfoDto = temporaryInfoDao.selectOneById(temActDto.getTemporaryId());
temActDto.setTemporaryPhone(wxTemporaryInfoDto.getPhone());
temporaryActivityReportedDao.updateById(temActDto); temporaryActivityReportedDao.updateById(temActDto);
// 售卖单元新增保存 // 售卖单元新增保存
......
package com.wangxiaolu.promotion.service.user;
import com.wangxiaolu.promotion.utils.TencentMapUtil;
import java.util.List;
/**
* @Author: DouXinYu
* @Date: 2026-01-12 11:17
* @Description:
*/
public interface TencentLocationQueryService {
TencentMapUtil.AddressInfo getAddressByLngLat(double lng, double lat);
List<TencentMapUtil.RegionNode> getAddressList();
}
package com.wangxiaolu.promotion.service.user.impl;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.wangxiaolu.promotion.service.user.TencentLocationQueryService;
import com.wangxiaolu.promotion.utils.TencentMapUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.lang.reflect.Type;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @Author: DouXinYu
* @Date: 2026-01-12 11:16
* @Description: 腾讯位置查询服务实现类
*/
@Service
public class TencentLocationQueryServiceImpl implements TencentLocationQueryService {
private static final String TRIPLE_REGION_CACHE_KEY = "promotion:district:triple_level";
private static final long CACHE_EXPIRE = 86400L;
private static final Type REGION_NODE_TYPE = new TypeToken<List<TencentMapUtil.RegionNode>>() {}.getType();
private static final Gson GSON = new Gson();
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
TencentMapUtil tencentMapUtil;
@Override
public TencentMapUtil.AddressInfo getAddressByLngLat(double lng, double lat) {
return tencentMapUtil.getAddressByLngLat(lng, lat);
}
@Override
public List<TencentMapUtil.RegionNode> getAddressList() {
String cacheJson = stringRedisTemplate.opsForValue().get(TRIPLE_REGION_CACHE_KEY);
if (cacheJson != null && !cacheJson.isEmpty()) {
return GSON.fromJson(cacheJson, REGION_NODE_TYPE);
}
List<TencentMapUtil.RegionNode> regionList = tencentMapUtil.getTripleLevelRegion();
if (!regionList.isEmpty()) {
stringRedisTemplate.opsForValue().set(TRIPLE_REGION_CACHE_KEY, GSON.toJson(regionList), CACHE_EXPIRE, TimeUnit.SECONDS);
}
return regionList;
}
}
...@@ -18,4 +18,11 @@ public interface WeChatUserQueryService { ...@@ -18,4 +18,11 @@ public interface WeChatUserQueryService {
LoginVo temporaryLoginByPhone(String phone); LoginVo temporaryLoginByPhone(String phone);
List<Map<String, String>> findStoreList(TemporaryRegisterVo temporaryRegisterVo); List<Map<String, String>> findStoreList(TemporaryRegisterVo temporaryRegisterVo);
/**
* 根据临时ID查询手机号
* @param temporaryId 临时ID
* @return 手机号
*/
String findUserPhoneByID(Long temporaryId);
} }
...@@ -94,4 +94,9 @@ public class WeChatUserQueryServiceImpl implements WeChatUserQueryService { ...@@ -94,4 +94,9 @@ public class WeChatUserQueryServiceImpl implements WeChatUserQueryService {
public List<Map<String, String>> findStoreList(TemporaryRegisterVo temporaryRegisterVo) { public List<Map<String, String>> findStoreList(TemporaryRegisterVo temporaryRegisterVo) {
return activityPlanInfoDao.findThisMonthStoreListByLocation(temporaryRegisterVo); return activityPlanInfoDao.findThisMonthStoreListByLocation(temporaryRegisterVo);
} }
@Override
public String findUserPhoneByID(Long temporaryId) {
return temporaryInfoDao.selectOneById(temporaryId).getPhone();
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论