提交 9e9ed6bf authored 作者: 000516's avatar 000516

创建计划/修改计划新增午休时间段(上班时间<午休下班时间<午休上班时间<下班时间),试吃台,活动品项;删除工资,杂费

...@@ -196,6 +196,20 @@ public class PromPlanCoreController { ...@@ -196,6 +196,20 @@ public class PromPlanCoreController {
operVo.setClockInTime(LocalDateTime.of(localDate,operVo.getInTime())); operVo.setClockInTime(LocalDateTime.of(localDate,operVo.getInTime()));
operVo.setClockOutTime(LocalDateTime.of(localDate,operVo.getOutTime())); operVo.setClockOutTime(LocalDateTime.of(localDate,operVo.getOutTime()));
if (operVo.getNoonOutTime() == null && operVo.getNoonInTime() == null){
promPlanCoreService.saveActivityPlan(operVo);
return R.success();
}
LocalDateTime noonClockOutTime = LocalDateTime.of(localDate,operVo.getNoonOutTime());
LocalDateTime noonClockinTime = LocalDateTime.of(localDate,operVo.getNoonInTime());
if (operVo.getClockInTime().isBefore(noonClockOutTime) && noonClockOutTime.isBefore(noonClockinTime) && noonClockinTime.isBefore(operVo.getClockOutTime())) {
operVo.setNoonClockOutTime(noonClockOutTime);
operVo.setNoonClockInTime(noonClockinTime);
}else {
throw new ParamException(RCode.ACTIVITY_PLAN_DATETIME_ERROR);
}
promPlanCoreService.saveActivityPlan(operVo); promPlanCoreService.saveActivityPlan(operVo);
return R.success(); return R.success();
} }
...@@ -213,6 +227,20 @@ public class PromPlanCoreController { ...@@ -213,6 +227,20 @@ public class PromPlanCoreController {
operVo.setClockInTime(LocalDateTime.of(localDate,operVo.getInTime())); operVo.setClockInTime(LocalDateTime.of(localDate,operVo.getInTime()));
operVo.setClockOutTime(LocalDateTime.of(localDate,operVo.getOutTime())); operVo.setClockOutTime(LocalDateTime.of(localDate,operVo.getOutTime()));
if (operVo.getNoonOutTime() == null && operVo.getNoonInTime() == null){
promPlanCoreService.putActivityPlan(operVo);
return R.success();
}
LocalDateTime noonClockOutTime = LocalDateTime.of(localDate,operVo.getNoonOutTime());
LocalDateTime noonClockinTime = LocalDateTime.of(localDate,operVo.getNoonInTime());
if (operVo.getClockInTime().isBefore(noonClockOutTime) && noonClockOutTime.isBefore(noonClockinTime) && noonClockinTime.isBefore(operVo.getClockOutTime())) {
operVo.setNoonClockOutTime(noonClockOutTime);
operVo.setNoonClockInTime(noonClockinTime);
}else {
throw new ParamException(RCode.ACTIVITY_PLAN_DATETIME_ERROR);
}
promPlanCoreService.putActivityPlan(operVo); promPlanCoreService.putActivityPlan(operVo);
return R.success(); return R.success();
} }
......
...@@ -69,11 +69,6 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao { ...@@ -69,11 +69,6 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
@Override @Override
public void updateById(ActivityPlanInfoDto planDto) { public void updateById(ActivityPlanInfoDto planDto) {
// 判断计划是否存在
// ActivityPlanInfoDo activityPlanInfoDo = activityPlanInfoMapper.selectPlan(planDto.getStoreCode(), planDto.getDate());
// if (Objects.isNull(activityPlanInfoDo)){
// throw new DataException(RCode.ACTIVITY_PLAN_IS_NULL);
// }
ActivityPlanInfoDo planDo = BeanUtils.transitionDto(planDto, ActivityPlanInfoDo.class); ActivityPlanInfoDo planDo = BeanUtils.transitionDto(planDto, ActivityPlanInfoDo.class);
activityPlanInfoMapper.updateById(planDo); activityPlanInfoMapper.updateById(planDo);
} }
......
package com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity; package com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -135,11 +133,16 @@ public class ActivityPlanInfoDo implements Serializable { ...@@ -135,11 +133,16 @@ public class ActivityPlanInfoDo implements Serializable {
/** /**
* 午休下班时间 * 午休下班时间
* 强制更新,即使为null
*/ */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime noonClockOutTime; private LocalDateTime noonClockOutTime;
/** /**
* 午休上班时间 * 午休上班时间
* 强制更新,即使为null
*/ */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime noonClockInTime; private LocalDateTime noonClockInTime;
/** /**
......
...@@ -67,14 +67,25 @@ public class ActivityPlanOperVo { ...@@ -67,14 +67,25 @@ public class ActivityPlanOperVo {
private LocalTime outTime; private LocalTime outTime;
private LocalDateTime clockOutTime; private LocalDateTime clockOutTime;
/**
* 午休下班时间
*/
private LocalTime noonOutTime;
private LocalDateTime noonClockOutTime;
/** /**
* 工资 * 午休上班时间
*/ */
// private BigDecimal salary; private LocalTime noonInTime;
private LocalDateTime noonClockInTime;
/** /**
* 杂费 * 是否有试吃台
*/
private String temWlSct;
/**
* 活动品项:老品/黑鸭/散称
*/ */
// private BigDecimal incidentals; private String prdClass;
private List<Long> planIds; private List<Long> planIds;
} }
...@@ -555,14 +555,14 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService { ...@@ -555,14 +555,14 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
throw new FlowException(RCode.ACTIVITY_PLAN_NOT_DELETE); throw new FlowException(RCode.ACTIVITY_PLAN_NOT_DELETE);
} }
// 判断修改后 月底 >= 活动日期 > 今日 //todo 判断修改后 月底 >= 活动日期 > 今日
LocalDate today = LocalDate.now(); // LocalDate today = LocalDate.now();
Date planDate = operVo.getDate(); Date planDate = operVo.getDate();
LocalDate localDatePlan = DateUtils.parseDateBylocalDate(planDate); // LocalDate localDatePlan = DateUtils.parseDateBylocalDate(planDate);
LocalDate lastDayOfMonth = today.with(TemporalAdjusters.lastDayOfMonth()); // LocalDate lastDayOfMonth = today.with(TemporalAdjusters.lastDayOfMonth());
if (!localDatePlan.isAfter(today) || localDatePlan.isAfter(lastDayOfMonth)){ // if (!localDatePlan.isAfter(today) || localDatePlan.isAfter(lastDayOfMonth)){
throw new FlowException(RCode.ACTIVITY_PLAN_DATA_ERROR); // throw new FlowException(RCode.ACTIVITY_PLAN_DATA_ERROR);
} // }
ActivityPlanInfoDto planDto = new ActivityPlanInfoDto(); ActivityPlanInfoDto planDto = new ActivityPlanInfoDto();
// 归属人改变 // 归属人改变
...@@ -596,6 +596,10 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService { ...@@ -596,6 +596,10 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
.setPattern(operVo.getPattern()) .setPattern(operVo.getPattern())
.setClockInTime(operVo.getClockInTime()) .setClockInTime(operVo.getClockInTime())
.setClockOutTime(operVo.getClockOutTime()) .setClockOutTime(operVo.getClockOutTime())
.setNoonClockOutTime(operVo.getNoonClockOutTime())
.setNoonClockInTime(operVo.getNoonClockInTime())
.setTemWlSct(operVo.getTemWlSct())
.setPrdClass(operVo.getPrdClass())
.setModifyBy(operVo.getOperName()); .setModifyBy(operVo.getOperName());
activityPlanInfoDao.updateById(planDto); activityPlanInfoDao.updateById(planDto);
} }
...@@ -628,6 +632,10 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService { ...@@ -628,6 +632,10 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
.setAddr(storeDto.getStoreAddr()) .setAddr(storeDto.getStoreAddr())
.setClockInTime(operVo.getClockInTime()) .setClockInTime(operVo.getClockInTime())
.setClockOutTime(operVo.getClockOutTime()) .setClockOutTime(operVo.getClockOutTime())
.setNoonClockOutTime(operVo.getNoonClockOutTime())
.setNoonClockInTime(operVo.getNoonClockInTime())
.setTemWlSct(operVo.getTemWlSct())
.setPrdClass(operVo.getPrdClass())
.setCreateBy(operVo.getOperName()); .setCreateBy(operVo.getOperName());
activityPlanInfoDao.save(planDto); activityPlanInfoDao.save(planDto);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论