PAMapp/assets/scss/utilities/_heading.scss
@@ -126,3 +126,12 @@ @extend .cursor--pointer; @extend .text--underline; } .pam-link-button--lg { @extend .fix-chrome-click--issue; @extend .mdTxt; @extend .text--bold; @extend .text--primary; @extend .cursor--pointer; @extend .text--underline; } PAMapp/components/Appointment/AppointmentInterviewList.vue
@@ -2,7 +2,7 @@ <div> <div class="interview__header"> <div class="mdTxt">ç´è¨ªç´é</div> <div class="mdTxt text--underline text--primary" <div class="pam-link-button--lg" @click="addInterview">+æ°å¢</div> </div> @@ -39,7 +39,7 @@ </section> <section class="more-log-action"> <div class="mdTxt text--primary text--underline">å±éçæ´å¤</div> <div class="pam-link-button--lg">å±éçæ´å¤</div> </section> </template> </div> PAMapp/components/Appointment/AppointmentRecordList.vue
@@ -27,7 +27,7 @@ <div class="time-line"></div> <section class="more-log-action"> <div class="mdTxt text--primary text--underline">å±éçæ´å¤</div> <div class="pam-link-button--lg">å±éçæ´å¤</div> </section> </div> </template> PAMapp/components/Interview/InterviewAdd.vue
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,78 @@ <template> <div class="edit-appointment-record"> <div class="edit-appointment-record-date"> <span>ä»å¤© 11:00 建ç«</span> <span>ä»å¤© 11:00 æ´æ°</span> </div> <div class="mdTxt mb-10">ç´è¨ªæé</div> <div class="date-input"> 2022/01/10 09:00 <i class="icon-calender icon"></i> </div> <div class="mdTxt mb-10">ç´è¨ªç´é</div> <el-input type="textarea" :rows="5" placeholder="ç´è¨ªéç¥" resize="none"> </el-input> <div class="edit-appointment-record-btn"> <el-button>åæ¶</el-button> <el-button>確å®</el-button> </div> </div> </template> <script lang="ts"> import { AppointmentLog } from '~/shared/models/appointment.model'; import { Vue, Component, Prop } from 'nuxt-property-decorator'; import authService from '~/shared/services/auth.service'; @Component export default class InterviewAdd extends Vue { // @Prop() // myAppointmentReviewLogList!: AppointmentLog[]; // isUserLogin = false; ////////////////////////////////////////////////////////////////////// // mounted() { // this.isUserLogin = authService.isUserLogin(); // } } </script> <style lang="scss" scoped> .edit-appointment-record { padding-left : 10px; padding-right: 10px; .edit-appointment-record-date{ color : #68737A; display : flex; justify-content: space-between; margin-bottom : 26px; } } .date-input { align-items : center; background-color: #fff; border : 1px solid #707070; border-radius : 5px; display : flex; font-size : 20px; height : 46px; margin-bottom : 30px; padding-left : 20px; padding-right : 20px; } .icon { color : $PRIMARY_RED; display : flex; flex : 1; justify-content: flex-end; } .edit-appointment-record-btn{ margin-top: 30px; display: flex; justify-content: center; } </style> PAMapp/pages/appointment/_appointmentId/index.vue
@@ -45,7 +45,7 @@ <div class="client-detail-action"> <el-button @click="closeAppointment" >çµæ¡</el-button> <el-button @click="$router.go(-1)" style="margin-left: 0px">éç¥/æ¡è¨ª</el-button> <el-button @click="$router.go(-1)" style="margin-left: 0px">éç¥/ç´è¨ª</el-button> </div> </section> PAMapp/pages/appointment/_appointmentId/interview/_interviewId/index.vue
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,14 @@ <template> <InterviewAdd></InterviewAdd> </template> <script lang="ts"> import { Vue, Component } from 'nuxt-property-decorator'; @Component export default class EditAppointmentInterview extends Vue { } </script> <style lang="scss" scoped> </style> PAMapp/pages/appointment/_appointmentId/interview/new/index.vue
@@ -1,25 +1,5 @@ <template> <div class="edit-appointment-record"> <div class="edit-appointment-record-date"> <span>ä»å¤© 11:00 建ç«</span> <span>ä»å¤© 11:00 æ´æ°</span> </div> <div class="mdTxt mb-10">ç´è¨ªæé</div> <div class="date-input"> 2022/01/10 09:00 <i class="icon-calender icon"></i> </div> <div class="mdTxt mb-10">ç´è¨ªç´é</div> <el-input type="textarea" :rows="5" placeholder="ç´è¨ªéç¥" resize="none"> </el-input> <div class="edit-appointment-record-btn"> <el-button>åæ¶</el-button> <el-button>確å®</el-button> </div> </div> <InterviewAdd></InterviewAdd> </template> <script lang="ts"> import { Vue, Component } from 'nuxt-property-decorator'; @@ -30,37 +10,5 @@ } </script> <style lang="scss" scoped> .edit-appointment-record { padding-left : 10px; padding-right: 10px; .edit-appointment-record-date{ color : #68737A; display : flex; justify-content: space-between; margin-bottom : 26px; } } .date-input { align-items : center; background-color: #fff; border : 1px solid #707070; border-radius : 5px; display : flex; font-size : 20px; height : 46px; margin-bottom : 30px; padding-left : 20px; padding-right : 20px; } .icon { color : $PRIMARY_RED; display : flex; flex : 1; justify-content: flex-end; } .edit-appointment-record-btn{ margin-top: 30px; display: flex; justify-content: center; } </style> pamapi/src/doc/sql/20220112_j.sql
@@ -40,3 +40,27 @@ CONSTRAINT interview_record_pkey PRIMARY KEY (id) ); -- æ°å¢é ç´å®çµæ¡è³ætable -- Drop table -- DROP TABLE public.appointment_closed_info; -- Drop table -- DROP TABLE public.appointment_closed_info; CREATE TABLE public.appointment_closed_info ( id bigserial NOT NULL, policyholder_identity_id varchar NULL, plan_code varchar NULL, policy_entry_date date NULL, remark varchar NULL, closed_reason varchar NULL, closed_other_reason varchar NULL, appointment_id bigserial NOT NULL, CONSTRAINT appointment_closed_info_pkey PRIMARY KEY (id) ); pamapi/src/doc/¹w¬ù³æ/µ²®×API.txt
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,30 @@ http post : http://localhost:8080/api/appointment/close request body : æäº¤ contactStatus: done { "policyholderIdentityId":"A123456789", "planCode":"ATM", "policyEntryDate":"2022-01-12", "contactStatus":"done", "appointmentId": 385 } æªæäº¤ contactStatus: closed { "contactStatus":"closed", "closedReason":"other", "closedOtherReason":"å¿æ ä¸å¥½ä¸æ³è²·", "appointmentId": 385, "remark":"test remark" } pamapi/src/main/java/com/pollex/pam/appointment/process/AppointmentProcess.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,25 @@ package com.pollex.pam.appointment.process; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.pollex.pam.service.dto.AbstractAppointmentProcessDTO; @Service public class AppointmentProcess{ @Autowired List<AppointmentProcessInterface> processList; public void process(AbstractAppointmentProcessDTO dto) { AbstractAppointmentProcessDTO appointmentProcessDTO = (AbstractAppointmentProcessDTO)dto; processList.stream().forEach(process ->{ if(process.getProcessType() == appointmentProcessDTO.getContactStatus()) { process.doProcess(appointmentProcessDTO); } }); } } pamapi/src/main/java/com/pollex/pam/appointment/process/AppointmentProcessInterface.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,11 @@ package com.pollex.pam.appointment.process; import com.pollex.pam.enums.ContactStatusEnum; import com.pollex.pam.service.dto.AbstractAppointmentProcessDTO; public interface AppointmentProcessInterface { void doProcess(AbstractAppointmentProcessDTO dto); ContactStatusEnum getProcessType(); } pamapi/src/main/java/com/pollex/pam/appointment/process/ClosedProcess.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,35 @@ package com.pollex.pam.appointment.process; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.pollex.pam.domain.AppointmentClosedInfo; import com.pollex.pam.enums.ContactStatusEnum; import com.pollex.pam.repository.AppointmentClosedInfoRepository; import com.pollex.pam.service.dto.AbstractAppointmentProcessDTO; import com.pollex.pam.service.dto.ClosedProcessDTO; import com.pollex.pam.service.dto.DoneProcessDTO; @Service public class ClosedProcess implements AppointmentProcessInterface{ @Autowired AppointmentClosedInfoRepository appointmentClosedInfoRepository; @Override public void doProcess(AbstractAppointmentProcessDTO processDTO) { ClosedProcessDTO doneProcess = (ClosedProcessDTO)processDTO; BeanUtils.copyProperties(processDTO, doneProcess); AppointmentClosedInfo closedInfo = new AppointmentClosedInfo(); BeanUtils.copyProperties(doneProcess, closedInfo); appointmentClosedInfoRepository.save(closedInfo); } @Override public ContactStatusEnum getProcessType() { return ContactStatusEnum.CLOSED; } } pamapi/src/main/java/com/pollex/pam/appointment/process/DoneProcess.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,34 @@ package com.pollex.pam.appointment.process; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.pollex.pam.domain.AppointmentClosedInfo; import com.pollex.pam.enums.ContactStatusEnum; import com.pollex.pam.repository.AppointmentClosedInfoRepository; import com.pollex.pam.service.dto.AbstractAppointmentProcessDTO; import com.pollex.pam.service.dto.DoneProcessDTO; @Service public class DoneProcess implements AppointmentProcessInterface{ @Autowired AppointmentClosedInfoRepository appointmentClosedInfoRepository; @Override public void doProcess(AbstractAppointmentProcessDTO processDTO) { DoneProcessDTO doneProcess = (DoneProcessDTO)processDTO; BeanUtils.copyProperties(processDTO, doneProcess); AppointmentClosedInfo closedInfo = new AppointmentClosedInfo(); BeanUtils.copyProperties(doneProcess, closedInfo); appointmentClosedInfoRepository.save(closedInfo); } @Override public ContactStatusEnum getProcessType() { return ContactStatusEnum.DONE; } } pamapi/src/main/java/com/pollex/pam/domain/Appointment.java
@@ -4,13 +4,26 @@ import java.time.Instant; import java.util.List; import javax.persistence.*; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EntityListeners; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import com.pollex.pam.enums.AppointmentStatusEnum; import com.pollex.pam.enums.ContactStatusEnum; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @EntityListeners(AuditingEntityListener.class) @Entity @@ -86,6 +99,15 @@ @JoinColumn(name = "appointment_id") @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) private List<AppointmentMemo> appointmentMemoList; // @OneToOne(cascade = CascadeType.REMOVE,fetch=FetchType.EAGER) //// @JoinColumn(name = "form_authority_id", referencedColumnName = "id") // @JoinColumn(name = "appointment_id", referencedColumnName = "id") // private AppointmentClosedInfo closedInfo; // @OneToOne(cascade = CascadeType.REMOVE // , mappedBy = "appointment", fetch=FetchType.LAZY) // private AppointmentClosedInfo closedInfo; public Long getId() { return id; @@ -246,6 +268,14 @@ public void setAppointmentMemoList(List<AppointmentMemo> appointmentMemoList) { this.appointmentMemoList = appointmentMemoList; } // public AppointmentClosedInfo getClosedInfo() { // return closedInfo; // } // // public void setClosedInfo(AppointmentClosedInfo closedInfo) { // this.closedInfo = closedInfo; // } pamapi/src/main/java/com/pollex/pam/domain/AppointmentClosedInfo.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,112 @@ package com.pollex.pam.domain; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "appointment_closed_info") public class AppointmentClosedInfo implements Serializable { /** * */ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "policyholder_identity_id") private String policyholderIdentityId; @Column(name = "plan_code") private String planCode; @Column(name = "policy_entry_date") private Date policyEntryDate; @Column(name = "remark") private String remark; @Column(name = "closed_reason") private String closedReason; @Column(name = "closed_other_reason") private String closedOtherReason; @Column(name = "appointment_id") private Long appointmentId; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPolicyholderIdentityId() { return policyholderIdentityId; } public void setPolicyholderIdentityId(String policyholderIdentityId) { this.policyholderIdentityId = policyholderIdentityId; } public String getPlanCode() { return planCode; } public void setPlanCode(String planCode) { this.planCode = planCode; } public Date getPolicyEntryDate() { return policyEntryDate; } public void setPolicyEntryDate(Date policyEntryDate) { this.policyEntryDate = policyEntryDate; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getClosedReason() { return closedReason; } public void setClosedReason(String closedReason) { this.closedReason = closedReason; } public String getClosedOtherReason() { return closedOtherReason; } public void setClosedOtherReason(String closedOtherReason) { this.closedOtherReason = closedOtherReason; } public Long getAppointmentId() { return appointmentId; } public void setAppointmentId(Long appointmentId) { this.appointmentId = appointmentId; } } pamapi/src/main/java/com/pollex/pam/repository/AppointmentClosedInfoRepository.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,11 @@ package com.pollex.pam.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.pollex.pam.domain.AppointmentClosedInfo; @Repository public interface AppointmentClosedInfoRepository extends JpaRepository<AppointmentClosedInfo, Long>{ } pamapi/src/main/java/com/pollex/pam/service/AppointmentClosedInfoService.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,10 @@ package com.pollex.pam.service; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service @Transactional public class AppointmentClosedInfoService { } pamapi/src/main/java/com/pollex/pam/service/dto/AbstractAppointmentProcessDTO.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,28 @@ package com.pollex.pam.service.dto; import com.pollex.pam.enums.ContactStatusEnum; public abstract class AbstractAppointmentProcessDTO{ private ContactStatusEnum contactStatus; private Long appointmentId; public ContactStatusEnum getContactStatus() { return contactStatus; } public void setContactStatus(ContactStatusEnum contactStatus) { this.contactStatus = contactStatus; } public Long getAppointmentId() { return appointmentId; } public void setAppointmentId(Long appointmentId) { this.appointmentId = appointmentId; } } pamapi/src/main/java/com/pollex/pam/service/dto/AppointmentCloseDTO.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,68 @@ package com.pollex.pam.service.dto; import java.util.Date; import com.pollex.pam.enums.ContactStatusEnum; public class AppointmentCloseDTO{ private String policyholderIdentityId; private String planCode; private Date policyEntryDate; private String remark; private String closedReason; private String closedOtherReason; private ContactStatusEnum contactStatus; private Long appointmentId; public String getPolicyholderIdentityId() { return policyholderIdentityId; } public void setPolicyholderIdentityId(String policyholderIdentityId) { this.policyholderIdentityId = policyholderIdentityId; } public String getPlanCode() { return planCode; } public void setPlanCode(String planCode) { this.planCode = planCode; } public Date getPolicyEntryDate() { return policyEntryDate; } public void setPolicyEntryDate(Date policyEntryDate) { this.policyEntryDate = policyEntryDate; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getClosedReason() { return closedReason; } public void setClosedReason(String closedReason) { this.closedReason = closedReason; } public String getClosedOtherReason() { return closedOtherReason; } public void setClosedOtherReason(String closedOtherReason) { this.closedOtherReason = closedOtherReason; } public ContactStatusEnum getContactStatus() { return contactStatus; } public void setContactStatus(ContactStatusEnum contactStatus) { this.contactStatus = contactStatus; } public Long getAppointmentId() { return appointmentId; } public void setAppointmentId(Long appointmentId) { this.appointmentId = appointmentId; } } pamapi/src/main/java/com/pollex/pam/service/dto/ClosedProcessDTO.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,29 @@ package com.pollex.pam.service.dto; public class ClosedProcessDTO extends AbstractAppointmentProcessDTO{ private String remark; private String closedReason; private String closedOtherReason; public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getClosedReason() { return closedReason; } public void setClosedReason(String closedReason) { this.closedReason = closedReason; } public String getClosedOtherReason() { return closedOtherReason; } public void setClosedOtherReason(String closedOtherReason) { this.closedOtherReason = closedOtherReason; } } pamapi/src/main/java/com/pollex/pam/service/dto/DoneProcessDTO.java
¤ñ¹ï·sÀÉ®× @@ -0,0 +1,39 @@ package com.pollex.pam.service.dto; import java.util.Date; public class DoneProcessDTO extends AbstractAppointmentProcessDTO{ private String policyholderIdentityId; private String planCode; private Date policyEntryDate; private String remark; public String getPolicyholderIdentityId() { return policyholderIdentityId; } public void setPolicyholderIdentityId(String policyholderIdentityId) { this.policyholderIdentityId = policyholderIdentityId; } public String getPlanCode() { return planCode; } public void setPlanCode(String planCode) { this.planCode = planCode; } public Date getPolicyEntryDate() { return policyEntryDate; } public void setPolicyEntryDate(Date policyEntryDate) { this.policyEntryDate = policyEntryDate; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } } pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java
@@ -1,14 +1,22 @@ package com.pollex.pam.web.rest; import com.pollex.pam.appointment.process.AppointmentProcess; import com.pollex.pam.domain.Appointment; import com.pollex.pam.enums.ContactStatusEnum; import com.pollex.pam.service.SendMsgService; import com.pollex.pam.service.dto.AppointmentUpdateDTO; import com.pollex.pam.service.dto.ClosedProcessDTO; import com.pollex.pam.service.dto.DoneProcessDTO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import com.pollex.pam.service.AppointmentService; import com.pollex.pam.service.SatisfactionService; import com.pollex.pam.service.dto.AppointmentCloseDTO; import com.pollex.pam.service.dto.AppointmentCreateDTO; import com.pollex.pam.service.dto.AppointmentCustomerViewDTO; @@ -24,6 +32,9 @@ @Autowired SendMsgService sendMsgService; @Autowired AppointmentProcess abstractAppointmentProcess; @PutMapping("") public ResponseEntity<Void> updateAppointment(@RequestBody AppointmentUpdateDTO appointment) { @@ -59,4 +70,24 @@ appointmentService.recordConsultantReadTime(appointmentId); return ResponseEntity.noContent().build(); } @PostMapping("/close") public ResponseEntity<Void> closeAppointment(@RequestBody AppointmentCloseDTO closeDTO) { if(closeDTO.getContactStatus() == ContactStatusEnum.DONE) { DoneProcessDTO dto = new DoneProcessDTO(); BeanUtils.copyProperties(closeDTO, dto); abstractAppointmentProcess.process(dto); }else if(closeDTO.getContactStatus() == ContactStatusEnum.CLOSED){ ClosedProcessDTO dto = new ClosedProcessDTO(); BeanUtils.copyProperties(closeDTO, dto); abstractAppointmentProcess.process(dto); } // Appointment ap = appointmentService.findById(closeDTO.getAppointmentId()); // System.out.println("getClosedInfo().getClosedOtherReason()::"+ap.getClosedInfo().getClosedOtherReason()); return ResponseEntity.noContent().build(); } }