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

图片展示添加时间

上级 5a7fbbeb
......@@ -2,9 +2,7 @@ package com.wangxiaolu.promotion.controller.activity.temporary;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityMarketCellDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityMarketCellVo;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityQueryService;
......@@ -14,7 +12,6 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Objects;
/**
......@@ -89,23 +86,13 @@ public class TemporaryActivityQueryController {
public R findActivityApprovedVerify(@PathVariable("id") Long activityId){
TemporaryActivityReportedDto activityReportedDto = temporaryActivityQueryService.findTemporaryActivityById(activityId);
if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoUrls()) || activityReportedDto.getTgscPhotoUrls().size() < 4){
if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoInfos()) || activityReportedDto.getTgscPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGSH_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoUrls()) || activityReportedDto.getTghdPhotoUrls().size() < 4){
}else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoInfos()) || activityReportedDto.getTghdPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGHD_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoUrls()) || activityReportedDto.getTgcjPhotoUrls().size() < 4){
}else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoInfos()) || activityReportedDto.getTgcjPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGCJ_PHOTO_ERROR);
}
// else if (CollectionUtils.isEmpty(activityReportedDto.getPsvPhotoUrls())){
// throw new DataException(RCode.NOT_POS_PHOTO_ERROR);
// }
// List<TemporaryActivityMarketCellDto> marketCells = temporaryActivityQueryService.findActivityMarketCellByDb(activityId);
// if (CollectionUtils.isEmpty(marketCells)){
// throw new DataException(RCode.NOT_MARKET_CELL_ERROR);
// }
return R.success();
}
}
......@@ -35,4 +35,6 @@ public interface TemporaryActivityPhotoDao {
void saveClockPhotoByUpdate(Integer temporaryId, Long id, Integer photoType, String url);
Map<Long, Map<Integer, String>> findClockPhotoGroupByClockIds(List<Long> clockIds);
Map<Integer, List<TemporaryActivityPhotoDto>> findReportedInfoGroup(Integer temporaryId, Long reportedId);
}
......@@ -98,6 +98,19 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
return groupClockPhotoMap;
}
@Override
public Map<Integer, List<TemporaryActivityPhotoDto>> findReportedInfoGroup(Integer temporaryId, Long reportedId) {
LambdaQueryWrapper<TemporaryActivityPhotoDO> wq = new LambdaQueryWrapper<>();
wq.eq(TemporaryActivityPhotoDO::getReportedId, reportedId).eq(TemporaryActivityPhotoDO::getIsDelete, StatusType.VALID.getType());
List<TemporaryActivityPhotoDO> dos = temporaryActivityPhotoMapper.selectList(wq);
if (CollectionUtils.isEmpty(dos)) {
return null;
}
List<TemporaryActivityPhotoDto> photoDtos = transitionDtos(dos);
Map<Integer, List<TemporaryActivityPhotoDto>> groupPhoto = photoDtos.stream().collect(Collectors.groupingBy(TemporaryActivityPhotoDto::getType));
return groupPhoto;
}
/**
* 活动上报图片查询
......
......@@ -54,6 +54,7 @@ public class TemporaryActivityClockDO implements Serializable {
* qince_clientele_store表store_name
*/
private String storeName;
private String qinceStoreCode;
private String deptQcId;
......
......@@ -61,10 +61,12 @@ public class TemporaryActivityPhotoDO implements Serializable {
private Integer isDelete;
/**
* 图片的创建时间,只是用来前端显示,所以用varchar不timestamp
* 同一类型下的图片修改时间
*/
private Date updateTime;
private Date createTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -77,7 +77,6 @@ public class EmployeeActivityPlanInfoDO implements Serializable {
*/
private String storeName;
private String qinceStoreCode;
private String qinceStoreName;
/**
* 活动模式
......
......@@ -80,7 +80,6 @@ public class EmployeeActivityPlanInfoDto implements Serializable {
*/
private String storeName;
private String qinceStoreCode;
private String qinceStoreName;
/**
* 活动模式
*/
......
......@@ -59,5 +59,7 @@ public class TemporaryActivityPhotoDto implements Serializable {
*/
private Date updateTime;
private Date createTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -6,7 +6,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
......@@ -109,24 +108,28 @@ public class TemporaryActivityReportedDto {
* 推广试吃照片
*/
List<String> tgscPhotoUrls;
List<TemporaryActivityPhotoDto> tgscPhotoInfos;
List<String> tgscChangePhotoUrls;
/**
* 推广互动照片
*/
List<String> tghdPhotoUrls;
List<TemporaryActivityPhotoDto> tghdPhotoInfos;
List<String> tghdChangePhotoUrls;
/**
* 推广成交照片
*/
List<String> tgcjPhotoUrls;
List<TemporaryActivityPhotoDto> tgcjPhotoInfos;
List<String> tgcjChangePhotoUrls;
/**
* POS机页面凭证
*/
private List<String> psvPhotoUrls;
private List<TemporaryActivityPhotoDto> psvPhotoInfos;
private List<String> psvChangePhotoUrls;
/**
......
......@@ -46,6 +46,7 @@ public class TemporaryClockDto {
* qince_clientele_store表store_name
*/
String storeName;
private String qinceStoreCode;
String deptQcId;
......
......@@ -39,25 +39,20 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ
employeeActivityPlanInfoDao.update(wrap);
}
/**
* 根据终端编码验证门店准确性
*/
@Override
public void save(ActivityPlanInfoVo activityPlanInfoVo) {
EmployeeActivityPlanInfoDto dto = new EmployeeActivityPlanInfoDto();
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)) {
if (Objects.isNull(qcStore) || !qcStore.getStoreName().equals(activityPlanInfoVo.getStoreName())) {
throw new ParamException(RCode.QINCE_STORE_CODE_ERROR);
}
dto.setQinceStoreName(qcStore.getStoreName());
EmployeeActivityPlanInfoDto dto = new EmployeeActivityPlanInfoDto();
BeanUtils.copyProperties(activityPlanInfoVo, dto);
employeeActivityPlanInfoDao.saveList(Arrays.asList(dto));
}
}
......@@ -67,7 +67,8 @@ public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityC
.setChargerName(employeeDto.getName())
.setActivityPatternId(planInfoDto.getActivityPatternId())
.setActivityPattern(planInfoDto.getActivityPattern())
.setDealerName(planInfoDto.getDealerName());
.setDealerName(planInfoDto.getDealerName())
.setQinceStoreCode(planInfoDto.getQinceStoreCode());
temporaryActivityClockDao.save(dto);
} else {
temporaryActivityClockDao.updateById(dto);
......
......@@ -13,6 +13,7 @@ import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryMarketCellWra
import com.wangxiaolu.promotion.enums.activity.ActivityPhotoType;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityMarketCellDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityPhotoDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityQueryService;
import lombok.extern.slf4j.Slf4j;
......@@ -67,7 +68,7 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery
@Override
public TemporaryActivityReportedDto findTemporaryActivityById(Long activityId) {
TemporaryActivityReportedDto dto = temporaryActivityReportedDao.findOneById(activityId);
findActivityReportedPhoto(dto);
findActivityReportedPhotoInfo(dto);
return dto;
}
......@@ -98,4 +99,17 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery
dto.setPsvPhotoUrls(reportedGroup.get(ActivityPhotoType.POS_SELL_VOUCHER.getType()));
}
}
private void findActivityReportedPhotoInfo(TemporaryActivityReportedDto dto) {
if (Objects.isNull(dto)) {
return;
}
Map<Integer, List<TemporaryActivityPhotoDto>> reportedGroup = temporaryActivityPhotoDao.findReportedInfoGroup(dto.getTemporaryId(), dto.getId());
if (!CollectionUtils.isEmpty(reportedGroup)) {
dto.setTgscPhotoInfos(reportedGroup.get(ActivityPhotoType.TGSC.getType()));
dto.setTghdPhotoInfos(reportedGroup.get(ActivityPhotoType.TGHD.getType()));
dto.setTgcjPhotoInfos(reportedGroup.get(ActivityPhotoType.TGCJ.getType()));
dto.setPsvPhotoInfos(reportedGroup.get(ActivityPhotoType.POS_SELL_VOUCHER.getType()));
}
}
}
......@@ -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,qince_store_code,qince_store_name)
store_name, activity_pattern, activity_pattern_id,qince_store_code)
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.qinceStoreCode},#{item.qinceStoreName})
#{item.storeName},#{item.activityPattern},#{item.activityPatternId},#{item.qinceStoreCode})
</foreach>
</insert>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论