Browse Source

预约记录

master
zxc 4 years ago
parent
commit
d23819c0cc
  1. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java
  2. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java
  3. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java
  4. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  5. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordFormDTO.java

@ -21,6 +21,7 @@ public class AppointmentRecordFormDTO implements Serializable {
@NotBlank(message = "matterId不能为空",groups = AppointmentRecordForm.class) @NotBlank(message = "matterId不能为空",groups = AppointmentRecordForm.class)
private String matterId; private String matterId;
@NotBlank(message = "date不能为空",groups = AppointmentRecordForm.class)
private String date; private String date;
public AppointmentRecordFormDTO() { public AppointmentRecordFormDTO() {

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java

@ -1,8 +1,11 @@
package com.epmet.dto.result; package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -41,4 +44,16 @@ public class AppointmentRecordResultDTO implements Serializable {
* 预约时间 * 预约时间
*/ */
private List<String> appointmentTime; private List<String> appointmentTime;
@JsonIgnore
private String timeId;
public AppointmentRecordResultDTO() {
this.sort = NumConstant.ZERO;
this.matterName = "";
this.appointmentName = "";
this.appointmentPhone = "";
this.remark = "";
this.appointmentTime = new ArrayList<>();
}
} }

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java

@ -18,8 +18,12 @@
package com.epmet.dao; package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.entity.IcMatterAppointmentRecordEntity; import com.epmet.entity.IcMatterAppointmentRecordEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 事项预约记录 * 事项预约记录
@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface IcMatterAppointmentRecordDao extends BaseDao<IcMatterAppointmentRecordEntity> { public interface IcMatterAppointmentRecordDao extends BaseDao<IcMatterAppointmentRecordEntity> {
/**
* @Description 查询预约列表
* @param matterId
* @param date
* @author zxc
* @date 2021/11/23 1:55 下午
*/
List<AppointmentRecordResultDTO> appointmentRecord(@Param("matterId")String matterId,@Param("date")String date);
} }

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

@ -33,7 +33,6 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.PartyServiceCenterConstant; import com.epmet.constant.PartyServiceCenterConstant;
import com.epmet.dao.IcMatterAppointmentRecordDao; import com.epmet.dao.IcMatterAppointmentRecordDao;
import com.epmet.dao.IcPartyServiceCenterDao; import com.epmet.dao.IcPartyServiceCenterDao;
@ -60,8 +59,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN;
/** /**
* 党群服务中心 * 党群服务中心
@ -346,7 +344,24 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
*/ */
@Override @Override
public List<AppointmentRecordResultDTO> appointmentRecord(AppointmentRecordFormDTO formDTO) { public List<AppointmentRecordResultDTO> appointmentRecord(AppointmentRecordFormDTO formDTO) {
return null; List<AppointmentRecordResultDTO> result = matterAppointmentRecordDao.appointmentRecord(formDTO.getMatterId(), formDTO.getDate());
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
IcPartyServiceCenterMatterEntity matter = matterService.selectById(formDTO.getMatterId());
if (null == matter){
throw new RenException("事项不存在...");
}
List<TimeDTO> timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY);
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE);
result.forEach(r -> {
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE));
List<String> time = new ArrayList<>();
List<String> list = Arrays.asList(r.getTimeId().split(","));
list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime())));
r.setAppointmentTime(time);
});
return result;
} }
public List<TimeDTO> getTimeList(String start,String end,Integer interval){ public List<TimeDTO> getTimeList(String start,String end,Integer interval){

15
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml

@ -3,4 +3,19 @@
<mapper namespace="com.epmet.dao.IcMatterAppointmentRecordDao"> <mapper namespace="com.epmet.dao.IcMatterAppointmentRecordDao">
<!-- 查询预约列表 -->
<select id="appointmentRecord" resultType="com.epmet.dto.result.AppointmentRecordResultDTO">
SELECT
ar.APPOINTMENT_NAME,
ar.APPOINTMENT_PHONE,
ar.REMARK,
ar.TIME_ID,
cm.MATTER_NAME
FROM ic_matter_appointment_record ar
LEFT JOIN ic_party_service_center_matter cm ON (cm.ID = ar.MATTER_ID AND cm.DEL_FLAG = 0)
WHERE ar.DEL_FLAG = 0
AND ar.MATTER_ID = #{matterId}
AND ar.APPOINTMENT_DATE = #{date}
AND ar.`STATUS` = 'appointing'
</select>
</mapper> </mapper>
Loading…
Cancel
Save