提交 29e767a6 authored 作者: 吕本才's avatar 吕本才

refactor(temporary): 统一临时活动相关接口的ID类型为Long

上级 3abca5af
......@@ -109,7 +109,7 @@ public class TemporaryActivityClockCoreController {
builderClockOutData(clockVo, dto, clockTime);
}
tempActivityClockCoreService.clockInTodayPlan(dto, clockType);
return R.success();
return R.success(dto);
}
/**
......
......@@ -33,7 +33,7 @@ public class TemporaryActivityClockQueryController {
* 根据促销员id查询今日打卡信息
*/
@GetMapping("/{temporary_id}")
public R findTodayTemporaryClockByTemId(@PathVariable("temporary_id") Integer temporaryId) {
public R findTodayTemporaryClockByTemId(@PathVariable("temporary_id") Long temporaryId) {
if (Objects.isNull(temporaryId) || temporaryId < 1){
throw new DataException(RCode.DATA_NOT_HAVE_ERROR);
}
......@@ -50,7 +50,7 @@ public class TemporaryActivityClockQueryController {
* @return 打卡信息
*/
@GetMapping("/date")
public R findTemporaryClockByTemIdAndDate(Integer temporaryId, String createDate) {
public R findTemporaryClockByTemIdAndDate(Long temporaryId, String createDate) {
if (Objects.isNull(temporaryId) || temporaryId < 1 || StringUtils.isBlank(createDate)){
throw new DataException(RCode.DATA_NOT_HAVE_ERROR);
}
......
......@@ -33,7 +33,7 @@ public class TemporaryActivityQueryController {
* @return 所有任务(分页查询)
*/
@PostMapping("/all/{temporary_id}")
public R findtemporaryIdActivityDataList(@PathVariable("temporary_id") @NotNull Integer temporaryId, @RequestBody PageInfo pageInfo) {
public R findtemporaryIdActivityDataList(@PathVariable("temporary_id") @NotNull Long temporaryId, @RequestBody PageInfo pageInfo) {
temporaryActivityQueryService.findtemporaryIdActivityDataList(temporaryId, pageInfo);
return R.success(pageInfo);
}
......@@ -42,7 +42,7 @@ public class TemporaryActivityQueryController {
* 根据促销员id查询今日任务
*/
@GetMapping("/today/{temporary_id}")
public R findTemporaryTodayActivityData(@PathVariable("temporary_id") @NotNull Integer temporaryId) {
public R findTemporaryTodayActivityData(@PathVariable("temporary_id") @NotNull Long temporaryId) {
TemporaryActivityReportedDto dto = temporaryActivityQueryService.findtemporaryIdTodayActivityData(temporaryId);
return R.success(dto);
}
......
......@@ -9,5 +9,5 @@ import com.wangxiaolu.promotion.enums.activity.LogType;
*/
public interface TemporaryActivityLogDao {
void save(Integer temporaryId, String temporaryName, LogType typeE, Long flowDataId, Object logObj);
void save(Long temporaryId, String temporaryName, LogType typeE, Long flowDataId, Object logObj);
}
......@@ -16,28 +16,28 @@ public interface TemporaryActivityPhotoDao {
/**
* 保存活动上报照片list
*/
void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls);
void saveReportedList(Long clockId,Integer temporaryId, Long reportedId, Integer photoType, List<String> urls);
void saveReportedList(Long temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls);
void saveReportedList(Long clockId,Long temporaryId, Long reportedId, Integer photoType, List<String> urls);
/**
* 保存促销员上下班打卡图片
*/
void saveClockPhoto(Integer temporaryId, Long clockId, Integer photoType, String url);
void saveClockPhoto(Long temporaryId, Long clockId, Integer photoType, String url);
/**
* 根据促销员id-活动上报id查询图片
*/
Map<Integer, List<String>> findReportedGroup(Integer temporaryId, Long reportedId);
Map<Integer, List<String>> findReportedGroup(Long temporaryId, Long reportedId);
Map<Integer, TemporaryActivityPhotoDto> findClockPhotoGroupByClockId(Long clockId);
void updateStatus(TemporaryPhotoWrapper pw, int status);
void saveClockPhotoByUpdate(Integer temporaryId, Long id, Integer photoType, String url);
void saveClockPhotoByUpdate(Long 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);
Map<Integer, List<TemporaryActivityPhotoDto>> findReportedInfoGroup(Long temporaryId, Long reportedId);
void deleteList(Long reportedId, int type);
......
......@@ -25,7 +25,7 @@ public interface TemporaryActivityReportedDao {
/**
* 查询当日任务
*/
TemporaryActivityReportedDto findOneByCurrentDate(Integer temporaryId);
TemporaryActivityReportedDto findOneByCurrentDate(Long temporaryId);
/**
* 根据ID查询
......
......@@ -21,7 +21,7 @@ public class TemporaryActivityLogDaoImpl implements TemporaryActivityLogDao {
@Override
public void save(Integer temporaryId, String temporaryName, LogType typeE, Long flowDataId, Object logObj) {
public void save(Long temporaryId, String temporaryName, LogType typeE, Long flowDataId, Object logObj) {
TemporaryActivityLogDO tDo = new TemporaryActivityLogDO(temporaryId, temporaryName, typeE, flowDataId, JSONObject.toJSONString(logObj));
temporaryActivityLogMapper.insert(tDo);
}
......
......@@ -33,7 +33,7 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
TemporaryActivityPhotoMapper temporaryActivityPhotoMapper;
@Override
public void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls) {
public void saveReportedList(Long temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls) {
if (CollectionUtils.isEmpty(changeUrls)) {
return;
}
......@@ -65,7 +65,7 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
}
@Override
public void saveReportedList(Long clockId,Integer temporaryId, Long reportedId, Integer photoType, List<String> urls) {
public void saveReportedList(Long clockId,Long temporaryId, Long reportedId, Integer photoType, List<String> urls) {
List<TemporaryActivityPhotoDO> dos = new ArrayList<>();
for (String url : urls) {
String[] uArr = url.split("/");
......@@ -87,13 +87,13 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
* 保存促销员上下班打卡图片
*/
@Override
public void saveClockPhoto(Integer temporaryId, Long clockId, Integer photoType, String url) {
public void saveClockPhoto(Long temporaryId, Long clockId, Integer photoType, String url) {
saveClockPhoto(temporaryId, clockId, photoType, url, null);
}
@Override
public void saveClockPhotoByUpdate(Integer temporaryId, Long id, Integer photoType, String url) {
public void saveClockPhotoByUpdate(Long temporaryId, Long id, Integer photoType, String url) {
saveClockPhoto(temporaryId, id, photoType, url, true);
}
......@@ -119,7 +119,7 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
}
@Override
public Map<Integer, List<TemporaryActivityPhotoDto>> findReportedInfoGroup(Integer temporaryId, Long reportedId) {
public Map<Integer, List<TemporaryActivityPhotoDto>> findReportedInfoGroup(Long temporaryId, Long reportedId) {
LambdaQueryWrapper<TemporaryActivityPhotoDO> wq = new LambdaQueryWrapper<>();
wq.eq(TemporaryActivityPhotoDO::getReportedId, reportedId)
.eq(TemporaryActivityPhotoDO::getIsDelete, StatusType.VALID.getType());
......@@ -164,7 +164,7 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
* @param reportedId 活动id
*/
@Override
public Map<Integer, List<String>> findReportedGroup(Integer temporaryId, Long reportedId) {
public Map<Integer, List<String>> findReportedGroup(Long 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);
......@@ -222,7 +222,7 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
private void saveClockPhoto(Integer temporaryId, Long clockId, Integer photoType, String url, Boolean isUpdate) {
private void saveClockPhoto(Long temporaryId, Long clockId, Integer photoType, String url, Boolean isUpdate) {
String[] photoArr = url.split("/");
String photoFiledId = photoArr[photoArr.length - 1];
......
......@@ -67,7 +67,7 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport
* 根据促销员id查询今日任务
*/
@Override
public TemporaryActivityReportedDto findOneByCurrentDate(Integer temporaryId) {
public TemporaryActivityReportedDto findOneByCurrentDate(Long temporaryId) {
TemporaryActivityWrapper taw = new TemporaryActivityWrapper()
.setTemporaryId(temporaryId)
.setCreateDate(DateUtil.today());
......
......@@ -32,7 +32,7 @@ public class TemporaryActivityLogDO implements Serializable {
/**
* temporary_info表id
*/
private Integer temporaryId;
private Long temporaryId;
/**
* 促销员姓名
......@@ -67,7 +67,7 @@ public class TemporaryActivityLogDO implements Serializable {
@TableField(exist = false)
private static final long serialVersionUID = 1L;
public TemporaryActivityLogDO(Integer temporaryId, String temporaryName, LogType typeE, Long flowDataId, Object dataDetail) {
public TemporaryActivityLogDO(Long temporaryId, String temporaryName, LogType typeE, Long flowDataId, Object dataDetail) {
this.temporaryId = temporaryId;
this.type = typeE.getType();
this.typeName = typeE.getName();
......
......@@ -27,7 +27,7 @@ public class TemporaryActivityPhotoDO implements Serializable {
/**
* temporary_info表id
*/
private Integer temporaryId;
private Long temporaryId;
/**
* 活动上报ID,关联表temporary_activity_reported表主键id
......
......@@ -31,7 +31,7 @@ public class TemporaryActivityTaskClockDO implements Serializable {
@TableId(type = IdType.AUTO)
private Long id;
private Integer temporaryId;
private Long temporaryId;
/**
* 活动打卡id
......
......@@ -19,13 +19,13 @@ public class TemporaryActivityTaskWrapperDto {
/**
* temporary_info表id
*/
private Integer temporaryId;
private Long temporaryId;
private Long clockId;
private Integer reportId;
private Long reportId;
private Integer planId;
private Long planId;
/**
* 任务类型
......
......@@ -22,7 +22,7 @@ public class TemporaryActivityWrapper {
/**
* temporaryId
*/
private Integer temporaryId;
private Long temporaryId;
private String temporaryName;
......
......@@ -26,7 +26,7 @@ public class TemporaryClockWrapper {
/**
* temporary_info表id
*/
private Integer temporaryId;
private Long temporaryId;
/**
......
......@@ -22,7 +22,7 @@ public class TemporaryPhotoWrapper {
/**
* temporary_info表id
*/
private Integer temporaryId;
private Long temporaryId;
/**
* 活动上报ID,关联表temporary_activity_reported表主键id
......
......@@ -21,7 +21,7 @@ public interface TemporaryInfoDao {
*/
WxTemporaryInfoDto selectOneByOpenId(String openId);
WxTemporaryInfoDto selectOneById(Integer id);
WxTemporaryInfoDto selectOneById(Long id);
void findPage(TemporaryWrapper tw, PageInfo pageInfo);
......
......@@ -64,7 +64,7 @@ public class TemporaryInfoDaoImpl implements TemporaryInfoDao {
}
@Override
public WxTemporaryInfoDto selectOneById(Integer id) {
public WxTemporaryInfoDto selectOneById(Long id) {
TemporaryInfoDO temDo = temporaryInfoMapper.selectById(id);
return transitionDto(temDo);
}
......
......@@ -16,6 +16,8 @@ import java.util.Date;
@Data
@TableName(value ="temporary_info")
public class TemporaryInfoDO implements Serializable {
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
......@@ -87,7 +89,6 @@ public class TemporaryInfoDO implements Serializable {
*/
private Date modifyTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
......@@ -21,7 +21,7 @@ public class TemporaryActivityPhotoDto implements Serializable {
/**
* temporary_info表id
*/
private Integer temporaryId;
private Long temporaryId;
/**
* 活动上报ID,关联表temporary_activity_reported表主键id
......
......@@ -27,7 +27,7 @@ public class TemporaryActivityReportedDto {
/**
* 关联—temporary_info表id
*/
private Integer temporaryId;
private Long temporaryId;
/**
* 关联—temporary_info表name
......
......@@ -27,7 +27,7 @@ public class TemporaryClockDto {
/**
* temporaryId
*/
Integer temporaryId;
Long temporaryId;
String temporaryName;
......@@ -149,7 +149,7 @@ public class TemporaryClockDto {
*/
Integer isDelete;
public TemporaryClockDto(Integer clockType, Long id, Integer temporaryId, String temporaryName, String clockProvince, String clockCity) {
public TemporaryClockDto(Integer clockType, Long id, Long temporaryId, String temporaryName, String clockProvince, String clockCity) {
if (!ClockType.TEMPORARY_CLOCK_IN.equals(clockType)) {
this.id = id;
}
......@@ -159,7 +159,7 @@ public class TemporaryClockDto {
this.clockCity = clockCity;
}
public TemporaryClockDto(Long id, Integer temporaryId, String brevityClockPhoto, Integer brevityClockType) {
public TemporaryClockDto(Long id, Long temporaryId, String brevityClockPhoto, Integer brevityClockType) {
this.id = id;
this.temporaryId = temporaryId;
this.brevityClockPhoto = brevityClockPhoto;
......
......@@ -39,7 +39,7 @@ public class TemporaryClockVo {
/**
* temporaryId
*/
Integer temporaryId;
Long temporaryId;
String temporaryName;
......
......@@ -10,5 +10,5 @@ import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto;
public interface EmployeeCoreTemporaryInfoService {
void updateTemporaryInfoById(WxTemporaryInfoDto temporaryDto);
WxTemporaryInfoDto selectById(Integer temporaryId);
WxTemporaryInfoDto selectById(Long temporaryId);
}
......@@ -22,7 +22,7 @@ public class EmployeeCoreTemporaryInfoServiceImpl implements EmployeeCoreTempora
}
@Override
public WxTemporaryInfoDto selectById(Integer temporaryId) {
public WxTemporaryInfoDto selectById(Long temporaryId) {
WxTemporaryInfoDto wxTemporaryInfoDto = temporaryInfoDao.selectOneById(temporaryId);
return wxTemporaryInfoDto;
......
......@@ -9,9 +9,9 @@ import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
* @describe :
*/
public interface TemporaryActivityClockQueryService {
TemporaryClockDto findTodayTemporaryClockByTemId(Integer temporaryId);
TemporaryClockDto findTodayTemporaryClockByTemId(Long temporaryId);
TemporaryClockDto findTemporaryClockByTemIdAndDate(Integer temporaryId, String createDate);
TemporaryClockDto findTemporaryClockByTemIdAndDate(Long temporaryId, String createDate);
TemporaryClockDto findById(Long id);
TemporaryClockDto selectOne(TemporaryClockWrapper tcw);
......
......@@ -17,12 +17,12 @@ public interface TemporaryActivityQueryService {
/**
* 根据促销员id查询所有任务
*/
void findtemporaryIdActivityDataList(Integer temporaryId, PageInfo pageInfo);
void findtemporaryIdActivityDataList(Long temporaryId, PageInfo pageInfo);
/**
* 根据促销员id查询今日任务
*/
TemporaryActivityReportedDto findtemporaryIdTodayActivityData(Integer temporaryId);
TemporaryActivityReportedDto findtemporaryIdTodayActivityData(Long temporaryId);
TemporaryActivityReportedDto findTemporaryActivityById(Long activityId);
......
......@@ -9,7 +9,7 @@ import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityTask
import java.util.List;
public interface TemporaryActivityTaskClockService extends IService<TemporaryActivityTaskClockDO> {
List<TemporaryActivityTaskClockDO> listByTemporaryId(Integer temporaryId);
List<TemporaryActivityTaskClockDO> listByTemporaryId(Long temporaryId);
void generateRandomClockTask(TemporaryClockDto dto);
......
......@@ -34,7 +34,7 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity
private TemporaryInfoDao temporaryInfoDao;
@Override
public TemporaryClockDto findTodayTemporaryClockByTemId(Integer temporaryId) {
public TemporaryClockDto findTodayTemporaryClockByTemId(Long temporaryId) {
String today = DateUtil.today();
TemporaryClockWrapper tcw = new TemporaryClockWrapper()
.setTemporaryId(temporaryId)
......@@ -48,7 +48,7 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity
* 查询指定日期打卡信息
*/
@Override
public TemporaryClockDto findTemporaryClockByTemIdAndDate(Integer temporaryId, String createDate) {
public TemporaryClockDto findTemporaryClockByTemIdAndDate(Long temporaryId, String createDate) {
TemporaryClockWrapper tcw = new TemporaryClockWrapper()
.setTemporaryId(temporaryId)
.setCreateDate(createDate);
......@@ -71,7 +71,7 @@ public class TemporaryActivityClockQueryServiceImpl implements TemporaryActivity
findClockPhoto(temporaryClockDto);
if (Objects.nonNull(temporaryClockDto)) {
// 查询促销员手机号
Integer temporaryId = temporaryClockDto.getTemporaryId();
Long temporaryId = temporaryClockDto.getTemporaryId();
WxTemporaryInfoDto wxTemporaryInfoDto = temporaryInfoDao.selectOneById(temporaryId);
temporaryClockDto.setPhone(Objects.isNull(wxTemporaryInfoDto) ? null : wxTemporaryInfoDto.getPhone());
}
......
......@@ -242,7 +242,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
* @param temActDto 活动提交数据
*/
private void saveActivityPhotoV2(TemporaryActivityReportedDto temActDto) {
Integer temporaryId = temActDto.getTemporaryId();
Long temporaryId = temActDto.getTemporaryId();
Long reportedId = temActDto.getId();
// 推广试吃照片
if (CollectionUtils.isEmpty(temActDto.getTgscPhotoUrls())) {
......
......@@ -47,7 +47,7 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery
* 根据促销员id查询所有任务
*/
@Override
public void findtemporaryIdActivityDataList(Integer temporaryId, PageInfo pageInfo) {
public void findtemporaryIdActivityDataList(Long temporaryId, PageInfo pageInfo) {
TemporaryActivityWrapper taw = JSONObject.parseObject(JSONObject.toJSONString(pageInfo.getQueryParams()), TemporaryActivityWrapper.class);
taw = Objects.isNull(taw) ? new TemporaryActivityWrapper() : taw;
taw.setTemporaryId(temporaryId);
......@@ -59,7 +59,7 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery
* 根据促销员id查询今日任务
*/
@Override
public TemporaryActivityReportedDto findtemporaryIdTodayActivityData(Integer temporaryId) {
public TemporaryActivityReportedDto findtemporaryIdTodayActivityData(Long temporaryId) {
TemporaryActivityReportedDto dto = temporaryActivityReportedDao.findOneByCurrentDate(temporaryId);
findActivityReportedPhoto(dto);
return dto;
......
......@@ -42,7 +42,7 @@ public class TemporaryActivityTaskClockServiceImpl extends ServiceImpl<Temporary
private TemporaryActivityPhotoDao photoDao;
@Override
public List<TemporaryActivityTaskClockDO> listByTemporaryId(Integer temporaryId) {
public List<TemporaryActivityTaskClockDO> listByTemporaryId(Long temporaryId) {
TemporaryActivityTaskWrapperDto wrapper = new TemporaryActivityTaskWrapperDto()
.setTemporaryId(temporaryId)
.setIsDelete(FlagType.NO.getType());
......@@ -102,6 +102,7 @@ public class TemporaryActivityTaskClockServiceImpl extends ServiceImpl<Temporary
TemporaryActivityTaskWrapperDto wrapper = new TemporaryActivityTaskWrapperDto();
wrapper.setTemporaryId(dto.getTemporaryId())
.setClockId(dto.getId())
.setReportId(dto.getReportedId())
.setTaskType(ActivityPhotoType.POS_PHOTO.getType())
.setIsDelete(FlagType.NO.getType());
TemporaryActivityTaskClockDO taskClockDO1 = temporaryActivityTaskClockDao.selectOne(wrapper);
......@@ -133,7 +134,7 @@ public class TemporaryActivityTaskClockServiceImpl extends ServiceImpl<Temporary
String userId = AuthUtils.getUserId(token);
TemporaryActivityTaskWrapperDto wrapper = new TemporaryActivityTaskWrapperDto()
.setUserId(Long.parseLong(userId))
.setTemporaryId(Integer.parseInt(userId))
.setTemporaryId(Long.parseLong(userId))
.setIsDelete(FlagType.NO.getType());
List<TemporaryActivityTaskClockDO> list = temporaryActivityTaskClockDao.selectList(wrapper);
return list;
......@@ -189,11 +190,11 @@ public class TemporaryActivityTaskClockServiceImpl extends ServiceImpl<Temporary
TemporaryActivityTaskWrapperDto wrapper = new TemporaryActivityTaskWrapperDto()
.setUserId(Long.parseLong(userId))
.setTaskType(taskType)
.setTemporaryId(Integer.parseInt(userId))
.setTemporaryId(Long.parseLong(userId))
.setIsDelete(FlagType.NO.getType());
TemporaryActivityTaskClockDO taskClockDO = temporaryActivityTaskClockDao.selectOne(wrapper);
TemporaryActivityTaskClockRes res = new TemporaryActivityTaskClockRes();
if (taskClockDO != null) {
TemporaryActivityTaskClockRes res = new TemporaryActivityTaskClockRes();
BeanUtils.copyProperties(taskClockDO, res);
// 查询图片
TemporaryPhotoWrapper photoWrapper = new TemporaryPhotoWrapper()
......@@ -207,7 +208,7 @@ public class TemporaryActivityTaskClockServiceImpl extends ServiceImpl<Temporary
res.setClockPhotos(photoUrls);
return res;
}
return res;
return null;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论