保誠-保戶業務員媒合平台
wayne
2021-11-19 4e54ae39c612c2995e3592121327fa79ded539a9
Merge branch 'build'

修改6個檔案
新增2個檔案
修改1個檔案名稱
297 ■■■■ 已變更過的檔案
pamapi/pom.xml 74 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java 13 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/ConsultantService.java 38 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/LoginService.java 8 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/mapper/ConsultantMapper.java 8 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/web/rest/LoginResource.java 18 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/resources/WEB-INF/jboss-deployment-structure.xml 21 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/resources/WEB-INF/lib/pcalife-otp.jar 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/resources/config/application-sit.yml 117 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/pom.xml
@@ -349,7 +349,27 @@
            <artifactId>pollex</artifactId>
            <version>1.1.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/main/resources/lib/pcalife-otp.jar</systemPath>
            <systemPath>${project.basedir}/src/main/resources/WEB-INF/lib/pcalife-otp.jar</systemPath>
        </dependency>
        <!--
        ç”±æ–¼ wildfly 10 ä¸Šé¢æœƒå‡ºç¾ ModuleNotFoundException: jdk.unsupported:main çš„錯誤
        æ ¹æ“šæŸ¥åˆ°çš„è³‡æ–™ï¼Œç‚º spring-core åœ¨ 5.3.3 ä»¥ä¸Šæ™‚,MANIFEST.MF è¢«åŠ å…¥äº† Dependencies: jdk.unsupported
        è§£æ³•是將 spring core é™è‡³2.3.X,或者 wildfly å‡è‡³ 20 ä»¥ä¸Šï¼Œä½†é€™å…©å€‹æ–¹æ³•皆不容易
        ç›®å‰å‰‡æ”¹ç”±spring core jar內的 MANIFEST.MF åˆªé™¤ Dependencies: jdk.unsupported
        https://stackoverflow.com/questions/65100927/springboot-wildfly-10-deployment-error-jdk-unsupported-module-not-found
        -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>5.3.10</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/WEB-INF/lib/spring-core-5.3.10.jar</systemPath>
        </dependency>
        <!-- jhipster-needle-maven-add-dependency -->
    </dependencies>
@@ -512,6 +532,15 @@
                    <configuration>
                        <warSourceIncludes>WEB-INF/**,META-INF/**</warSourceIncludes>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                        <warSourceDirectory>target/classes/static/</warSourceDirectory>
                        <webResources>
                            <resource>
                                <directory>src/main/resources</directory>
                                <includes>
                                    <include>WEB-INF/**</include>
                                </includes>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>
                <plugin>
@@ -902,6 +931,7 @@
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-undertow</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
@@ -915,11 +945,12 @@
            </properties>
        </profile>
        <profile>
            <id>prod</id>
            <id>sit</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-undertow</artifactId>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
@@ -945,9 +976,44 @@
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- default Spring profiles -->
                <spring.profiles.active>sit${profile.api-docs}${profile.tls}${profile.no-liquibase}</spring.profiles.active>
            </properties>
        </profile>
        <profile>
            <id>prod</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-undertow</artifactId>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.github.git-commit-id</groupId>
                        <artifactId>git-commit-id-maven-plugin</artifactId>
                        <artifactId>maven-clean-plugin</artifactId>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>target/classes/static/</directory>
                                </fileset>
                            </filesets>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>build-info</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
@@ -28,17 +28,16 @@
    @Autowired
    AppointmentDTOMapper appointmentDTOMapper;
    @Autowired
    ConsultantService consultantService;
    @Autowired
    AppointmentCustomerViewMapper appointmentCustomerViewMapper;
    @Autowired
    AppointmentCustomerViewRepository appointmentCustomerViewRepository;
    public void customerCreateAppointment(AppointmentCreateDTO appointmentCreateDTO) {
        Appointment appointment = appointmentDTOMapper.toAppointment(appointmentCreateDTO);
        appointment.setCustomerId(SecurityUtils.getCustomerId());
@@ -51,7 +50,7 @@
    }
    public void markAsContacted(Long appointmentId) {
        Appointment appointment = appointmentRepository.getById(appointmentId);
        appointment.setCommunicateStatus(ContactStatusEnum.CONTACTED);
        appointmentRepository.save(appointment);
@@ -63,7 +62,7 @@
                .orElseThrow(AppointmentNotFoundException::new);
        return appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointment);
    }
    public List<Appointment> findByAgentNoAndCustomerId(String agentNo, Long customerId) {
        return appointmentRepository.findByAgentNoAndCustomerId(agentNo, customerId);
pamapi/src/main/java/com/pollex/pam/service/ConsultantService.java
@@ -13,6 +13,7 @@
import com.pollex.pam.web.rest.errors.ConsultantNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -24,28 +25,23 @@
    private static final Logger log = LoggerFactory.getLogger(ConsultantService.class);
    final ConsultantRepository consultantRepository;
    final CustomerFavoriteConsultantRepository customerFavoriteConsultantRepository;
    final ConsultantMapper consultantMapper;
    final AppointmentService appointmentService;
    final AppointmentCustomerViewRepository appointmentCustomerViewRepository;
    final AppointmentCustomerViewMapper appointmentCustomerViewMapper;
    @Autowired
    ConsultantRepository consultantRepository;
    public ConsultantService(
        ConsultantRepository consultantRepository,
        CustomerFavoriteConsultantRepository customerFavoriteConsultantRepository,
        ConsultantMapper consultantMapper,
        AppointmentService appointmentService,
        AppointmentCustomerViewRepository appointmentCustomerViewRepository,
        AppointmentCustomerViewMapper appointmentCustomerViewMapper
    ) {
        this.consultantRepository = consultantRepository;
        this.customerFavoriteConsultantRepository = customerFavoriteConsultantRepository;
        this.consultantMapper = consultantMapper;
        this.appointmentService = appointmentService;
        this.appointmentCustomerViewRepository = appointmentCustomerViewRepository;
        this.appointmentCustomerViewMapper = appointmentCustomerViewMapper;
    }
    @Autowired
    CustomerFavoriteConsultantRepository customerFavoriteConsultantRepository;
    @Autowired
    ConsultantMapper consultantMapper;
    @Autowired
    AppointmentService appointmentService;
    @Autowired
    AppointmentCustomerViewRepository appointmentCustomerViewRepository;
    @Autowired
    AppointmentCustomerViewMapper appointmentCustomerViewMapper;
    public List<ConsultantDTO> getMyConsultantList() {
        Long userId = SecurityUtils.getCustomerId();
pamapi/src/main/java/com/pollex/pam/service/LoginService.java
@@ -54,12 +54,12 @@
        // å‡è¨­æˆåŠŸäº†ï¼ŒDB的確認
    }
    public ResponseEntity<EServiceResponse> loginByEService(EServiceRequestVM param) throws Exception{
    public ResponseEntity<EServiceResponse> loginByEService(String account, String paxxword) throws Exception{
        EServiceRequest dto = new EServiceRequest();
        dto.setFunc("ValidateUserLogin");
        dto.setId(param.getUsername());
        dto.setPin(param.getPassword());
        dto.setPwd(param.getPassword());
        dto.setId(account);
        dto.setPin(paxxword);
        dto.setPwd(paxxword);
        dto.setSys("epos");
        String dtoJson = new ObjectMapper().writeValueAsString(dto);
pamapi/src/main/java/com/pollex/pam/service/mapper/ConsultantMapper.java
@@ -8,6 +8,7 @@
import com.pollex.pam.service.dto.ConsultantDTO;
import com.pollex.pam.service.dto.ConsultantDetailDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@@ -18,11 +19,8 @@
    private final static Character SPLIT_MASK = ',';
    private final AppointmentService appointmentService;
    public ConsultantMapper(AppointmentService appointmentService) {
        this.appointmentService = appointmentService;
    }
    @Autowired
    AppointmentService appointmentService;
    public ConsultantDTO toDto(Consultant source) {
        ConsultantDTO consultantDTO = new ConsultantDTO();
pamapi/src/main/java/com/pollex/pam/web/rest/LoginResource.java
@@ -33,26 +33,26 @@
        this.applicationProperty = applicationProperty;
    }
    @PostMapping("/bySMS")
    public ResponseEntity<OtpResponseDTO> sendOtpBySMS(@RequestBody OtpSMSLoginVM login) throws ServiceException, RemoteException {
    @GetMapping("/bySMS")
    public ResponseEntity<OtpResponseDTO> sendOtpBySMS(@RequestParam("phone") String phone) throws ServiceException, RemoteException {
        OtpWebServiceLocator locator = new OtpWebServiceLocator();
        locator.setOtpWebServicePortEndpointAddress(applicationProperty.getOtpWebServiceUrl());
        OtpWebServicePortBindingStub otpWebServicePort = (OtpWebServicePortBindingStub) locator.getOtpWebServicePort();
        String[] result =
            otpWebServicePort.sendOtpBySMS(applicationProperty.getOtpWebServicePassword(), applicationProperty.getOtpWebServiceSystemType(), login.getPhone());
            otpWebServicePort.sendOtpBySMS(applicationProperty.getOtpWebServicePassword(), applicationProperty.getOtpWebServiceSystemType(), phone);
        return new ResponseEntity<>(new OtpResponseDTO(result), HttpStatus.OK);
    }
    @PostMapping("/byEmail")
    public ResponseEntity<OtpResponseDTO> sendOtpByEmail(@RequestBody OtpEmailLoginVM login) throws RemoteException, ServiceException {
    @GetMapping("/byEmail")
    public ResponseEntity<OtpResponseDTO> sendOtpByEmail(@RequestParam("email") String email) throws RemoteException, ServiceException {
        OtpWebServiceLocator locator = new OtpWebServiceLocator();
        locator.setOtpWebServicePortEndpointAddress(applicationProperty.getOtpWebServiceUrl());
        OtpWebServicePortBindingStub otpWebServicePort = (OtpWebServicePortBindingStub) locator.getOtpWebServicePort();
        String[] result =
            otpWebServicePort.sendOtpByEmail(applicationProperty.getOtpWebServicePassword(), applicationProperty.getOtpWebServiceSystemType(), login.getEmail());
            otpWebServicePort.sendOtpByEmail(applicationProperty.getOtpWebServicePassword(), applicationProperty.getOtpWebServiceSystemType(), email);
        return new ResponseEntity<>(new OtpResponseDTO(result), HttpStatus.OK);
    }
@@ -64,8 +64,8 @@
    }
    // todo: é€™è£¡ç§»å‹•到認證授權的provider
    @PostMapping("/byEService")
    public ResponseEntity<EServiceResponse> loginByEService(@RequestBody EServiceRequestVM param) throws Exception {
        return loginService.loginByEService(param);
    @GetMapping("/byEService")
    public ResponseEntity<EServiceResponse> loginByEService(@RequestParam("account") String account, @RequestParam("password") String password) throws Exception {
        return loginService.loginByEService(account, password);
    }
}
pamapi/src/main/resources/WEB-INF/jboss-deployment-structure.xml
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,21 @@
<jboss-deployment-structure>
<deployment>
   <exclusions>
      <module name="com.fasterxml.jackson.core.jackson-core" />
      <module name="com.fasterxml.jackson.core.jackson-databind" />
      <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
      <module name="com.fasterxml.jackson.datatype.jackson-datatype-jdk8" />
      <module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" />
      <module name="org.jboss.resteasy.resteasy-jackson2-provider" />
      <module name="org.apache.commons.logging" />
      <module name="org.slf4j" />
      <module name="org.slf4j.ext" />
      <module name="org.slf4j.impl" />
      <module name="org.apache.log4j" />
   </exclusions>
   <exclude-subsystems>
      <subsystem name="jpa" />
      <subsystem name="weld" />
   </exclude-subsystems>
</deployment>
</jboss-deployment-structure>
pamapi/src/main/resources/WEB-INF/lib/pcalife-otp.jar
Binary files differ
pamapi/src/main/resources/config/application-sit.yml
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,117 @@
# ===================================================================
# Spring Boot configuration for the "sit" profile.
#
# This configuration overrides the application.yml file.
#
# More information on profiles: https://www.jhipster.tech/profiles/
# More information on configuration properties: https://www.jhipster.tech/common-application-properties/
# ===================================================================
# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================
logging:
  level:
    ROOT: DEBUG
    tech.jhipster: DEBUG
    org.hibernate.SQL: DEBUG
    com.pollex.pam: DEBUG
spring:
  devtools:
    restart:
      enabled: true
      additional-exclude: static/**
    livereload:
      enabled: false # we use Webpack dev server + BrowserSync for livereload
  jackson:
    serialization:
      indent-output: true
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:postgresql://VTWLIFELDPOS01:5006/omo?currentSchema=omo
    username: omo_svc
    password: omo_svc-100784c
    hikari:
      poolName: Hikari
      auto-commit: false
  jpa:
    database-platform: tech.jhipster.domain.util.FixedPostgreSQL10Dialect
  liquibase:
    # Remove 'faker' if you do not want the sample data to be loaded automatically
    contexts: dev, faker
  mail:
    host: localhost
    port: 25
    username:
    password:
  messages:
    cache-duration: PT1S # 1 second, see the ISO 8601 standard
  thymeleaf:
    cache: false
  sleuth:
    sampler:
      probability: 1 # report 100% of traces
  zipkin: # Use the "zipkin" Maven profile to have the Spring Cloud Zipkin dependencies
    base-url: http://localhost:9411
    enabled: false
    locator:
      discovery:
        enabled: true
server:
  port: 8080
# ===================================================================
# JHipster specific properties
#
# Full reference is available at: https://www.jhipster.tech/common-application-properties/
# ===================================================================
jhipster:
  cache: # Cache configuration
    ehcache: # Ehcache configuration
      time-to-live-seconds: 3600 # By default objects stay 1 hour in the cache
      max-entries: 100 # Number of objects in each cache entry
  #  cors:
  #    # Allow Ionic for JHipster by default (* no longer allowed in Spring Boot 2.4+)
  #    allowed-origins: 'http://localhost:8100,https://localhost:8100,http://localhost:9000,https://localhost:9000'
  #    allowed-methods: '*'
  #    allowed-headers: '*'
  #    exposed-headers: 'Authorization,Link,X-Total-Count,X-${jhipster.clientApp.name}-alert,X-${jhipster.clientApp.name}-error,X-${jhipster.clientApp.name}-params'
  #    allow-credentials: true
  #    max-age: 1800
  security:
    authentication:
      jwt:
        # This token must be encoded using Base64 and be at least 256 bits long (you can type `openssl rand -base64 64` on your command line to generate a 512 bits one)
        base64-secret: MjI3YWRiMzg1ZTY3ZmZkZDgxZmI5Yjc5YjVkOTIzMzc4MmI2OWM3NWVkZjFiOTNmNjg0YWFjZWQ4YzhlOTUzYzk3MGUzMzM5Y2U5MDdkZTMyN2Q0N2E0M2ZmM2FhYzkyNDY4MjBkYTY5OGM4YmIzMmYxODJhNWFkMmVhNmVhNTM=
        # Token is valid 24 hours
        token-validity-in-seconds: 86400
        token-validity-in-seconds-for-remember-me: 2592000
  mail: # specific JHipster mail property, for standard properties see MailProperties
    base-url: http://127.0.0.1:8080
  logging:
    use-json-format: false # By default, logs are not in Json format
    logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration
      enabled: false
      host: localhost
      port: 5000
      queue-size: 512
# ===================================================================
# Application specific properties
# Add your own application properties here, see the ApplicationProperties class
# to have type-safe configuration, like in the JHipsterProperties above
#
# More documentation is available at:
# https://www.jhipster.tech/common-application-properties/
# ===================================================================
application:
  otp-web-service-url: https://vtwlifeopensyssit.pru.intranet.asia:443/pcalife-otp/ws/otpWebService
  otp-web-service-password: es20!%Pass
  otp-web-service-system-type: epos
  e-service-login-url: https://ssotwsit.eservice.pcalife.com.tw/sso/acctValidate