保誠-保戶業務員媒合平台
wayne
2022-02-17 4394e4248455637ab7836756058ac872fdf4af10
pamapi/src/main/java/com/pollex/pam/web/rest/SatisfactionResource.java
@@ -2,49 +2,47 @@
import java.util.List;
import com.pollex.pam.enums.SatisfactionTypeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.pollex.pam.domain.Appointment;
import com.pollex.pam.domain.Satisfaction;
import com.pollex.pam.security.SecurityUtils;
import com.pollex.pam.service.SatisfactionService;
import com.pollex.pam.service.dto.SatisfactionCustomerScoreDTO;
import com.pollex.pam.service.dto.SatisfactionDTO;
import com.pollex.pam.service.dto.SatisfactionUpdateDTO;
@RestController
@RequestMapping("/api/satisfaction")
public class SatisfactionResource {
   private final Logger log = LoggerFactory.getLogger(SatisfactionResource.class);
   @Autowired
   SatisfactionService satisfactionService;
   @PostMapping("/score")
   public Satisfaction scorefaction(@RequestBody SatisfactionCustomerScoreDTO scoreDTO) {
      return satisfactionService.scorefaction(scoreDTO);
   }
   @PostMapping("/score/all")
   public List<Satisfaction> scoreAllfaction(@RequestBody List<SatisfactionCustomerScoreDTO> scoreDTO) {
      return satisfactionService.scoreAllfaction(scoreDTO);
   }
   @GetMapping("/getMySatisfaction")
   public List<SatisfactionDTO> getMySatisfaction(){
      if(StringUtils.hasText(SecurityUtils.getAgentNo())) {
         return satisfactionService.getByAgentNo(SecurityUtils.getAgentNo());
         return satisfactionService.getByAgentNoAndType(SecurityUtils.getAgentNo(), SatisfactionTypeEnum.APPOINTMENT);
      }else if(SecurityUtils.getCustomerDBId()!=null){
         return satisfactionService.getByCustomerId(SecurityUtils.getCustomerDBId());
      }