提交 638c2f1a authored 作者: 李秋林's avatar 李秋林

店铺信息前缀统一为:store

上级 db2c9dce
...@@ -65,6 +65,25 @@ public class TemporaryActivityCoreController { ...@@ -65,6 +65,25 @@ public class TemporaryActivityCoreController {
tempActivityCoreService.clockInTodayActivity(dto); tempActivityCoreService.clockInTodayActivity(dto);
} }
/**
* 促销员今日活动上报
* 返回活动生成id
*/
@PostMapping("/today/reported")
public Long todayActivityDataReported(@RequestBody @Validated TemporaryActivityDataVo activityVo) {
TemporaryActivityReportedDto temActDto = new TemporaryActivityReportedDto();
BeanUtils.copyProperties(activityVo, temActDto);
if (Objects.nonNull(activityVo.getActivityReportedId())){
tempActivityCoreService.activityDataReportedUpdate(temActDto);
return activityVo.getActivityReportedId();
}
return tempActivityCoreService.activityDataReportedSave(temActDto);
}
// 上班打卡 // 上班打卡
private void builderClockInData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) { private void builderClockInData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) {
// todo if (!DateUtils.parseTime(new Date(), ClockType.TEMPORARY_CLOCK_IN_BEGIN_TIME, ClockType.TEMPORARY_CLOCK_IN_END_TIME)) { // todo if (!DateUtils.parseTime(new Date(), ClockType.TEMPORARY_CLOCK_IN_BEGIN_TIME, ClockType.TEMPORARY_CLOCK_IN_END_TIME)) {
...@@ -123,16 +142,4 @@ public class TemporaryActivityCoreController { ...@@ -123,16 +142,4 @@ public class TemporaryActivityCoreController {
} }
/**
* 促销员今日活动上报
* 返回活动生成id
*/
@PostMapping("/today/reported")
public Long todayActivityDataReported(@RequestBody @Validated TemporaryActivityDataVo activityVo) {
TemporaryActivityReportedDto temActDto = new TemporaryActivityReportedDto();
BeanUtils.copyProperties(activityVo, temActDto);
return tempActivityCoreService.activityDataReportedSave(temActDto);
}
} }
...@@ -11,11 +11,28 @@ import java.util.List; ...@@ -11,11 +11,28 @@ import java.util.List;
* @describe : * @describe :
*/ */
public interface TemporaryActivityReportedDao { public interface TemporaryActivityReportedDao {
/**
* 新增并返回id
*/
long activityDataSave(TemporaryActivityReportedDto temActDto); long activityDataSave(TemporaryActivityReportedDto temActDto);
/**
* 分页查询促销员任务列表
*/
void findListByTemporaryId(Long temporaryId, PageInfo pageInfo); void findListByTemporaryId(Long temporaryId, PageInfo pageInfo);
/**
* 查询当日任务
*/
TemporaryActivityReportedDto findOneByCurrentDate(Long temporaryId); TemporaryActivityReportedDto findOneByCurrentDate(Long temporaryId);
TemporaryActivityReportedDto findTemporaryActivityById(Long activityId); /**
* 根据ID查询
*/
TemporaryActivityReportedDto findOneById(Long id);
/**
* 根据ID修改
*/
void updateById(TemporaryActivityReportedDto temActDto);
} }
...@@ -80,11 +80,18 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport ...@@ -80,11 +80,18 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport
} }
@Override @Override
public TemporaryActivityReportedDto findTemporaryActivityById(Long activityId) { public TemporaryActivityReportedDto findOneById(Long id) {
TemporaryActivityReportedDO temDO = temporaryActivityReportedMapper.selectById(activityId); TemporaryActivityReportedDO temDO = temporaryActivityReportedMapper.selectById(id);
return transitionDto(temDO); return transitionDto(temDO);
} }
@Override
public void updateById(TemporaryActivityReportedDto temActDto) {
TemporaryActivityReportedDO rDo = new TemporaryActivityReportedDO();
BeanUtils.copyProperties(temActDto,rDo);
temporaryActivityReportedMapper.updateById(rDo);
}
private LambdaQueryWrapper<TemporaryActivityReportedDO> buildQueryList(TemporaryActivityWrapper tw) { private LambdaQueryWrapper<TemporaryActivityReportedDO> buildQueryList(TemporaryActivityWrapper tw) {
LambdaQueryWrapper<TemporaryActivityReportedDO> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TemporaryActivityReportedDO> queryWrapper = new LambdaQueryWrapper<>();
......
...@@ -35,17 +35,17 @@ public class TemporaryActivityReportedDO implements Serializable { ...@@ -35,17 +35,17 @@ public class TemporaryActivityReportedDO implements Serializable {
/** /**
* 关联—活动店铺id * 关联—活动店铺id
*/ */
private Long shopId; private String storeQcId;
/** /**
* 关联—活动店铺名称(例:小美超市) * 关联—活动店铺名称(例:小美超市)
*/ */
private String shopName; private String storeName;
/** /**
* 关联—活动店铺地址(例:小美超市 * 关联—活动店铺地址(例:北京朝阳北路31号1层
*/ */
private String shopAddress; private String storeAddr;
/** /**
* 关联—审核人员id * 关联—审核人员id
......
...@@ -20,4 +20,6 @@ public interface QinCeClienteleStoreDao { ...@@ -20,4 +20,6 @@ public interface QinCeClienteleStoreDao {
List<QinCeClienteleStoreDto> getStoreList(StoreWrapper storeWrapper); List<QinCeClienteleStoreDto> getStoreList(StoreWrapper storeWrapper);
QinCeClienteleStoreDto getOneStore(StoreWrapper storeWrapper);
} }
...@@ -73,6 +73,18 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao { ...@@ -73,6 +73,18 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
return storeDtos; return storeDtos;
} }
@Override
public QinCeClienteleStoreDto getOneStore(StoreWrapper storeWrapper) {
LambdaQueryWrapper<QinCeClienteleStoreDO> qw = builderQueryWrapper(storeWrapper);
// 指定字段查询
qw.select(QinCeClienteleStoreDO::getQcId,
QinCeClienteleStoreDO::getStoreName,
QinCeClienteleStoreDO::getStoreAddr);
QinCeClienteleStoreDO qinCeClienteleStoreDO = qinCeClienteleStoreMapper.selectOne(qw);
return transitionDto(qinCeClienteleStoreDO);
}
private LambdaQueryWrapper<QinCeClienteleStoreDO> builderQueryWrapper(StoreWrapper storeWrapper){ private LambdaQueryWrapper<QinCeClienteleStoreDO> builderQueryWrapper(StoreWrapper storeWrapper){
LambdaQueryWrapper<QinCeClienteleStoreDO> qw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<QinCeClienteleStoreDO> qw = new LambdaQueryWrapper<>();
// 默认查询有效数据 >>> 门店删除状态。0:删除,1:正常:store_status = 1 // 默认查询有效数据 >>> 门店删除状态。0:删除,1:正常:store_status = 1
......
...@@ -36,17 +36,17 @@ public class TemporaryActivityReportedDto { ...@@ -36,17 +36,17 @@ public class TemporaryActivityReportedDto {
/** /**
* 关联—活动店铺id * 关联—活动店铺id
*/ */
private Long shopId; private String storeQcId;
/** /**
* 关联—活动店铺名称(例:小美超市) * 关联—活动店铺名称(例:小美超市)
*/ */
private String shopName; private String storeName;
/** /**
* 关联—活动店铺地址(例:小美超市 * 关联—活动店铺地址(例:北京朝阳北路31号1层
*/ */
private String shopAddress; private String storeAddr;
/** /**
* 关联—审核人员id * 关联—审核人员id
......
...@@ -10,14 +10,18 @@ import javax.validation.constraints.NotNull; ...@@ -10,14 +10,18 @@ import javax.validation.constraints.NotNull;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-04-17 19 * @date : 2024-04-17 19
* @describe : * @describe : 促销员今日活动上报VO
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class TemporaryActivityDataVo { public class TemporaryActivityDataVo {
/**
* 促销员活动上报id
* 关联ID:temporary_activity_reported表id
*/
Long activityReportedId;
/** /**
* 促销员id * 促销员id
* temporaryInfo表id * temporaryInfo表id
...@@ -36,17 +40,6 @@ public class TemporaryActivityDataVo { ...@@ -36,17 +40,6 @@ public class TemporaryActivityDataVo {
* 活动店铺Id * 活动店铺Id
*/ */
@NotNull(message = "活动店铺异常") @NotNull(message = "活动店铺异常")
private Long shopId; private String storeQcId;
/**
* 活动店铺
*/
private String shopName;
/**
* 店铺地址
*/
private String shopAddress;
} }
...@@ -20,4 +20,7 @@ public interface TemporaryActivityCoreService { ...@@ -20,4 +20,7 @@ public interface TemporaryActivityCoreService {
* 促销员当日打卡信息保存 * 促销员当日打卡信息保存
*/ */
void clockInTodayActivity(TemporaryClockDto dto); void clockInTodayActivity(TemporaryClockDto dto);
void activityDataReportedUpdate(TemporaryActivityReportedDto temActDto);
} }
...@@ -2,8 +2,11 @@ package com.wangxiaolu.promotion.service.activity.temporary.impl; ...@@ -2,8 +2,11 @@ package com.wangxiaolu.promotion.service.activity.temporary.impl;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao; import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao; import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao;
import com.wangxiaolu.promotion.domain.user.dao.QinCeClienteleStoreDao;
import com.wangxiaolu.promotion.domain.user.wrapperQo.StoreWrapper;
import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus; import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
import com.wangxiaolu.promotion.pojo.user.dto.QinCeClienteleStoreDto;
import com.wangxiaolu.promotion.pojo.user.dto.TemporaryClockDto; import com.wangxiaolu.promotion.pojo.user.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -21,12 +24,17 @@ import java.util.Objects; ...@@ -21,12 +24,17 @@ import java.util.Objects;
@Slf4j @Slf4j
public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreService { public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreService {
// 活动上报
@Autowired @Autowired
TemporaryActivityReportedDao temporaryActivityReportedDao; TemporaryActivityReportedDao temporaryActivityReportedDao;
// 打卡数据
@Autowired @Autowired
TemporaryActivityClockDao temporaryActivityClockDao; TemporaryActivityClockDao temporaryActivityClockDao;
@Autowired
QinCeClienteleStoreDao qinCeClienteleStoreDao;
/** /**
* 活动上报保存 * 活动上报保存
...@@ -35,6 +43,11 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -35,6 +43,11 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
@Override @Override
public long activityDataReportedSave(TemporaryActivityReportedDto temActDto) { public long activityDataReportedSave(TemporaryActivityReportedDto temActDto) {
temActDto.setApproveStatus(TemActApproveStatus.SUBMITTED); temActDto.setApproveStatus(TemActApproveStatus.SUBMITTED);
// 根据storeQcId查询店铺信息
QinCeClienteleStoreDto storeDto = qinCeClienteleStoreDao.getOneStore(new StoreWrapper().setQcId(temActDto.getStoreQcId()));
temActDto.setStoreName(storeDto.getStoreName()).setStoreAddr(storeDto.getStoreAddr());
return temporaryActivityReportedDao.activityDataSave(temActDto); return temporaryActivityReportedDao.activityDataSave(temActDto);
} }
...@@ -49,4 +62,13 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -49,4 +62,13 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
} }
temporaryActivityClockDao.updateById(dto); temporaryActivityClockDao.updateById(dto);
} }
/**
* 活动信息修改
* 1、判断活动是否可以修改
*/
@Override
public void activityDataReportedUpdate(TemporaryActivityReportedDto temActDto) {
temporaryActivityReportedDao.updateById(temActDto);
}
} }
package com.wangxiaolu.promotion.service.activity.temporary.impl; package com.wangxiaolu.promotion.service.activity.temporary.impl;
import com.alibaba.fastjson.JSONObject;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao; import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao;
import com.wangxiaolu.promotion.pojo.PageInfo; import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
...@@ -9,8 +8,6 @@ import lombok.extern.slf4j.Slf4j; ...@@ -9,8 +8,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-04-18 13 * @date : 2024-04-18 13
...@@ -43,7 +40,7 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery ...@@ -43,7 +40,7 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery
@Override @Override
public TemporaryActivityReportedDto findTemporaryActivityById(Long activityId) { public TemporaryActivityReportedDto findTemporaryActivityById(Long activityId) {
TemporaryActivityReportedDto dto = temporaryActivityReportedDao.findTemporaryActivityById(activityId); TemporaryActivityReportedDto dto = temporaryActivityReportedDao.findOneById(activityId);
return dto; return dto;
} }
} }
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<id property="id" column="id" jdbcType="BIGINT"/> <id property="id" column="id" jdbcType="BIGINT"/>
<result property="temporaryId" column="temporary_id" jdbcType="INTEGER"/> <result property="temporaryId" column="temporary_id" jdbcType="INTEGER"/>
<result property="temporaryName" column="temporary_name" jdbcType="VARCHAR"/> <result property="temporaryName" column="temporary_name" jdbcType="VARCHAR"/>
<result property="shopId" column="shop_id" jdbcType="BIGINT"/> <result property="storeQcId" column="store_qc_id" jdbcType="BIGINT"/>
<result property="shopName" column="shop_name" jdbcType="VARCHAR"/> <result property="storeName" column="store_name" jdbcType="VARCHAR"/>
<result property="shopAddress" column="shop_address" jdbcType="VARCHAR"/> <result property="storeAddr" column="store_addr" jdbcType="VARCHAR"/>
<result property="approverId" column="approver_id" jdbcType="BIGINT"/> <result property="approverId" column="approver_id" jdbcType="BIGINT"/>
<result property="approveName" column="approve_name" jdbcType="VARCHAR"/> <result property="approveName" column="approve_name" jdbcType="VARCHAR"/>
<result property="approveStatus" column="approve_status" jdbcType="VARCHAR"/> <result property="approveStatus" column="approve_status" jdbcType="VARCHAR"/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论