提交 c94bf431 authored 作者: 窦馨雨's avatar 窦馨雨

合并分支 'dxy' 到 'qa'

cp稽核接口改造:新增稽核查询接口信息 查看合并请求 !54
......@@ -2,6 +2,7 @@ package com.wangxiaolu.promotion.controller.activity.examine;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.activity.examine.ExaPlanQueryService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -21,15 +22,20 @@ public class ExaPlanQueryController {
@Autowired
private ExaPlanQueryService exaPlanQueryService;
@GetMapping("/{id}")
public R selectById(@PathVariable @PathParam("id") Long id) {
ActivityExamineDto examineDto = exaPlanQueryService.selectById(id);
if (examineDto != null) {
return R.success(examineDto);
}
InspectionInfoDto inspectionInfoDto =exaPlanQueryService.selectNewByID(id);
return R.success(inspectionInfoDto);
}
@PostMapping("/page")
public R page(@RequestBody PageInfo pageInfo){
exaPlanQueryService.page(pageInfo);
exaPlanQueryService.pageV2(pageInfo);
return R.success(pageInfo);
}
......
......@@ -4,6 +4,7 @@ import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.DataUtils;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.TemporaryRegisterVo;
import com.wangxiaolu.promotion.pojo.user.vo.WxTemporaryLoginVo;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.result.basedata.RCode;
......@@ -11,10 +12,8 @@ import com.wangxiaolu.promotion.service.wechat.WeChatUserQueryService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.*;
/**
* @author : liqiulin
......@@ -57,6 +56,7 @@ public class TemporaryInfoQueryController {
}
/**
* 促销员信息查询
*/
......@@ -70,9 +70,21 @@ public class TemporaryInfoQueryController {
// return R.success(userJson);
// }
/**
* 注册时获取门店列表
* @param temporaryRegisterVo 临时注册信息
* @return 门店列表
*/
@PostMapping("/temporary/findStoreList")
public R findStoreList(@RequestBody TemporaryRegisterVo temporaryRegisterVo) {
return R.success(weChatUserQueryService.findStoreList(temporaryRegisterVo));
}
private void phontAndOpenIdVerify(WxTemporaryLoginVo wxTemporaryLoginVo) {
if (StringUtils.isBlank(wxTemporaryLoginVo.getOpenId()) || StringUtils.isBlank(wxTemporaryLoginVo.getPhone())) {
throw new ParamException(RCode.LOGIN_PARAM_ERROR, null);
}
}
}
package com.wangxiaolu.promotion.domain.activityplanv2.dao;
import com.alibaba.fastjson.JSONArray;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfoDo;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.TemporaryRegisterVo;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author : liqiulin
......@@ -36,4 +39,12 @@ public interface ActivityPlanInfoDao {
void updatePlanStatus(Long planId, PlanStatus planStatus);
void updateByIds(List<Long> planIds, ActivityPlanInfoDto planDto);
/**
* 根据位置信息查询当前月份的促销门店
* @param temporaryRegisterVo 查询条件参数
* @return 门店信息列表
*/
List<Map<String, String>> findThisMonthStoreListByLocation(TemporaryRegisterVo temporaryRegisterVo);
}
......@@ -14,6 +14,7 @@ import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.exception.FlowException;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.TemporaryRegisterVo;
import com.wangxiaolu.promotion.result.basedata.RCode;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.exceptions.PersistenceException;
......@@ -22,9 +23,8 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author : liqiulin
......@@ -126,6 +126,33 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
errorMoreDate(planIds);
activityPlanInfoMapper.updateIsDelete(planIds,operNo);
}
/**
* 根据地理位置信息查询本店本月门店列表
* @param temporaryRegisterVo 查询条件参数
* @return 门店列表
*/
@Override
public List<Map<String, String>> findThisMonthStoreListByLocation(TemporaryRegisterVo temporaryRegisterVo) {
LambdaQueryWrapper<ActivityPlanInfoDo> qw = new LambdaQueryWrapper<>();
qw.likeRight(ActivityPlanInfoDo::getDate,temporaryRegisterVo.getMonth());
if (StringUtils.isNotBlank(temporaryRegisterVo.getProvince())){
qw.eq(ActivityPlanInfoDo::getProvince,temporaryRegisterVo.getProvince());
}
if (StringUtils.isNotBlank(temporaryRegisterVo.getCity())){
qw.eq(ActivityPlanInfoDo::getCity,temporaryRegisterVo.getCity());
}
List<ActivityPlanInfoDo> activityPlanInfoDoList = activityPlanInfoMapper.selectList(qw);
List<Map<String, String>> resultList = activityPlanInfoDoList.stream().map(activityPlanInfoDo -> {
Map<String, String> map = new HashMap<>();
map.put("storeCode", activityPlanInfoDo.getStoreCode());
map.put("storeName", activityPlanInfoDo.getStoreName());
return map;
}).collect(Collectors.toList());
return resultList;
}
private LambdaQueryWrapper<ActivityPlanInfoDo> buildWrapper(ActivityPlanInfoWrapper wrapper) {
LambdaQueryWrapper<ActivityPlanInfoDo> qw = new LambdaQueryWrapper<>();
if (wrapper.rangeDate()){
......
......@@ -90,5 +90,14 @@ public class TemporaryInfoDO implements Serializable {
private Date modifyTime;
/**
* 门店编号
*/
private String storeCode;
/**
* 门店名称
*/
private String storeName;
}
......@@ -82,4 +82,12 @@ public class WxTemporaryInfoDto {
* 创建时间
*/
Date createTime;
/**
* 所属门店编码
*/
String storeCode;
/**
* 所属门店名称
*/
String storeName;
}
package com.wangxiaolu.promotion.pojo.user.vo;
import lombok.Data;
import java.time.YearMonth;
import java.util.Date;
/**
* @Author: DouXinYu
* @Date: 2026-01-09 14:06
* @Description: 临时人员注册获取门店下拉列表的参数
*/
@Data
public class TemporaryRegisterVo {
/**
* 当前月份 YYYY-MM
*/
private YearMonth month;
/**
* 省份
*/
private String province;
/**
* 城市
*/
private String city;
/**
* 区
*/
private String area;
}
......@@ -89,6 +89,17 @@ public class WxTemporaryEnrollVo {
*/
String chargerName;
/**
* 所属门店编码
*/
String storeCode;
/**
* 门店名称
*/
String storeName;
public void validate() {
if (StringUtils.isBlank(openId)) {
throw new ParamException(RCode.WX_OPENID_PARAM_ERROR, null);
......
......@@ -2,6 +2,7 @@ package com.wangxiaolu.promotion.service.activity.examine;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
/**
* @author : liqiulin
......@@ -14,4 +15,8 @@ public interface ExaPlanQueryService {
ActivityExamineDto selectByPlanId(Long planId);
void page(PageInfo pageInfo);
InspectionInfoDto selectNewByID(Long id);
void pageV2(PageInfo pageInfo);
}
......@@ -3,8 +3,11 @@ package com.wangxiaolu.promotion.service.activity.examine.impl;
import com.alibaba.fastjson.JSONObject;
import com.wangxiaolu.promotion.domain.examine.dao.ActivityExamineDao;
import com.wangxiaolu.promotion.domain.examine.wrapperQo.ExamineWrapper;
import com.wangxiaolu.promotion.domain.inspection.dao.InspectionInfoDao;
import com.wangxiaolu.promotion.domain.inspection.wrapper.InspectionInfoWrapper;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.examine.dto.ActivityExamineDto;
import com.wangxiaolu.promotion.pojo.activity.inspectionInfo.dto.InspectionInfoDto;
import com.wangxiaolu.promotion.service.activity.examine.ExaPlanQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -20,6 +23,9 @@ public class ExaPlanQueryServiceImpl implements ExaPlanQueryService {
@Autowired
private ActivityExamineDao activityExamineDao;
@Autowired
private InspectionInfoDao inspectionInfoDao;
@Override
public ActivityExamineDto selectById(Long id) {
return activityExamineDao.selectById(id);
......@@ -36,4 +42,14 @@ public class ExaPlanQueryServiceImpl implements ExaPlanQueryService {
activityExamineDao.page(pageInfo,wq);
}
@Override
public InspectionInfoDto selectNewByID(Long id) {
return inspectionInfoDao.selectById( id);
}
@Override
public void pageV2(PageInfo pageInfo) {
InspectionInfoWrapper wq = JSONObject.parseObject(JSONObject.toJSONString(pageInfo.getQueryParams()), InspectionInfoWrapper.class);
inspectionInfoDao.page(pageInfo,wq);
}
}
package com.wangxiaolu.promotion.service.wechat;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.TemporaryRegisterVo;
import java.util.List;
import java.util.Map;
/**
* @author : liqiulin
......@@ -12,4 +16,6 @@ public interface WeChatUserQueryService {
LoginVo loginTemporaryByOpenIdAndPhone(String openId, String phone);
LoginVo temporaryLoginByPhone(String phone);
List<Map<String, String>> findStoreList(TemporaryRegisterVo temporaryRegisterVo);
}
......@@ -6,18 +6,20 @@ import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.JwtTokenUtils;
import com.wangxiaolu.promotion.common.util.JwtUtils;
import com.wangxiaolu.promotion.domain.activityplanv2.dao.ActivityPlanInfoDao;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfoDo;
import com.wangxiaolu.promotion.domain.user.dao.TemporaryInfoDao;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.TemporaryRegisterVo;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.wechat.WeChatUserQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.w3c.dom.stylesheets.LinkStyle;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.*;
/**
* @author : liqiulin
......@@ -33,6 +35,8 @@ public class WeChatUserQueryServiceImpl implements WeChatUserQueryService {
RedisCache redisCache;
@Autowired
JwtUtils jwtUtils;
@Autowired
private ActivityPlanInfoDao activityPlanInfoDao;
/**
* 根据openId、手机号登录
......@@ -86,4 +90,8 @@ public class WeChatUserQueryServiceImpl implements WeChatUserQueryService {
return loginVo;
}
@Override
public List<Map<String, String>> findStoreList(TemporaryRegisterVo temporaryRegisterVo) {
return activityPlanInfoDao.findThisMonthStoreListByLocation(temporaryRegisterVo);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论