提交 89e44201 authored 作者: 李秋林's avatar 李秋林

促销员打卡图片移动到TemporaryActivityPhoto表中

上级 18cc318f
...@@ -62,7 +62,7 @@ public class TemporaryActivityCoreController { ...@@ -62,7 +62,7 @@ public class TemporaryActivityCoreController {
} else if (ClockType.TEMPORARY_CLOCK_OUT.equals(clockType)) { } else if (ClockType.TEMPORARY_CLOCK_OUT.equals(clockType)) {
builderClockOutData(clockVo, dto, clockTime); builderClockOutData(clockVo, dto, clockTime);
} }
tempActivityCoreService.clockInTodayActivity(dto); tempActivityCoreService.clockInTodayActivity(dto, clockType);
} }
/** /**
...@@ -100,7 +100,6 @@ public class TemporaryActivityCoreController { ...@@ -100,7 +100,6 @@ public class TemporaryActivityCoreController {
.setClockInAddress(clockVo.getClockAddress()) .setClockInAddress(clockVo.getClockAddress())
.setClockInCoordinates(clockVo.getClockCoordinates()) .setClockInCoordinates(clockVo.getClockCoordinates())
.setClockInPhoto(clockVo.getClockPhoto()) .setClockInPhoto(clockVo.getClockPhoto())
.setClockInPhotoFieldId(clockVo.getClockPhotoFieldId())
.setClockInTime(dateTime); .setClockInTime(dateTime);
} }
...@@ -113,7 +112,6 @@ public class TemporaryActivityCoreController { ...@@ -113,7 +112,6 @@ public class TemporaryActivityCoreController {
.setNoonClockOutAddress(clockVo.getClockAddress()) .setNoonClockOutAddress(clockVo.getClockAddress())
.setNoonClockOutCoordinates(clockVo.getClockCoordinates()) .setNoonClockOutCoordinates(clockVo.getClockCoordinates())
.setNoonClockOutPhoto(clockVo.getClockPhoto()) .setNoonClockOutPhoto(clockVo.getClockPhoto())
.setNoonClockOutPhotoFieldId(clockVo.getClockPhotoFieldId())
.setNoonClockOutTime(dateTime); .setNoonClockOutTime(dateTime);
} }
...@@ -127,7 +125,6 @@ public class TemporaryActivityCoreController { ...@@ -127,7 +125,6 @@ public class TemporaryActivityCoreController {
.setNoonClockInAddress(clockVo.getClockAddress()) .setNoonClockInAddress(clockVo.getClockAddress())
.setNoonClockInCoordinates(clockVo.getClockCoordinates()) .setNoonClockInCoordinates(clockVo.getClockCoordinates())
.setNoonClockInPhoto(clockVo.getClockPhoto()) .setNoonClockInPhoto(clockVo.getClockPhoto())
.setNoonClockInPhotoFieldId(clockVo.getClockPhotoFieldId())
.setNoonClockInTime(dateTime); .setNoonClockInTime(dateTime);
} }
...@@ -140,7 +137,6 @@ public class TemporaryActivityCoreController { ...@@ -140,7 +137,6 @@ public class TemporaryActivityCoreController {
.setClockOutAddress(clockVo.getClockAddress()) .setClockOutAddress(clockVo.getClockAddress())
.setClockOutCoordinates(clockVo.getClockCoordinates()) .setClockOutCoordinates(clockVo.getClockCoordinates())
.setClockOutPhoto(clockVo.getClockPhoto()) .setClockOutPhoto(clockVo.getClockPhoto())
.setClockOutPhotoFieldId(clockVo.getClockPhotoFieldId())
.setClockOutTime(dateTime); .setClockOutTime(dateTime);
} }
......
...@@ -13,11 +13,17 @@ public interface TemporaryActivityPhotoDao { ...@@ -13,11 +13,17 @@ public interface TemporaryActivityPhotoDao {
/** /**
* 保存活动上报照片list * 保存活动上报照片list
*/ */
void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls);
void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls); void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls);
/**
* 保存促销员上下班打卡图片
*/
void saveClockPhoto(Integer temporaryId, Long clockId, Integer photoType, String url);
/** /**
* 根据促销员id-活动上报id查询图片 * 根据促销员id-活动上报id查询图片
*/ */
Map<Integer, List<String>> findReportedGroup(Integer temporaryId, Long reportedId); Map<Integer, List<String>> findReportedGroup(Integer temporaryId, Long reportedId);
Map<Integer, String> findClockPhotoGroupByClockId(Long clockId);
} }
...@@ -34,7 +34,7 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao ...@@ -34,7 +34,7 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao
.setCreateDate(DateUtil.today()); .setCreateDate(DateUtil.today());
LambdaQueryWrapper<TemporaryActivityClockDO> qw = buildWrapper(tcw); LambdaQueryWrapper<TemporaryActivityClockDO> qw = buildWrapper(tcw);
Integer count = temporaryActivityClockMapper.selectCount(qw); Integer count = temporaryActivityClockMapper.selectCount(qw);
if (count > 0){ if (count > 0) {
return; return;
} }
...@@ -42,6 +42,7 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao ...@@ -42,6 +42,7 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao
BeanUtils.copyProperties(dto, clockDo); BeanUtils.copyProperties(dto, clockDo);
clockDo.setCreateDate(DateUtil.today()); clockDo.setCreateDate(DateUtil.today());
temporaryActivityClockMapper.insert(clockDo); temporaryActivityClockMapper.insert(clockDo);
dto.setId(clockDo.getId());
} }
@Override @Override
......
...@@ -27,16 +27,6 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao ...@@ -27,16 +27,6 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
@Autowired @Autowired
TemporaryActivityPhotoMapper temporaryActivityPhotoMapper; TemporaryActivityPhotoMapper temporaryActivityPhotoMapper;
@Override
public void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls) {
for (String photoUrl : urls) {
String[] photoArr = photoUrl.split("/");
TemporaryActivityPhotoDO photoDo = new TemporaryActivityPhotoDO();
photoDo.setTemporaryId(temporaryId).setReportedId(reportedId).setType(photoType).setPhotoUrl(photoUrl).setPhotoFiledId(photoArr[photoArr.length - 1]);
temporaryActivityPhotoMapper.insert(photoDo);
}
}
@Override @Override
public void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls) { public void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls) {
if (CollectionUtils.isEmpty(changeUrls)) { if (CollectionUtils.isEmpty(changeUrls)) {
...@@ -72,6 +62,21 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao ...@@ -72,6 +62,21 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
} }
} }
/**
* 保存促销员上下班打卡图片
*/
@Override
public void saveClockPhoto(Integer temporaryId, Long clockId, Integer photoType, String url) {
String[] photoArr = url.split("/");
String photoFiledId = photoArr[photoArr.length - 1];
TemporaryActivityPhotoDO photoDo = new TemporaryActivityPhotoDO();
photoDo.setTemporaryId(temporaryId).setClockId(clockId).setType(photoType).setPhotoUrl(url).setPhotoFiledId(photoFiledId);
temporaryActivityPhotoMapper.insert(photoDo);
log.info("保存促销员打卡图片:{}", photoDo);
}
/** /**
* 活动上报图片查询 * 活动上报图片查询
* *
...@@ -89,4 +94,19 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao ...@@ -89,4 +94,19 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
Map<Integer, List<String>> groupPhoto = dos.stream().collect(Collectors.groupingBy(TemporaryActivityPhotoDO::getType, Collectors.mapping(TemporaryActivityPhotoDO::getPhotoUrl, Collectors.toList()))); Map<Integer, List<String>> groupPhoto = dos.stream().collect(Collectors.groupingBy(TemporaryActivityPhotoDO::getType, Collectors.mapping(TemporaryActivityPhotoDO::getPhotoUrl, Collectors.toList())));
return groupPhoto; return groupPhoto;
} }
/**
* 根据打卡ID查询图片,根据业务类型进行分组
*
* @param clockId 打卡ID
* @return 分组结果
*/
@Override
public Map<Integer, String> findClockPhotoGroupByClockId(Long clockId) {
LambdaQueryWrapper<TemporaryActivityPhotoDO> wq = new LambdaQueryWrapper<>();
wq.eq(TemporaryActivityPhotoDO::getClockId, clockId).eq(TemporaryActivityPhotoDO::getIsDelete, 1);
List<TemporaryActivityPhotoDO> dos = temporaryActivityPhotoMapper.selectList(wq);
Map<Integer, String> map = dos.stream().collect(Collectors.toMap(TemporaryActivityPhotoDO::getType, TemporaryActivityPhotoDO::getPhotoUrl));
return map;
}
} }
...@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; ...@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
...@@ -88,6 +89,7 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport ...@@ -88,6 +89,7 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport
public void updateById(TemporaryActivityReportedDto temActDto) { public void updateById(TemporaryActivityReportedDto temActDto) {
TemporaryActivityReportedDO rDo = new TemporaryActivityReportedDO(); TemporaryActivityReportedDO rDo = new TemporaryActivityReportedDO();
BeanUtils.copyProperties(temActDto,rDo); BeanUtils.copyProperties(temActDto,rDo);
rDo.setModifyTime(new Date());
temporaryActivityReportedMapper.updateById(rDo); temporaryActivityReportedMapper.updateById(rDo);
} }
......
...@@ -51,16 +51,6 @@ public class TemporaryActivityClockDO implements Serializable { ...@@ -51,16 +51,6 @@ public class TemporaryActivityClockDO implements Serializable {
*/ */
private String clockInCoordinates; private String clockInCoordinates;
/**
* 上班打卡图片
*/
private String clockInPhoto;
/**
* 上班打卡图片
*/
private String clockInPhotoFieldId;
/** /**
* 上班打卡时间 * 上班打卡时间
*/ */
...@@ -76,16 +66,6 @@ public class TemporaryActivityClockDO implements Serializable { ...@@ -76,16 +66,6 @@ public class TemporaryActivityClockDO implements Serializable {
*/ */
private String noonClockOutCoordinates; private String noonClockOutCoordinates;
/**
* 午休下班打卡图片
*/
private String noonClockOutPhoto;
/**
* 午休下班打卡图片
*/
private String noonClockOutPhotoFieldId;
/** /**
* 午休下班打卡时间 * 午休下班打卡时间
*/ */
...@@ -101,16 +81,6 @@ public class TemporaryActivityClockDO implements Serializable { ...@@ -101,16 +81,6 @@ public class TemporaryActivityClockDO implements Serializable {
*/ */
private String noonClockInCoordinates; private String noonClockInCoordinates;
/**
* 午休上班打卡图片
*/
private String noonClockInPhoto;
/**
* 午休上班打卡图片
*/
private String noonClockInPhotoFieldId;
/** /**
* 午休上班打卡时间 * 午休上班打卡时间
*/ */
...@@ -126,16 +96,6 @@ public class TemporaryActivityClockDO implements Serializable { ...@@ -126,16 +96,6 @@ public class TemporaryActivityClockDO implements Serializable {
*/ */
private String clockOutCoordinates; private String clockOutCoordinates;
/**
* 下班打卡图片
*/
private String clockOutPhoto;
/**
* 下班打卡图片
*/
private String clockOutPhotoFieldId;
/** /**
* 下班打卡时间 * 下班打卡时间
*/ */
......
...@@ -32,6 +32,11 @@ public class TemporaryActivityPhotoDO implements Serializable { ...@@ -32,6 +32,11 @@ public class TemporaryActivityPhotoDO implements Serializable {
*/ */
private Long reportedId; private Long reportedId;
/**
* 促销员上班打卡记录ID,关联temporary_activity_clock表主键ID
*/
private Long clockId;
/** /**
* 图片所属类别:1:推广试吃;2…… * 图片所属类别:1:推广试吃;2……
*/ */
......
...@@ -14,15 +14,31 @@ public enum ActivityPhotoType { ...@@ -14,15 +14,31 @@ public enum ActivityPhotoType {
/** /**
* 推广试吃照片 * 推广试吃照片
*/ */
tgsc(1), TGSC(1),
/** /**
* 推广互动照片 * 推广互动照片
*/ */
tghd(2), TGHD(2),
/** /**
* 推广成交照片 * 推广成交照片
*/ */
tgcj(3), TGCJ(3),
/**
* 上班打卡图片
*/
CLOCK_IN(4),
/**
* 午休下班打卡图片
*/
NOON_CLOCK_OUT(5),
/**
* 午休上班打卡图片
*/
NOON_CLOCK_IN(6),
/**
* 下班打卡图片
*/
CLOCK_OUT(7),
; ;
private int type; private int type;
......
...@@ -46,8 +46,6 @@ public class TemporaryClockDto { ...@@ -46,8 +46,6 @@ public class TemporaryClockDto {
// 上班打卡图片 // 上班打卡图片
String clockInPhoto; String clockInPhoto;
String clockInPhotoFieldId;
// 上班打卡时间 // 上班打卡时间
Date clockInTime; Date clockInTime;
...@@ -59,7 +57,6 @@ public class TemporaryClockDto { ...@@ -59,7 +57,6 @@ public class TemporaryClockDto {
// 午休下班打卡图片 // 午休下班打卡图片
String noonClockOutPhoto; String noonClockOutPhoto;
String noonClockOutPhotoFieldId;
// 午休下班打卡时间 // 午休下班打卡时间
Date noonClockOutTime; Date noonClockOutTime;
...@@ -72,7 +69,6 @@ public class TemporaryClockDto { ...@@ -72,7 +69,6 @@ public class TemporaryClockDto {
// 午休上班打卡图片 // 午休上班打卡图片
String noonClockInPhoto; String noonClockInPhoto;
String noonClockInPhotoFieldId;
// 午休上班打卡时间 // 午休上班打卡时间
Date noonClockInTime; Date noonClockInTime;
...@@ -85,7 +81,6 @@ public class TemporaryClockDto { ...@@ -85,7 +81,6 @@ public class TemporaryClockDto {
// 下班打卡图片 // 下班打卡图片
String clockOutPhoto; String clockOutPhoto;
String clockOutPhotoFieldId;
// 下班打卡时间 // 下班打卡时间
Date clockOutTime; Date clockOutTime;
......
...@@ -56,7 +56,5 @@ public class TemporaryClockVo { ...@@ -56,7 +56,5 @@ public class TemporaryClockVo {
// 上班打卡图片 // 上班打卡图片
@NotBlank(message = "请上传图片") @NotBlank(message = "请上传图片")
String clockPhoto; String clockPhoto;
@NotBlank(message = "未找到图片")
String clockPhotoFieldId;
} }
...@@ -12,6 +12,7 @@ public interface TemporaryActivityCoreService { ...@@ -12,6 +12,7 @@ public interface TemporaryActivityCoreService {
/** /**
* 活动上报保存 * 活动上报保存
*
* @return 生成id * @return 生成id
*/ */
long activityDataReportedSave(TemporaryActivityReportedDto temActDto); long activityDataReportedSave(TemporaryActivityReportedDto temActDto);
...@@ -19,8 +20,11 @@ public interface TemporaryActivityCoreService { ...@@ -19,8 +20,11 @@ public interface TemporaryActivityCoreService {
/** /**
* 促销员当日打卡信息保存 * 促销员当日打卡信息保存
*/ */
void clockInTodayActivity(TemporaryClockDto dto); void clockInTodayActivity(TemporaryClockDto dto, Integer clockType);
/**
* 活动上报数据修改
*/
void activityDataReportedUpdate(TemporaryActivityReportedDto temActDto); void activityDataReportedUpdate(TemporaryActivityReportedDto temActDto);
} }
...@@ -2,13 +2,18 @@ package com.wangxiaolu.promotion.service.activity.temporary.impl; ...@@ -2,13 +2,18 @@ package com.wangxiaolu.promotion.service.activity.temporary.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao; import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityPhotoDao;
import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryClockWrapper; import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryClockWrapper;
import com.wangxiaolu.promotion.enums.activity.ActivityPhotoType;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService;
import lombok.extern.slf4j.Slf4j; 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.Map;
import java.util.Objects;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-04-23 19 * @date : 2024-04-23 19
...@@ -20,6 +25,8 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity ...@@ -20,6 +25,8 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity
@Autowired @Autowired
TemporaryActivityClockDao temporaryActivityClockDao; TemporaryActivityClockDao temporaryActivityClockDao;
@Autowired
TemporaryActivityPhotoDao temporaryActivityPhotoDao;
@Override @Override
public TemporaryClockDto findTodayTemporaryClockByTemId(Integer temporaryId) { public TemporaryClockDto findTodayTemporaryClockByTemId(Integer temporaryId) {
...@@ -27,8 +34,9 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity ...@@ -27,8 +34,9 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity
TemporaryClockWrapper tcw = new TemporaryClockWrapper() TemporaryClockWrapper tcw = new TemporaryClockWrapper()
.setTemporaryId(temporaryId) .setTemporaryId(temporaryId)
.setCreateDate(today); .setCreateDate(today);
TemporaryClockDto temporaryClockDto = temporaryActivityClockDao.selectOne(tcw);
return temporaryActivityClockDao.selectOne(tcw); findClockPhoto(temporaryClockDto);
return temporaryClockDto;
} }
/** /**
...@@ -39,6 +47,23 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity ...@@ -39,6 +47,23 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity
TemporaryClockWrapper tcw = new TemporaryClockWrapper() TemporaryClockWrapper tcw = new TemporaryClockWrapper()
.setTemporaryId(temporaryId) .setTemporaryId(temporaryId)
.setCreateDate(createDate); .setCreateDate(createDate);
return temporaryActivityClockDao.selectOne(tcw); TemporaryClockDto temporaryClockDto = temporaryActivityClockDao.selectOne(tcw);
findClockPhoto(temporaryClockDto);
return temporaryClockDto;
}
/**
* 查询打卡图片
*/
private void findClockPhoto(TemporaryClockDto temporaryClockDto) {
if (Objects.isNull(temporaryClockDto)) {
return;
}
Map<Integer, String> photoGroup = temporaryActivityPhotoDao.findClockPhotoGroupByClockId(temporaryClockDto.getId());
temporaryClockDto.setClockInPhoto(photoGroup.get(ActivityPhotoType.CLOCK_IN.getType()));
temporaryClockDto.setNoonClockOutPhoto(photoGroup.get(ActivityPhotoType.NOON_CLOCK_OUT.getType()));
temporaryClockDto.setNoonClockInPhoto(photoGroup.get(ActivityPhotoType.NOON_CLOCK_IN.getType()));
temporaryClockDto.setClockOutPhoto(photoGroup.get(ActivityPhotoType.CLOCK_OUT.getType()));
log.info("查询打卡记录{}的所有图片:{}", temporaryClockDto.getId(), photoGroup);
} }
} }
...@@ -6,6 +6,7 @@ import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao ...@@ -6,6 +6,7 @@ import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao
import com.wangxiaolu.promotion.domain.user.dao.QinCeClienteleStoreDao; import com.wangxiaolu.promotion.domain.user.dao.QinCeClienteleStoreDao;
import com.wangxiaolu.promotion.domain.user.wrapperQo.StoreWrapper; import com.wangxiaolu.promotion.domain.user.wrapperQo.StoreWrapper;
import com.wangxiaolu.promotion.enums.activity.ActivityPhotoType; import com.wangxiaolu.promotion.enums.activity.ActivityPhotoType;
import com.wangxiaolu.promotion.enums.activity.ClockType;
import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus; import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus;
import com.wangxiaolu.promotion.exception.FlowException; import com.wangxiaolu.promotion.exception.FlowException;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
...@@ -90,33 +91,56 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -90,33 +91,56 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
* 促销员当日打卡信息保存 * 促销员当日打卡信息保存
*/ */
@Override @Override
public void clockInTodayActivity(TemporaryClockDto dto) { public void clockInTodayActivity(TemporaryClockDto dto, Integer clockType) {
log.info("促销员当日打卡[type-{}]信息保存:{}", clockType, dto.toString());
if (Objects.isNull(dto.getId())) { if (Objects.isNull(dto.getId())) {
temporaryActivityClockDao.save(dto); temporaryActivityClockDao.save(dto);
return; } else {
}
temporaryActivityClockDao.updateById(dto); temporaryActivityClockDao.updateById(dto);
} }
// 根据ID保存图片
saveClockPhoto(dto, clockType);
}
/**
* 推广活动照片保存
*
* @param temActDto 活动提交数据
*/
private void saveActivityPhoto(TemporaryActivityReportedDto temActDto) { private void saveActivityPhoto(TemporaryActivityReportedDto temActDto) {
Integer temporaryId = temActDto.getTemporaryId(); Integer temporaryId = temActDto.getTemporaryId();
Long reportedId = temActDto.getId(); Long reportedId = temActDto.getId();
// 推广试吃照片 // 推广试吃照片
if (!CollectionUtils.isEmpty(temActDto.getTgscPhotoUrls())) { if (!CollectionUtils.isEmpty(temActDto.getTgscPhotoUrls())) {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.tgsc.getType(), temActDto.getTgscPhotoUrls(), temActDto.getTgscChangePhotoUrls()); tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGSC.getType(), temActDto.getTgscPhotoUrls(), temActDto.getTgscChangePhotoUrls());
} }
// 推广互动照片 // 推广互动照片
if (!CollectionUtils.isEmpty(temActDto.getTghdPhotoUrls())) { if (!CollectionUtils.isEmpty(temActDto.getTghdPhotoUrls())) {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.tghd.getType(), temActDto.getTghdPhotoUrls(), temActDto.getTghdChangePhotoUrls()); tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGHD.getType(), temActDto.getTghdPhotoUrls(), temActDto.getTghdChangePhotoUrls());
} }
// 推广成交照片 // 推广成交照片
if (!CollectionUtils.isEmpty(temActDto.getTgcjPhotoUrls())) { if (!CollectionUtils.isEmpty(temActDto.getTgcjPhotoUrls())) {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.tgcj.getType(), temActDto.getTgcjPhotoUrls(), temActDto.getTgcjChangePhotoUrls()); tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGCJ.getType(), temActDto.getTgcjPhotoUrls(), temActDto.getTgcjChangePhotoUrls());
} }
log.info("促销员今日活动上报-图片保存成功,关联活动上报数据id[{}],数据信息:{}", temActDto.getId(), temActDto); log.info("促销员今日活动上报-图片保存成功,关联活动上报数据id[{}],数据信息:{}", temActDto.getId(), temActDto);
} }
/**
* 促销员上班打卡图片保存
*/
private void saveClockPhoto(TemporaryClockDto dto, Integer clockType) {
// 上班卡、午休下班卡、午休上班卡、下班卡
if (ClockType.TEMPORARY_CLOCK_IN.equals(clockType)) {
tempActivityPhotoDao.saveClockPhoto(dto.getTemporaryId(), dto.getId(), ActivityPhotoType.CLOCK_IN.getType(), dto.getClockInPhoto());
} else if (ClockType.TEMPORARY_NOON_CLOCK_OUT.equals(clockType)) {
tempActivityPhotoDao.saveClockPhoto(dto.getTemporaryId(), dto.getId(), ActivityPhotoType.NOON_CLOCK_OUT.getType(), dto.getNoonClockOutPhoto());
} else if (ClockType.TEMPORARY_NOON_CLOCK_IN.equals(clockType)) {
tempActivityPhotoDao.saveClockPhoto(dto.getTemporaryId(), dto.getId(), ActivityPhotoType.NOON_CLOCK_IN.getType(), dto.getNoonClockInPhoto());
} else if (ClockType.TEMPORARY_CLOCK_OUT.equals(clockType)) {
tempActivityPhotoDao.saveClockPhoto(dto.getTemporaryId(), dto.getId(), ActivityPhotoType.CLOCK_OUT.getType(), dto.getClockOutPhoto());
}
}
} }
...@@ -62,9 +62,9 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery ...@@ -62,9 +62,9 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery
} }
Map<Integer, List<String>> reportedGroup = temporaryActivityPhotoDao.findReportedGroup(dto.getTemporaryId(), dto.getId()); Map<Integer, List<String>> reportedGroup = temporaryActivityPhotoDao.findReportedGroup(dto.getTemporaryId(), dto.getId());
if (!CollectionUtils.isEmpty(reportedGroup)) { if (!CollectionUtils.isEmpty(reportedGroup)) {
dto.setTgscPhotoUrls(reportedGroup.get(ActivityPhotoType.tgsc.getType())); dto.setTgscPhotoUrls(reportedGroup.get(ActivityPhotoType.TGSC.getType()));
dto.setTghdPhotoUrls(reportedGroup.get(ActivityPhotoType.tghd.getType())); dto.setTghdPhotoUrls(reportedGroup.get(ActivityPhotoType.TGHD.getType()));
dto.setTgcjPhotoUrls(reportedGroup.get(ActivityPhotoType.tgcj.getType())); dto.setTgcjPhotoUrls(reportedGroup.get(ActivityPhotoType.TGCJ.getType()));
} }
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论