提交 ae7da571 authored 作者: 000516's avatar 000516 提交者: Coding

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

后台手动创建终端计划时,添加勤策门店编码
...@@ -151,6 +151,10 @@ public class EmployeeActivityPlanInfoDaoImpl implements EmployeeActivityPlanInfo ...@@ -151,6 +151,10 @@ public class EmployeeActivityPlanInfoDaoImpl implements EmployeeActivityPlanInfo
qw.eq(EmployeeActivityPlanInfoDO::getActivityStatus, wrapper.getActivityStatus().getType()); 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.eq(EmployeeActivityPlanInfoDO::getIsDelete, StatusType.VALID.getType());
qw.orderByDesc(EmployeeActivityPlanInfoDO::getCreateTime); qw.orderByDesc(EmployeeActivityPlanInfoDO::getCreateTime);
return qw; return qw;
......
...@@ -76,6 +76,8 @@ public class EmployeeActivityPlanInfoDO implements Serializable { ...@@ -76,6 +76,8 @@ public class EmployeeActivityPlanInfoDO implements Serializable {
* 店铺名称 * 店铺名称
*/ */
private String storeName; private String storeName;
private String qinceStoreCode;
private String qinceStoreName;
/** /**
* 活动模式 * 活动模式
......
...@@ -60,6 +60,7 @@ public class ActivityPlanInfoWrapper { ...@@ -60,6 +60,7 @@ public class ActivityPlanInfoWrapper {
*/ */
private String storeName; private String storeName;
private String storeNameLike; private String storeNameLike;
private String qinceStoreCode;
/** /**
* 经销商名称 * 经销商名称
......
...@@ -114,6 +114,11 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao { ...@@ -114,6 +114,11 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
qw.eq(QinCeClienteleStoreDO::getQcId, storeWrapper.getQcId()); qw.eq(QinCeClienteleStoreDO::getQcId, storeWrapper.getQcId());
return qw; return qw;
} }
// 按终端编码查询
if (StringUtils.isNotBlank(storeWrapper.getStoreCode())) {
qw.eq(QinCeClienteleStoreDO::getStoreCode, storeWrapper.getStoreCode());
return qw;
}
// 按门店名称模糊查询 // 按门店名称模糊查询
if (StringUtils.isNotBlank(storeWrapper.getStoreNameVague())) { if (StringUtils.isNotBlank(storeWrapper.getStoreNameVague())) {
qw.like(QinCeClienteleStoreDO::getStoreName, storeWrapper.getStoreNameVague().trim()); qw.like(QinCeClienteleStoreDO::getStoreName, storeWrapper.getStoreNameVague().trim());
......
...@@ -29,4 +29,5 @@ public class StoreWrapper { ...@@ -29,4 +29,5 @@ public class StoreWrapper {
*/ */
private String storeStatus = "1"; private String storeStatus = "1";
private String storeApprovalStatus = "3"; private String storeApprovalStatus = "3";
private String storeCode;
} }
...@@ -79,7 +79,8 @@ public class EmployeeActivityPlanInfoDto implements Serializable { ...@@ -79,7 +79,8 @@ public class EmployeeActivityPlanInfoDto implements Serializable {
* 店铺名称 * 店铺名称
*/ */
private String storeName; private String storeName;
private String qinceStoreCode;
private String qinceStoreName;
/** /**
* 活动模式 * 活动模式
*/ */
......
...@@ -34,6 +34,7 @@ public class ActivityPlanInfoVo { ...@@ -34,6 +34,7 @@ public class ActivityPlanInfoVo {
private Integer employeeId; private Integer employeeId;
private String storeName; private String storeName;
private String qinceStoreCode;
/** /**
* 活动计划表上传记录id * 活动计划表上传记录id
......
package com.wangxiaolu.promotion.service.activity.manage.impl; 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.dao.EmployeeActivityPlanInfoDao;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper; 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.dto.EmployeeActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo; 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 com.wangxiaolu.promotion.service.activity.manage.ActivityPlanInfoCoreService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -24,6 +28,8 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ ...@@ -24,6 +28,8 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ
@Autowired @Autowired
EmployeeActivityPlanInfoDao employeeActivityPlanInfoDao; EmployeeActivityPlanInfoDao employeeActivityPlanInfoDao;
@Autowired
QinCeClienteleStoreDao qinCeClienteleStoreDao;
@Override @Override
public void updateActivityInfo(ActivityPlanInfoVo activityPlanInfoVo) { public void updateActivityInfo(ActivityPlanInfoVo activityPlanInfoVo) {
...@@ -36,7 +42,22 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ ...@@ -36,7 +42,22 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ
@Override @Override
public void save(ActivityPlanInfoVo activityPlanInfoVo) { public void save(ActivityPlanInfoVo activityPlanInfoVo) {
EmployeeActivityPlanInfoDto dto = new EmployeeActivityPlanInfoDto(); 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)); employeeActivityPlanInfoDao.saveList(Arrays.asList(dto));
} }
} }
...@@ -38,12 +38,12 @@ ...@@ -38,12 +38,12 @@
<insert id="saveList"> <insert id="saveList">
insert into employee_activity_plan_info (activity_plan_record_id, excel_filed_id, employee_id, employee_name, 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, 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 values
<foreach collection="dos" item="item" separator=","> <foreach collection="dos" item="item" separator=",">
(#{item.activityPlanRecordId},#{item.excelFiledId},#{item.employeeId},#{item.employeeName}, (#{item.activityPlanRecordId},#{item.excelFiledId},#{item.employeeId},#{item.employeeName},
#{item.employeeNo},#{item.city},#{item.dealerId},#{item.dealerName},#{item.lineName}, #{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> </foreach>
</insert> </insert>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论