add 参会人签到
This commit is contained in:
+12
@@ -232,5 +232,17 @@ public class PayMeetingSituationController extends JeroController<PayMeetingSitu
|
|||||||
return Result.OK("合并开票成功!");
|
return Result.OK("合并开票成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签到
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "签到")
|
||||||
|
@ApiOperation(value = "签到")
|
||||||
|
@PostMapping(value = "/signIn")
|
||||||
|
public Result<?> signIn(@RequestBody SignInVO signInVO) {
|
||||||
|
ValidUtil.validate(signInVO);
|
||||||
|
payMeetingSituationService.signIn(signInVO);
|
||||||
|
return Result.OK("合并开票成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -56,4 +56,6 @@ public interface IPayMeetingSituationService extends IService<PayMeetingSituatio
|
|||||||
Integer countByMeetingId(String meetingId);
|
Integer countByMeetingId(String meetingId);
|
||||||
|
|
||||||
Page<MeetingSituationContractVO> contractPage(Page<MeetingSituationContractVO> page, MeetingSituationContractVO meetingSituationContractVO);
|
Page<MeetingSituationContractVO> contractPage(Page<MeetingSituationContractVO> page, MeetingSituationContractVO meetingSituationContractVO);
|
||||||
|
|
||||||
|
void signIn(SignInVO signInVO);
|
||||||
}
|
}
|
||||||
|
|||||||
+57
@@ -39,6 +39,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理打包情况
|
* 处理打包情况
|
||||||
|
*
|
||||||
* @param payMeetingSituation1
|
* @param payMeetingSituation1
|
||||||
*/
|
*/
|
||||||
private void handlePack(PayMeetingSituation payMeetingSituation1) {
|
private void handlePack(PayMeetingSituation payMeetingSituation1) {
|
||||||
@@ -276,6 +278,36 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
|||||||
return baseMapper.contractPage(page, meetingSituationContractVO);
|
return baseMapper.contractPage(page, meetingSituationContractVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void signIn(SignInVO signInVO) {
|
||||||
|
String meetingId = signInVO.getMeetingId();
|
||||||
|
|
||||||
|
PayMeeting payMeeting = meetingService.getById(meetingId);
|
||||||
|
if (payMeeting == null) {
|
||||||
|
throw new JeroBootException("会议不存在");
|
||||||
|
}
|
||||||
|
if (!belongCalendar(new Date(),payMeeting.getStartSignInTime(),payMeeting.getEndSignInTime())) {
|
||||||
|
throw new JeroBootException("不在会议可签到时间内,无法签到");
|
||||||
|
}
|
||||||
|
String companyContactId = signInVO.getCompanyContactId();
|
||||||
|
PayContactsManagement contactsManagement = contactsManagementService.getById(companyContactId);
|
||||||
|
if (contactsManagement == null) {
|
||||||
|
throw new JeroBootException("参会人不存在");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<PayMeetingSituation> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(PayMeetingSituation::getMeetingId, meetingId);
|
||||||
|
wrapper.eq(PayMeetingSituation::getCompanyContactId, companyContactId);
|
||||||
|
PayMeetingSituation meetingSituation = getOne(wrapper);
|
||||||
|
if (meetingSituation == null) {
|
||||||
|
throw new JeroBootException("会议不存在此参会人");
|
||||||
|
|
||||||
|
}
|
||||||
|
meetingSituation.setCheckIn(PayProjectCommon.YES);
|
||||||
|
saveOrUpdate(meetingSituation);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*/
|
*/
|
||||||
@@ -477,6 +509,7 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 解除参会人打包
|
* 解除参会人打包
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
private void removeSituationPack(String id) {
|
private void removeSituationPack(String id) {
|
||||||
@@ -543,5 +576,29 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断时间是否在时间段内
|
||||||
|
*
|
||||||
|
* @param nowTime
|
||||||
|
* @param beginTime
|
||||||
|
* @param endTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean belongCalendar(Date nowTime, Date beginTime,
|
||||||
|
Date endTime) {
|
||||||
|
Calendar date = Calendar.getInstance();
|
||||||
|
date.setTime(nowTime);
|
||||||
|
|
||||||
|
Calendar begin = Calendar.getInstance();
|
||||||
|
begin.setTime(beginTime);
|
||||||
|
|
||||||
|
Calendar end = Calendar.getInstance();
|
||||||
|
end.setTime(endTime);
|
||||||
|
|
||||||
|
if (date.after(begin) && date.before(end)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.jero.meeting.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签到
|
||||||
|
* @author liJiaRao
|
||||||
|
* @date 2021-09-21 17:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SignInVO {
|
||||||
|
@NotBlank(message = "参会人id不能为空")
|
||||||
|
@ApiModelProperty(value = "参会人id")
|
||||||
|
private String companyContactId;
|
||||||
|
@ApiModelProperty(value = "会议id")
|
||||||
|
@NotBlank(message = "会议id不能为空")
|
||||||
|
private String meetingId;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user