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

促销员[今日活动]数据提交审批并判断是否符合审批条件

上级 fffaa0cf
package com.wangxiaolu.promotion.controller.activity.temporary;
import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
......@@ -11,10 +12,12 @@ import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockCoreService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityQueryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
......@@ -32,7 +35,8 @@ public class TemporaryActivityCoreController {
private TemporaryActivityCoreService tempActivityCoreService;
@Autowired
private TemporaryActivityClockQueryService tempActivityClockQueryService;
@Autowired
private TemporaryActivityQueryService temporaryActivityQueryService;
@Autowired
private TemporaryActivityClockCoreService tempActivityClockCoreService;
......@@ -121,6 +125,18 @@ public class TemporaryActivityCoreController {
*/
@PutMapping("/reported/approve/submit/{id}")
public R activityReportedSubmit(@PathVariable("id") Long id) {
TemporaryActivityReportedDto activityReportedDto = temporaryActivityQueryService.findTemporaryActivityById(id);
if (activityReportedDto.getApproveStatus().equals(TemActApproveStatus.APPROVED)){
return R.success();
}
if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoInfos()) || activityReportedDto.getTgscPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGSH_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoInfos()) || activityReportedDto.getTghdPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGHD_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoInfos()) || activityReportedDto.getTgcjPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGCJ_PHOTO_ERROR);
}
tempActivityCoreService.activityReportedSubmit(id);
return R.success();
}
......
......@@ -84,15 +84,16 @@ public class TemporaryActivityQueryController {
*/
@GetMapping("/today/approved_verify/{id}")
public R findActivityApprovedVerify(@PathVariable("id") Long activityId){
TemporaryActivityReportedDto activityReportedDto = temporaryActivityQueryService.findTemporaryActivityById(activityId);
if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoInfos()) || activityReportedDto.getTgscPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGSH_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoInfos()) || activityReportedDto.getTghdPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGHD_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoInfos()) || activityReportedDto.getTgcjPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGCJ_PHOTO_ERROR);
}
return R.success();
// TemporaryActivityReportedDto activityReportedDto = temporaryActivityQueryService.findTemporaryActivityById(activityId);
//
// if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoInfos()) || activityReportedDto.getTgscPhotoInfos().size() < 4){
// throw new DataException(RCode.NOT_TGSH_PHOTO_ERROR);
// }else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoInfos()) || activityReportedDto.getTghdPhotoInfos().size() < 4){
// throw new DataException(RCode.NOT_TGHD_PHOTO_ERROR);
// }else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoInfos()) || activityReportedDto.getTgcjPhotoInfos().size() < 4){
// throw new DataException(RCode.NOT_TGCJ_PHOTO_ERROR);
// }
// return R.success();
return R.fail();
}
}
......@@ -84,7 +84,6 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
@Override
public List<ActivityPlanInfoDto> findClockList(ActivityPlanInfoWrapper wrapper) {
// LambdaQueryWrapper<ActivityPlanInfoDo> qw = buildWrapper(wrapper);
List<ActivityPlanInfoDo> activityPlanInfoDos = activityPlanInfoMapper.findClockList(wrapper);
return BeanUtils.transitionDtos(activityPlanInfoDos, ActivityPlanInfoDto.class);
}
......
......@@ -131,7 +131,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
temporaryActivityReportedDao.updateById(updateDto);
// 日志保存
tempActivityLogDao.save(reportedDto.getTemporaryId(), reportedDto.getTemporaryName(), LogType.t_3, updateDto.getId(), updateDto);
// tempActivityLogDao.save(reportedDto.getTemporaryId(), reportedDto.getTemporaryName(), LogType.t_3, updateDto.getId(), updateDto);
}
@Override
......@@ -261,6 +261,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
// tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.POS_SELL_VOUCHER.getType(), temActDto.getPsvPhotoUrls());
// }
}
// private void saveActivityPhoto(TemporaryActivityReportedDto temActDto) {
// Integer temporaryId = temActDto.getTemporaryId();
// Long reportedId = temActDto.getId();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论