| | |
| | | package com.pollex.pam.web.rest; |
| | | |
| | | import com.pollex.pam.domain.Appointment; |
| | | import com.pollex.pam.domain.Consultant; |
| | | import com.pollex.pam.security.SecurityUtils; |
| | | import com.pollex.pam.service.AppointmentService; |
| | | import com.pollex.pam.service.ConsultantService; |
| | | import com.pollex.pam.service.dto.*; |
| | | import com.pollex.pam.business.aop.logging.audit.AuditLoggingInject; |
| | | import com.pollex.pam.business.domain.Appointment; |
| | | import com.pollex.pam.business.domain.Consultant; |
| | | import com.pollex.pam.business.security.SecurityUtils; |
| | | import com.pollex.pam.business.service.AppointmentService; |
| | | import com.pollex.pam.business.service.ConsultantService; |
| | | import com.pollex.pam.business.service.dto.*; |
| | | import org.apache.commons.compress.utils.IOUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.core.io.Resource; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | import static com.pollex.pam.business.aop.logging.audit.AuditLoggingType.CONSULTANT_SEND_FILL_SATISFACTION_NOTICE; |
| | | import static com.pollex.pam.business.aop.logging.audit.AuditLoggingType.EDIT_CONSULTANT_DATA; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/consultant") |
| | |
| | | |
| | | @Autowired |
| | | ConsultantService consultantService; |
| | | |
| | | |
| | | @Autowired |
| | | AppointmentService appointmentService; |
| | | |
| | |
| | | }else { |
| | | return new ResponseEntity<>(HttpStatus.NOT_FOUND); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @PostMapping("/record/allAppointmentsView") |
| | |
| | | consultantService.recordAllAppointmentsView(); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | |
| | | |
| | | @AuditLoggingInject(type = EDIT_CONSULTANT_DATA) |
| | | @PostMapping("/edit") |
| | | public ResponseEntity<Consultant> editConsultant(@RequestBody ConsultantEditDTO editDTO) { |
| | | if(!editDTO.getAgentNo().equals(SecurityUtils.getAgentNo())) { |
| | |
| | | Consultant editResult = consultantService.editConsultant(editDTO); |
| | | return new ResponseEntity<>(editResult, HttpStatus.OK); |
| | | } |
| | | |
| | | |
| | | @AuditLoggingInject(type = CONSULTANT_SEND_FILL_SATISFACTION_NOTICE) |
| | | @PostMapping("/sendSatisfactionToClient/{appointmentId}") |
| | | public ResponseEntity<Void> sendSatisfactionToClient(@PathVariable Long appointmentId) { |
| | | Appointment appointment = appointmentService.findById(appointmentId); |