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

员工上报、打卡记录、修改活动模式

上级 dded35b9
package com.wangxiaolu.promotion.controller.activity.manage.activityplan; package com.wangxiaolu.promotion.controller.activity.manage.activityplan;
import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.NumberUtils; import com.wangxiaolu.promotion.common.util.NumberUtils;
import com.wangxiaolu.promotion.exception.DataException; import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo;
...@@ -11,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -11,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Objects;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-09-02 18 * @date : 2024-09-02 18
...@@ -23,12 +27,18 @@ public class ActivityPlanInfoCoreController { ...@@ -23,12 +27,18 @@ public class ActivityPlanInfoCoreController {
@Autowired @Autowired
ActivityPlanInfoCoreService activityPlanInfoCoreService; ActivityPlanInfoCoreService activityPlanInfoCoreService;
@Autowired
private RedisCache redisCache;
@PutMapping("/update") @PutMapping("/update")
public R updateActivityInfo(@RequestBody ActivityPlanInfoVo activityPlanInfoVo){ public R updateActivityInfo(@RequestBody ActivityPlanInfoVo activityPlanInfoVo){
if (NumberUtils.isNull(activityPlanInfoVo.getId()) && CollectionUtils.isEmpty(activityPlanInfoVo.getIds())){ if (NumberUtils.isNull(activityPlanInfoVo.getId()) && CollectionUtils.isEmpty(activityPlanInfoVo.getIds())){
throw new DataException(RCode.SELECT_PARAMS_ERROR); throw new DataException(RCode.SELECT_PARAMS_ERROR);
} }
if (Objects.nonNull(activityPlanInfoVo.getActivityPatternId())) {
activityPlanInfoVo.setActivityPattern(redisCache.getHash(RedisKeys.TemporaryKeys.TENOIRART_ACTIVITY_PATTERN.getKey(),
String.valueOf(activityPlanInfoVo.getActivityPatternId())));
}
activityPlanInfoCoreService.updateActivityInfo(activityPlanInfoVo); activityPlanInfoCoreService.updateActivityInfo(activityPlanInfoVo);
return R.success(); return R.success();
} }
......
package com.wangxiaolu.promotion.controller.activity.manage.tem; package com.wangxiaolu.promotion.controller.activity.manage.tem;
import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ClockVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ClockVo;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
...@@ -20,6 +22,8 @@ public class EmployeeCoreTemClockController { ...@@ -20,6 +22,8 @@ public class EmployeeCoreTemClockController {
@Autowired @Autowired
EmployeeCoreTemClockService employeeCoreTemClockService; EmployeeCoreTemClockService employeeCoreTemClockService;
@Autowired
private RedisCache redisCache;
// 修改员工打卡形式 // 修改员工打卡形式
@PutMapping("/update") @PutMapping("/update")
...@@ -27,8 +31,8 @@ public class EmployeeCoreTemClockController { ...@@ -27,8 +31,8 @@ public class EmployeeCoreTemClockController {
TemporaryClockDto temporaryClockDto = new TemporaryClockDto(); TemporaryClockDto temporaryClockDto = new TemporaryClockDto();
temporaryClockDto.setId(clockVo.getId()) temporaryClockDto.setId(clockVo.getId())
.setActivityPatternId(clockVo.getActivityPatternId()) .setActivityPatternId(clockVo.getActivityPatternId())
.setActivityPattern(clockVo.getActivityPattern()); .setActivityPattern(redisCache.getHash(RedisKeys.TemporaryKeys.TENOIRART_ACTIVITY_PATTERN.getKey(),
String.valueOf(clockVo.getActivityPatternId())));
employeeCoreTemClockService.updateClockactivityPattern(temporaryClockDto); employeeCoreTemClockService.updateClockactivityPattern(temporaryClockDto);
return R.success(); return R.success();
} }
......
...@@ -24,17 +24,12 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ ...@@ -24,17 +24,12 @@ public class ActivityPlanInfoCoreServiceImpl implements ActivityPlanInfoCoreServ
@Autowired @Autowired
EmployeeActivityPlanInfoDao employeeActivityPlanInfoDao; EmployeeActivityPlanInfoDao employeeActivityPlanInfoDao;
@Autowired
private RedisCache redisCache;
@Override @Override
public void updateActivityInfo(ActivityPlanInfoVo activityPlanInfoVo) { public void updateActivityInfo(ActivityPlanInfoVo activityPlanInfoVo) {
ActivityPlanInfoWrapper wrap = new ActivityPlanInfoWrapper(); ActivityPlanInfoWrapper wrap = new ActivityPlanInfoWrapper();
BeanUtils.copyProperties(activityPlanInfoVo, wrap); BeanUtils.copyProperties(activityPlanInfoVo, wrap);
if (Objects.nonNull(activityPlanInfoVo.getActivityPatternId())) {
wrap.setActivityPattern(redisCache.getHash(RedisKeys.TemporaryKeys.TENOIRART_ACTIVITY_PATTERN.getKey(),
String.valueOf(activityPlanInfoVo.getActivityPatternId())));
}
employeeActivityPlanInfoDao.update(wrap); employeeActivityPlanInfoDao.update(wrap);
} }
......
...@@ -51,7 +51,6 @@ public class EmployeeQueryTemActivityServiceImpl implements EmployeeQueryTemActi ...@@ -51,7 +51,6 @@ public class EmployeeQueryTemActivityServiceImpl implements EmployeeQueryTemActi
} }
temporaryActivityReportedDao.findPage(tw, pageInfo); temporaryActivityReportedDao.findPage(tw, pageInfo);
// 查询活动记录关联的售卖单元列表(一次性查出)
if (CollectionUtils.isEmpty(pageInfo.getRecords())) { if (CollectionUtils.isEmpty(pageInfo.getRecords())) {
return; return;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论