Browse Source

预约日期校验

dev_shibei_match
zxc 4 years ago
parent
commit
7e9cc572a8
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 33
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -157,6 +157,7 @@ public enum EpmetErrorCode {
COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"), COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"),
MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"), MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"),
ERROR_DATE(8533, "不合理日期"),
// 该错误不会提示给前端,只是后端传输错误信息用。 // 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

33
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -275,6 +275,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) { public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -322,6 +336,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) { public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -500,11 +528,6 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return result; return result;
} }
public static void main(String[] args) {
Date date = DateUtils.addDateDays(new Date(), 2);
}
/** /**
* @Description 党群服务中心预约记录 * @Description 党群服务中心预约记录
* @param formDTO * @param formDTO

Loading…
Cancel
Save