提交 5a7fbbeb authored 作者: 李秋林's avatar 李秋林

后台手动创建终端计划时,添加勤策门店编码

上级 ba1dcb65
......@@ -151,6 +151,10 @@ public class EmployeeActivityPlanInfoDaoImpl implements EmployeeActivityPlanInfo
qw.eq(EmployeeActivityPlanInfoDO::getActivityStatus, wrapper.getActivityStatus().getType());
}
if (StringUtils.isNotBlank(wrapper.getQinceStoreCode())) {
qw.or(q1 -> q1.eq(EmployeeActivityPlanInfoDO::getQinceStoreCode, wrapper.getQinceStoreCode()));
}
qw.eq(EmployeeActivityPlanInfoDO::getIsDelete, StatusType.VALID.getType());
qw.orderByDesc(EmployeeActivityPlanInfoDO::getCreateTime);
return qw;
......
......@@ -76,6 +76,8 @@ public class EmployeeActivityPlanInfoDO implements Serializable {
* 店铺名称
*/
private String storeName;
private String qinceStoreCode;
private String qinceStoreName;
/**
* 活动模式
......
......@@ -60,6 +60,7 @@ public class ActivityPlanInfoWrapper {
*/
private String storeName;
private String storeNameLike;
private String qinceStoreCode;
/**
* 经销商名称
......
......@@ -114,6 +114,11 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
qw.eq(QinCeClienteleStoreDO::getQcId, storeWrapper.getQcId());
return qw;
}
// 按终端编码查询
if (StringUtils.isNotBlank(storeWrapper.getStoreCode())) {
qw.eq(QinCeClienteleStoreDO::getStoreCode, storeWrapper.getStoreCode());
return qw;
}
// 按门店名称模糊查询
if (StringUtils.isNotBlank(storeWrapper.getStoreNameVague())) {
qw.like(QinCeClienteleStoreDO::getStoreName, storeWrapper.getStoreNameVague().trim());
......
......@@ -29,4 +29,5 @@ public class StoreWrapper {
*/
private String storeStatus = "1";
private String storeApprovalStatus = "3";
private String storeCode;
}
......@@ -79,7 +79,8 @@ public class EmployeeActivityPlanInfoDto implements Serializable {
* 店铺名称
*/
private String storeName;
private String qinceStoreCode;
private String qinceStoreName;
/**
* 活动模式
*/
......
......@@ -34,6 +34,7 @@ public class ActivityPlanInfoVo {
private Integer employeeId;
private String storeName;
private String qinceStoreCode;
/**
* 活动计划表上传记录id
......
package com.wangxiaolu.promotion.service.activity.manage.impl;
import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.domain.manage.dao.EmployeeActivityPlanInfoDao;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.domain.user.dao.QinCeClienteleStoreDao;
import com.wangxiaolu.promotion.domain.user.wrapperQo.StoreWrapper;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.activity.manage.dto.EmployeeActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo;
import com.wangxiaolu.promotion.pojo.user.dto.QinCeClienteleStoreDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.manage.ActivityPlanInfoCoreService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -24,6 +28,8 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ
@Autowired
EmployeeActivityPlanInfoDao employeeActivityPlanInfoDao;
@Autowired
QinCeClienteleStoreDao qinCeClienteleStoreDao;
@Override
public void updateActivityInfo(ActivityPlanInfoVo activityPlanInfoVo) {
......@@ -36,7 +42,22 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ
@Override
public void save(ActivityPlanInfoVo activityPlanInfoVo) {
EmployeeActivityPlanInfoDto dto = new EmployeeActivityPlanInfoDto();
BeanUtils.copyProperties(activityPlanInfoVo,dto);
BeanUtils.copyProperties(activityPlanInfoVo, dto);
// 无终端编码直接保存
if (StringUtils.isBlank(activityPlanInfoVo.getQinceStoreCode())) {
employeeActivityPlanInfoDao.saveList(Arrays.asList(dto));
return;
}
// 有终端编码需要验证准确性且补充门店名称
StoreWrapper storeWrap = new StoreWrapper()
.setStoreCode(activityPlanInfoVo.getQinceStoreCode());
QinCeClienteleStoreDto qcStore = qinCeClienteleStoreDao.getOneStore(storeWrap);
if (Objects.isNull(qcStore)) {
throw new ParamException(RCode.QINCE_STORE_CODE_ERROR);
}
dto.setQinceStoreName(qcStore.getStoreName());
employeeActivityPlanInfoDao.saveList(Arrays.asList(dto));
}
}
......@@ -38,12 +38,12 @@
<insert id="saveList">
insert into employee_activity_plan_info (activity_plan_record_id, excel_filed_id, employee_id, employee_name,
employee_no, city, dealer_id, dealer_name, line_name,
store_name, activity_pattern, activity_pattern_id)
store_name, activity_pattern, activity_pattern_id,qince_store_code,qince_store_name)
values
<foreach collection="dos" item="item" separator=",">
(#{item.activityPlanRecordId},#{item.excelFiledId},#{item.employeeId},#{item.employeeName},
#{item.employeeNo},#{item.city},#{item.dealerId},#{item.dealerName},#{item.lineName},
#{item.storeName},#{item.activityPattern},#{item.activityPatternId})
#{item.storeName},#{item.activityPattern},#{item.activityPatternId},#{item.qinceStoreCode},#{item.qinceStoreName})
</foreach>
</insert>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论