pamapi/src/doc/滿意度/客戶填寫平台滿意度.txt | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
pamapi/src/doc/滿意度/客戶填寫滿意度問卷.txt | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
pamapi/src/main/java/com/pollex/pam/service/SatisfactionService.java | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
pamapi/src/main/java/com/pollex/pam/service/dto/SatisfactionCustomerScoreDTO.java | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
pamapi/src/main/java/com/pollex/pam/service/dto/SatisfactionSystemScoreDTO.java | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 | |
pamapi/src/main/java/com/pollex/pam/web/rest/SatisfactionResource.java | ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程 |
pamapi/src/doc/º¡·N«×/«È¤á¶ñ¼g¥¥xº¡·N«×.txt
Àɮפw§R°£ pamapi/src/doc/º¡·N«×/«È¤á¶ñ¼gº¡·N«×°Ý¨÷.txt
@@ -8,8 +8,9 @@ request body: { "satisfactionId": 84, "score":4 "appointmentId": 482, "score":4, "type": "APPOINTMENT" // "APPOINTMENT" 表éå°æ¤æ¬¡é ç´çé¡§åæ»¿æåº¦ã "SYSTEM" 忝éå°å¹³å°ç滿æåº¦ } response body: @@ -33,8 +34,9 @@ request body: [{ "satisfactionId": 84, "score":4 "appointmentId": 482, "score":4, "type": "APPOINTMENT" // "APPOINTMENT" 表éå°æ¤æ¬¡é ç´çé¡§åæ»¿æåº¦ã "SYSTEM" 忝éå°å¹³å°ç滿æåº¦ }] pamapi/src/main/java/com/pollex/pam/service/SatisfactionService.java
@@ -6,7 +6,6 @@ import com.pollex.pam.enums.SatisfactionTypeEnum; import com.pollex.pam.security.SecurityUtils; import com.pollex.pam.service.dto.SatisfactionSystemScoreDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -26,6 +25,7 @@ import com.pollex.pam.service.mapper.SatisfactionMapper; import com.pollex.pam.web.rest.errors.SatisfactionAlreadyExistException; import com.pollex.pam.web.rest.errors.SatisfactionNotFoundException; import org.springframework.util.Assert; @Service @Transactional @@ -66,8 +66,12 @@ } public Satisfaction scorefaction(SatisfactionCustomerScoreDTO scoreDTO) { Optional<Satisfaction> satisfactionOP = satisfactionRepository.findById(scoreDTO.getSatisfactionId()); Optional<Satisfaction> satisfactionOP = satisfactionRepository.findOneByAppointmentIdAndType(scoreDTO.getAppointmentId(), scoreDTO.getType()); Satisfaction satisfaction = satisfactionOP.orElseThrow(SatisfactionNotFoundException::new); boolean isSameCustomer = satisfaction.getCustomerId().equals(SecurityUtils.getCustomerDBId()); Assert.isTrue(isSameCustomer, "The currently logged in customer has a different ID than the customer on Satisfaction"); satisfaction.setScore(scoreDTO.getScore()); satisfaction.setStatus(SatisfactionStatusEnum.FILLED); save(satisfaction); @@ -126,15 +130,5 @@ satisfaction.setType(SatisfactionTypeEnum.SYSTEM); satisfactionRepository.save(satisfaction); } public Satisfaction fillSystemSatisfaction(SatisfactionSystemScoreDTO scoreDTO) { Optional<Satisfaction> systemSatisfactionOptional = satisfactionRepository.findOneByAppointmentIdAndType(scoreDTO.getAppointmentId(), SatisfactionTypeEnum.SYSTEM); Satisfaction satisfaction = systemSatisfactionOptional.orElseThrow(SatisfactionNotFoundException::new); satisfaction.setStatus(SatisfactionStatusEnum.FILLED); satisfaction.setScore(scoreDTO.getScore()); return satisfactionRepository.save(satisfaction); } } pamapi/src/main/java/com/pollex/pam/service/dto/SatisfactionCustomerScoreDTO.java
@@ -1,15 +1,18 @@ package com.pollex.pam.service.dto; import com.pollex.pam.enums.SatisfactionTypeEnum; public class SatisfactionCustomerScoreDTO { private Long satisfactionId; private Long appointmentId; private Float score; private SatisfactionTypeEnum type; public Long getSatisfactionId() { return satisfactionId; public Long getAppointmentId() { return appointmentId; } public void setSatisfactionId(Long satisfactionId) { this.satisfactionId = satisfactionId; public void setAppointmentId(Long appointmentId) { this.appointmentId = appointmentId; } public Float getScore() { return score; @@ -17,4 +20,10 @@ public void setScore(Float score) { this.score = score; } public SatisfactionTypeEnum getType() { return type; } public void setType(SatisfactionTypeEnum type) { this.type = type; } } pamapi/src/main/java/com/pollex/pam/service/dto/SatisfactionSystemScoreDTO.java
Àɮפw§R°£ pamapi/src/main/java/com/pollex/pam/web/rest/SatisfactionResource.java
@@ -3,7 +3,6 @@ import java.util.List; import com.pollex.pam.enums.SatisfactionTypeEnum; import com.pollex.pam.service.dto.SatisfactionSystemScoreDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -50,9 +49,4 @@ log.error("Not has agent code and customer id"); throw new IllegalArgumentException("Not has agent code and customer id"); } @PostMapping("/system/score") public Satisfaction fillSystemSatisfaction(@RequestBody SatisfactionSystemScoreDTO scoreDTO) { return satisfactionService.fillSystemSatisfaction(scoreDTO); } }