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

图片展示添加时间

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