完成登录功能。

This commit is contained in:
2023-04-28 17:46:54 +08:00
parent 6869294c26
commit 0fb93d0ccd
10 changed files with 187 additions and 80 deletions

View File

@@ -11,12 +11,14 @@ package com.cpic.xim.web.controllers.account;
import java.sql.SQLException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cpic.xim.utils.account.CpicXIMStaffInfo;
import com.cpic.xim.utils.account.TeleSalerInfo;
@Controller
@RequestMapping( "/account" )
public class StaffInfoQueryController
@@ -62,23 +64,34 @@ public class StaffInfoQueryController
*/
@RequestMapping( "/query_telsaler_info.do" )
@ResponseBody
public TeleSalerQueryResult queryTeleSalerInfo( @RequestParam("telesaler_code") String teleSalerCode )
public TeleSalerQueryResult queryTeleSalerInfo(
@RequestBody TelsalerQueryRequest telSaler )
{
TeleSalerQueryResult result = new TeleSalerQueryResult();
TeleSalerInfo saler = null;
try
{
saler = TeleSalerInfo.queryTeleSalerInfo( teleSalerCode );
saler = TeleSalerInfo.queryTeleSalerInfo( telSaler.getTelSalerCode() );
result.setTeleSalerCode( saler.getCode() );
result.setTeleSalerName( saler.getName() );
result.setTeamCode( saler.getTeamCode() );
result.setTeamName( saler.getTeamName() );
result.setDepartmentCode( saler.getDepartmentCode() );
result.setDepartmentName( saler.getDepartmentName() );
// 根据返回结果是否为 null判断是否查询到坐席信息
if ( saler != null )
{
// 不为 null有查询到
result.setTeleSalerCode( saler.getCode() );
result.setTeleSalerName( saler.getName() );
result.setTeamCode( saler.getTeamCode() );
result.setTeamName( saler.getTeamName() );
result.setDepartmentCode( saler.getDepartmentCode() );
result.setDepartmentName( saler.getDepartmentName() );
result.setSuccess( true );
result.setSuccess( true );
} else
{
// 为 null 则没查询到
result.setSuccess( false );
result.setMessage( "未查询到坐席信息!" );
}
}
catch ( SQLException error )
{

View File

@@ -0,0 +1,35 @@
/*
* @Author: Kane
* @Date: 2023-04-28 14:40:49
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/account/TelsalerQueryRequest.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.account;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TelsalerQueryRequest
{
public TelsalerQueryRequest() {}
public TelsalerQueryRequest( String telSalerCode )
{
this.telSalerCode = telSalerCode;
}
public String getTelSalerCode()
{
return telSalerCode;
}
public void setTelSalerCode( String telSalerCode )
{
this.telSalerCode = telSalerCode;
}
@JsonProperty("telsaler_code")
private String telSalerCode;
}