Compare commits
4 Commits
feature-pe
...
7ea11e34a9
Author | SHA1 | Date | |
---|---|---|---|
7ea11e34a9 | |||
2edd5f67db | |||
efebd548c6 | |||
22157b11eb |
@@ -157,7 +157,7 @@ module.exports = {
|
|||||||
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
|
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"@typescript-eslint/no-explicit-any": "warn",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/indent": ["error", 4,],
|
"@typescript-eslint/indent": ["error", 4,],
|
||||||
"@typescript-eslint/no-extra-semi": "off",
|
"@typescript-eslint/no-extra-semi": "off",
|
||||||
"@typescript-eslint/no-inferrable-types": "off",
|
"@typescript-eslint/no-inferrable-types": "off",
|
||||||
|
@@ -12,4 +12,7 @@
|
|||||||
|
|
||||||
// testRankingListRequest();
|
// testRankingListRequest();
|
||||||
|
|
||||||
|
const arr: string[] = [];
|
||||||
|
|
||||||
console.log( "test" );
|
console.log( "test" );
|
||||||
|
console.log( "检查instanceof:", arr instanceof String );
|
||||||
|
@@ -26,4 +26,12 @@ export const API_URL = {
|
|||||||
|
|
||||||
// 坐席业绩查询
|
// 坐席业绩查询
|
||||||
URL_CALLER_ARCHIEVEMENT: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_caller_archievement.do",
|
URL_CALLER_ARCHIEVEMENT: "http://10.39.0.41:8081/desktop_archievement_backend/archievement/query_caller_archievement.do",
|
||||||
|
|
||||||
|
/** 奖项相关 **/
|
||||||
|
// 查询奖励项目
|
||||||
|
// URL_RWARD_PROJECTS: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/query_reward_projects.do"
|
||||||
|
URL_RWARD_PROJECTS: "http://10.39.0.41:8081/desktop_archievement_backend/rewards/query_reward_projects.do",
|
||||||
|
// 查询获奖人员
|
||||||
|
// URL_REWARD_GAINERS: "http://{{生产地址}}/desktop_archievement_backend/rewards/query_reward_gainers.do"
|
||||||
|
URL_REWARD_GAINERS: "http://222.76.244.118:11101/desktop_archievement_backend/rewards/query_reward_gainers.do",
|
||||||
};
|
};
|
||||||
|
179
code/web/task_schedule/src/utils/reward.ts
Normal file
179
code/web/task_schedule/src/utils/reward.ts
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-11 09:59:00
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /task_schedule/src/utils/reward.ts
|
||||||
|
* @Description: 奖励相关的API
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
import { type AxiosResponse } from "axios";
|
||||||
|
import { service as instance } from "./api/request.js";
|
||||||
|
import { API_URL } from "./api/config.js";
|
||||||
|
|
||||||
|
interface RewardProject
|
||||||
|
{
|
||||||
|
rewardCode: number;
|
||||||
|
rewardName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RewardProjectResponse
|
||||||
|
{
|
||||||
|
success: boolean;
|
||||||
|
message: string;
|
||||||
|
rewardList: RewardProject[] | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RewardGainer
|
||||||
|
{
|
||||||
|
acquiredDate: string;
|
||||||
|
callerName: string;
|
||||||
|
callerCode: string;
|
||||||
|
rewardProjectCode: string;
|
||||||
|
rewardProjectName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RewardGainerResponse
|
||||||
|
{
|
||||||
|
success: boolean;
|
||||||
|
message: string;
|
||||||
|
gainerList: RewardGainer[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求奖项清单
|
||||||
|
* @param handler 用于处理请求数据的回调函数;
|
||||||
|
*/
|
||||||
|
function requestRewardPorjectsList( handler: any ): void
|
||||||
|
{
|
||||||
|
if ( handler === undefined || handler === null )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const rewardResponse: RewardProjectResponse = {
|
||||||
|
success: false,
|
||||||
|
message: "",
|
||||||
|
rewardList: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
instance.request({
|
||||||
|
url: API_URL.URL_RWARD_PROJECTS,
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
// 请求成功,检查服务器返回结果
|
||||||
|
.then(( response: AxiosResponse<any, any> ): void =>
|
||||||
|
{
|
||||||
|
const data = response.data ?? {};
|
||||||
|
rewardResponse.success = data.success ?? false;
|
||||||
|
rewardResponse.message = data.message ?? "";
|
||||||
|
rewardResponse.rewardList = checkRewardProjects( data.rewardList ?? []);
|
||||||
|
|
||||||
|
handler( rewardResponse, null );
|
||||||
|
})
|
||||||
|
.catch(( error: any ): void =>
|
||||||
|
{
|
||||||
|
console.log( error );
|
||||||
|
|
||||||
|
rewardResponse.success = false;
|
||||||
|
|
||||||
|
handler( rewardResponse, error );
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param handler
|
||||||
|
*/
|
||||||
|
function requestRewardGainers( handler: any ): void
|
||||||
|
{
|
||||||
|
if ( handler === undefined || handler === null )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const rewardResponse: RewardGainerResponse = {
|
||||||
|
success: false,
|
||||||
|
message: "",
|
||||||
|
gainerList: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
instance.request({
|
||||||
|
url: API_URL.URL_REWARD_GAINERS,
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
.then(( response: AxiosResponse<any, any> ): void =>
|
||||||
|
{
|
||||||
|
const data = response.data ?? {};
|
||||||
|
|
||||||
|
rewardResponse.success = data.success;
|
||||||
|
rewardResponse.message = data.message;
|
||||||
|
rewardResponse.gainerList = data.gainerList;
|
||||||
|
|
||||||
|
handler( rewardResponse, null );
|
||||||
|
})
|
||||||
|
.catch(( error: any ): void =>
|
||||||
|
{
|
||||||
|
console.log( error );
|
||||||
|
|
||||||
|
rewardResponse.success = false;
|
||||||
|
|
||||||
|
handler( rewardResponse, error );
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// **功能函数 **********************************/
|
||||||
|
function checkRewardProjects( data: any[]): RewardProject[] | null
|
||||||
|
{
|
||||||
|
const rewardList: RewardProject[] = [];
|
||||||
|
|
||||||
|
// 检查一下参数的类型,如果不是数组返回 null
|
||||||
|
if ( !( data instanceof Array ))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.forEach(( item: any ) =>
|
||||||
|
{
|
||||||
|
const reward = {
|
||||||
|
rewardCode: item.rewardCode ?? "",
|
||||||
|
rewardName: item.rewardName ?? "",
|
||||||
|
};
|
||||||
|
|
||||||
|
rewardList.push( reward );
|
||||||
|
});
|
||||||
|
|
||||||
|
return rewardList;
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkRewardGainers( gainers: any[]): RewardGainer[] | null
|
||||||
|
{
|
||||||
|
const gainerList: RewardGainer[] = [];
|
||||||
|
|
||||||
|
if ( !( gainers instanceof Array ))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
gainers.forEach(( item: RewardGainer ): void =>
|
||||||
|
{
|
||||||
|
const gainer: RewardGainer = {
|
||||||
|
acquiredDate: item.acquiredDate ?? "",
|
||||||
|
callerName: item.callerName ?? "",
|
||||||
|
callerCode: item.callerCode ?? "",
|
||||||
|
rewardProjectCode: item.rewardProjectCode ?? "",
|
||||||
|
rewardProjectName: item.rewardProjectName ?? "",
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return gainerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
type RewardProject,
|
||||||
|
type RewardGainer,
|
||||||
|
type RewardProjectResponse,
|
||||||
|
type RewardGainerResponse,
|
||||||
|
requestRewardPorjectsList,
|
||||||
|
requestRewardGainers
|
||||||
|
};
|
@@ -2,25 +2,147 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2023-03-23 16:05:08
|
* @Date: 2023-03-23 16:05:08
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @FilePath: /task_schedule/src/views/DataManagemant.vue
|
* @FilePath: /task_schedule/src/views/DataManagement.vue
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="wrapper">
|
||||||
数据管理
|
<div class="reward-wrapper">
|
||||||
|
<div class="reward-gainer-wrapper">
|
||||||
|
<el-divider content-position="left">
|
||||||
|
90俱乐部
|
||||||
|
</el-divider>
|
||||||
|
<div class="toolbutton-wrapper">
|
||||||
|
<el-button type="primary">
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button type="danger">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
style="width:100%;"
|
||||||
|
:height="tableHeight"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" />
|
||||||
|
<el-table-column
|
||||||
|
label="坐席名称"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="奖项名称"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { reactive, computed } from "vue";
|
||||||
|
import {
|
||||||
|
type RewardProject,
|
||||||
|
type RewardGainer,
|
||||||
|
type RewardProjectResponse,
|
||||||
|
type RewardGainerResponse,
|
||||||
|
requestRewardPorjectsList,
|
||||||
|
requestRewardGainers
|
||||||
|
} from "@/utils/reward.js";
|
||||||
|
|
||||||
|
interface UI
|
||||||
|
{
|
||||||
|
rewardGainerList: RewardGainer[];
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DataManagement",
|
name: "DataManagement",
|
||||||
setup()
|
setup()
|
||||||
{
|
{
|
||||||
return {};
|
const ui: UI = reactive({
|
||||||
|
rewardGainerList: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const tableHeight = computed((): number =>
|
||||||
|
{
|
||||||
|
return 5 * 50 + 40;
|
||||||
|
});
|
||||||
|
|
||||||
|
const applyGainerList = ( response: RewardGainerResponse ): void =>
|
||||||
|
{
|
||||||
|
if ( response.success )
|
||||||
|
{
|
||||||
|
ui.rewardGainerList = response.gainerList;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
ui,
|
||||||
|
tableHeight,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import "@/assets/css/public/_public.scss";
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
// background-color: #fff;
|
||||||
|
// border-radius: 5px;
|
||||||
|
// box-shadow: $box-shadow;
|
||||||
|
|
||||||
|
// &:hover {
|
||||||
|
// box-shadow: $box-shadow-hover;
|
||||||
|
// }
|
||||||
|
|
||||||
|
min-width: 800px;
|
||||||
|
|
||||||
|
>*+* {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.reward-wrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
>div {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: $box-shadow;
|
||||||
|
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
box-shadow: $box-shadow-hover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
>*+* {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.reward-gainer-wrapper {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dishonor-wrapper {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbutton-wrapper {
|
||||||
|
text-align: left;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
>*+* {
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -12,8 +12,13 @@ package com.cpic.xim.mybatis.mapper;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||||
|
|
||||||
public interface RewardsMapper
|
public interface RewardsMapper
|
||||||
{
|
{
|
||||||
public ArrayList<RewardProject> queryRewardProjects();
|
public ArrayList<RewardProject> queryRewardProjects();
|
||||||
|
|
||||||
|
public ArrayList<RewardGainer> queryRewardGainers();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,156 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-07 15:18:46
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/RewardGainer.java
|
||||||
|
* @Description: 获奖人对象
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
package com.cpic.xim.mybatis.pojo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
public class RewardGainer
|
||||||
|
{
|
||||||
|
public RewardGainer() {}
|
||||||
|
|
||||||
|
public RewardGainer( String acquiredDate, String callerName, String callerCode,
|
||||||
|
String rewardProjectCode, String rewardProjectName)
|
||||||
|
{
|
||||||
|
this.acquiredDate = acquiredDate;
|
||||||
|
this.callerName = callerName;
|
||||||
|
this.callerCode = callerCode;
|
||||||
|
this.rewardProjectCode = rewardProjectCode;
|
||||||
|
this.rewardProjectName = rewardProjectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "RewardGainer [acquiredDate=" + acquiredDate + ", callerName=" + callerName
|
||||||
|
+ ", callerCode=" + callerCode + ", rewardProjectCode=" + rewardProjectCode
|
||||||
|
+ ", rewardProjectName=" + rewardProjectName + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((acquiredDate == null) ? 0 : acquiredDate.hashCode());
|
||||||
|
result = prime * result + ((callerName == null) ? 0 : callerName.hashCode());
|
||||||
|
result = prime * result + ((callerCode == null) ? 0 : callerCode.hashCode());
|
||||||
|
result = prime * result + ((rewardProjectCode == null) ? 0 : rewardProjectCode.hashCode());
|
||||||
|
result = prime * result + ((rewardProjectName == null) ? 0 : rewardProjectName.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals( Object obj )
|
||||||
|
{
|
||||||
|
if ( this == obj )
|
||||||
|
return true;
|
||||||
|
if ( obj == null )
|
||||||
|
return false;
|
||||||
|
if ( getClass() != obj.getClass() )
|
||||||
|
return false;
|
||||||
|
RewardGainer other = (RewardGainer) obj;
|
||||||
|
if ( acquiredDate == null )
|
||||||
|
{
|
||||||
|
if ( other.acquiredDate != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !acquiredDate.equals( other.acquiredDate ) )
|
||||||
|
return false;
|
||||||
|
if ( callerName == null )
|
||||||
|
{
|
||||||
|
if ( other.callerName != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !callerName.equals( other.callerName ) )
|
||||||
|
return false;
|
||||||
|
if ( callerCode == null )
|
||||||
|
{
|
||||||
|
if ( other.callerCode != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !callerCode.equals( other.callerCode ) )
|
||||||
|
return false;
|
||||||
|
if ( rewardProjectCode == null )
|
||||||
|
{
|
||||||
|
if ( other.rewardProjectCode != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !rewardProjectCode.equals( other.rewardProjectCode ) )
|
||||||
|
return false;
|
||||||
|
if ( rewardProjectName == null )
|
||||||
|
{
|
||||||
|
if ( other.rewardProjectName != null )
|
||||||
|
return false;
|
||||||
|
} else if ( !rewardProjectName.equals( other.rewardProjectName ) )
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAcquiredDate()
|
||||||
|
{
|
||||||
|
return acquiredDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAcquiredDate( String acquiredDate )
|
||||||
|
{
|
||||||
|
this.acquiredDate = acquiredDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCallerName()
|
||||||
|
{
|
||||||
|
return callerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallerName( String callerName )
|
||||||
|
{
|
||||||
|
this.callerName = callerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCallerCode()
|
||||||
|
{
|
||||||
|
return callerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallerCode( String callerCode )
|
||||||
|
{
|
||||||
|
this.callerCode = callerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRewardProjectCode()
|
||||||
|
{
|
||||||
|
return rewardProjectCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardProjectCode( String rewardProjectCode )
|
||||||
|
{
|
||||||
|
this.rewardProjectCode = rewardProjectCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRewardProjectName()
|
||||||
|
{
|
||||||
|
return rewardProjectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRewardProjectName( String rewardProjectName )
|
||||||
|
{
|
||||||
|
this.rewardProjectName = rewardProjectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty( "acquiredDate" )
|
||||||
|
private String acquiredDate;
|
||||||
|
|
||||||
|
@JsonProperty( "callerName" )
|
||||||
|
private String callerName;
|
||||||
|
|
||||||
|
@JsonProperty( "callerCode" )
|
||||||
|
private String callerCode;
|
||||||
|
|
||||||
|
@JsonProperty( "rewardProjectCode" )
|
||||||
|
private String rewardProjectCode;
|
||||||
|
|
||||||
|
@JsonProperty( "rewardProjectName" )
|
||||||
|
private String rewardProjectName;
|
||||||
|
}
|
@@ -11,14 +11,14 @@ package com.cpic.xim.web.controllers;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class QueryResult {
|
public class QueryResponse {
|
||||||
|
|
||||||
public QueryResult(boolean success, String message) {
|
public QueryResponse(boolean success, String message) {
|
||||||
this.success = success;
|
this.success = success;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryResult() {
|
public QueryResponse() {
|
||||||
this.success = false;
|
this.success = false;
|
||||||
this.message = "";
|
this.message = "";
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ public class QueryResult {
|
|||||||
if (this == obj) return true;
|
if (this == obj) return true;
|
||||||
if (obj == null) return false;
|
if (obj == null) return false;
|
||||||
if (getClass() != obj.getClass()) return false;
|
if (getClass() != obj.getClass()) return false;
|
||||||
QueryResult other = (QueryResult) obj;
|
QueryResponse other = (QueryResponse) obj;
|
||||||
if (success != other.success) return false;
|
if (success != other.success) return false;
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
if (other.message != null) return false;
|
if (other.message != null) return false;
|
@@ -9,10 +9,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.cpic.xim.web.controllers.account;
|
package com.cpic.xim.web.controllers.account;
|
||||||
|
|
||||||
import com.cpic.xim.web.controllers.QueryResult;
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class TeleSalerQueryResult extends QueryResult
|
public class TeleSalerQueryResult extends QueryResponse
|
||||||
{
|
{
|
||||||
|
|
||||||
public TeleSalerQueryResult()
|
public TeleSalerQueryResult()
|
||||||
|
@@ -11,10 +11,10 @@ package com.cpic.xim.web.controllers.archievement.RankingList;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import com.cpic.xim.utils.ranking.CallerRankingItem;
|
import com.cpic.xim.utils.ranking.CallerRankingItem;
|
||||||
import com.cpic.xim.web.controllers.QueryResult;
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class RankingListResponse extends QueryResult
|
public class RankingListResponse extends QueryResponse
|
||||||
{
|
{
|
||||||
public RankingListResponse()
|
public RankingListResponse()
|
||||||
{
|
{
|
||||||
|
@@ -10,11 +10,11 @@
|
|||||||
package com.cpic.xim.web.controllers.archievement.caller;
|
package com.cpic.xim.web.controllers.archievement.caller;
|
||||||
|
|
||||||
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||||
import com.cpic.xim.web.controllers.QueryResult;
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class CallerArchievementQueryResult extends QueryResult
|
public class CallerArchievementQueryResult extends QueryResponse
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@@ -14,14 +14,14 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||||
import com.cpic.xim.web.controllers.QueryResult;
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门业绩返回结果。
|
* 查询部门业绩返回结果。
|
||||||
* MensualArchievementList 每月业绩,要保证数据是按照月份排序。
|
* MensualArchievementList 每月业绩,要保证数据是按照月份排序。
|
||||||
*/
|
*/
|
||||||
public class DepartmentArchievementQueryResult extends QueryResult
|
public class DepartmentArchievementQueryResult extends QueryResponse
|
||||||
{
|
{
|
||||||
public DepartmentArchievementQueryResult()
|
public DepartmentArchievementQueryResult()
|
||||||
{
|
{
|
||||||
@@ -46,7 +46,8 @@ public class DepartmentArchievementQueryResult extends QueryResult
|
|||||||
return mensualArchievementList;
|
return mensualArchievementList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMensualArchievementList( ArrayList<MensualArchievementItem> mensualArchievementList )
|
public void setMensualArchievementList(
|
||||||
|
ArrayList<MensualArchievementItem> mensualArchievementList )
|
||||||
{
|
{
|
||||||
this.mensualArchievementList = mensualArchievementList;
|
this.mensualArchievementList = mensualArchievementList;
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.cpic.xim.mybatis.mapper.RewardsMapper;
|
import com.cpic.xim.mybatis.mapper.RewardsMapper;
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||||
|
|
||||||
@@ -29,7 +30,8 @@ public class RewardController
|
|||||||
// 日志
|
// 日志
|
||||||
private static Logger logger = LoggerFactory.getLogger( RewardController.class );
|
private static Logger logger = LoggerFactory.getLogger( RewardController.class );
|
||||||
|
|
||||||
private RewardController() {}
|
private RewardController()
|
||||||
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 相应查询获奖项目清单的请求
|
* 相应查询获奖项目清单的请求
|
||||||
@@ -43,6 +45,8 @@ public class RewardController
|
|||||||
|
|
||||||
SqlSession session = null;
|
SqlSession session = null;
|
||||||
|
|
||||||
|
logger.debug( "查询奖项清单。" );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
session = MybatisUtils.getSqlSession();
|
session = MybatisUtils.getSqlSession();
|
||||||
@@ -53,12 +57,43 @@ public class RewardController
|
|||||||
response.setSuccess( true );
|
response.setSuccess( true );
|
||||||
response.setMessage( "查询成功!" );
|
response.setMessage( "查询成功!" );
|
||||||
response.setRewardList( rewards );
|
response.setRewardList( rewards );
|
||||||
|
|
||||||
|
logger.debug( "查询奖项清单," + response.getMessage() + "," + rewards.toString() );
|
||||||
}
|
}
|
||||||
catch ( IOException error )
|
catch ( IOException error )
|
||||||
{
|
{
|
||||||
response.setSuccess( false );
|
response.setSuccess( false );
|
||||||
response.setMessage( "查询失败!" + error.getMessage() );
|
response.setMessage( "查询失败!" + error.getMessage() );
|
||||||
response.setRewardList( null );
|
response.setRewardList( null );
|
||||||
|
|
||||||
|
logger.debug( "查询奖项清单," + response.getMessage() + "," + error.getMessage() );
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping( "/query_reward_gainers.do" )
|
||||||
|
@ResponseBody
|
||||||
|
RewardGainersResponse queryRewardGainers()
|
||||||
|
{
|
||||||
|
RewardGainersResponse response = new RewardGainersResponse();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SqlSession session = MybatisUtils.getSqlSession();
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
|
||||||
|
ArrayList<RewardGainer> gainers = mapper.queryRewardGainers();
|
||||||
|
|
||||||
|
response.setSuccess( true );
|
||||||
|
response.setMessage( "查询成功!" );
|
||||||
|
response.setGainerList( gainers );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
response.setSuccess( false );
|
||||||
|
response.setMessage( "查询失败!" + error.getMessage() );
|
||||||
|
response.setGainerList( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Kane
|
||||||
|
* @Date: 2023-09-07 17:16:12
|
||||||
|
* @LastEditors: Kane
|
||||||
|
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/rewards/RewardGainersResponse.java
|
||||||
|
* @Description:
|
||||||
|
*
|
||||||
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||||
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class RewardGainersResponse extends QueryResponse
|
||||||
|
{
|
||||||
|
public RewardGainersResponse( boolean success, String message,
|
||||||
|
ArrayList<RewardGainer> gainerList)
|
||||||
|
{
|
||||||
|
super( success, message );
|
||||||
|
|
||||||
|
this.gainerList = gainerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RewardGainersResponse()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.gainerList = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<RewardGainer> getGainerList()
|
||||||
|
{
|
||||||
|
return gainerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGainerList( ArrayList<RewardGainer> gainerList )
|
||||||
|
{
|
||||||
|
this.gainerList = gainerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty( "gainerList" )
|
||||||
|
private ArrayList<RewardGainer> gainerList;
|
||||||
|
}
|
@@ -10,11 +10,11 @@
|
|||||||
package com.cpic.xim.web.controllers.rewards;
|
package com.cpic.xim.web.controllers.rewards;
|
||||||
|
|
||||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
import com.cpic.xim.web.controllers.QueryResult;
|
import com.cpic.xim.web.controllers.QueryResponse;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class RewardProjectsResponse extends QueryResult
|
public class RewardProjectsResponse extends QueryResponse
|
||||||
{
|
{
|
||||||
public RewardProjectsResponse( boolean success, String message,
|
public RewardProjectsResponse( boolean success, String message,
|
||||||
ArrayList<RewardProject> rewardList)
|
ArrayList<RewardProject> rewardList)
|
||||||
|
@@ -8,4 +8,22 @@
|
|||||||
<id property="rewardCode" column="reward_index" />
|
<id property="rewardCode" column="reward_index" />
|
||||||
<result property="rewardName" column="reward_name" javaType="String"/>
|
<result property="rewardName" column="reward_name" javaType="String"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="queryRewardGainers" resultMap="RewardGainerMapper">
|
||||||
|
SELECT hjr.award_date award_date,
|
||||||
|
hjr.gainer_name gainer_name,
|
||||||
|
hjr.gainer_code gainer_code,
|
||||||
|
xm.reward_name reward_name,
|
||||||
|
xm.reward_index
|
||||||
|
FROM reward_gainers hjr,
|
||||||
|
reward_projects xm
|
||||||
|
WHERE hjr.reward_index = xm.reward_index
|
||||||
|
</select>
|
||||||
|
<resultMap id="RewardGainerMapper" type="com.cpic.xim.mybatis.pojo.RewardGainer">
|
||||||
|
<result column="gainer_name" property="callerName" />
|
||||||
|
<result column="gainer_code" property="callerCode" />
|
||||||
|
<result column="award_date" property="acquiredDate" />
|
||||||
|
<result column="reward_name" property="rewardProjectName" />
|
||||||
|
<result column="reward_index" property="rewardProjectCode" />
|
||||||
|
</resultMap>
|
||||||
</mapper>
|
</mapper>
|
@@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import com.cpic.xim.mybatis.mapper.ArchievementMapper;
|
import com.cpic.xim.mybatis.mapper.ArchievementMapper;
|
||||||
import com.cpic.xim.mybatis.mapper.RewardsMapper;
|
import com.cpic.xim.mybatis.mapper.RewardsMapper;
|
||||||
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
|
||||||
|
import com.cpic.xim.mybatis.pojo.RewardGainer;
|
||||||
import com.cpic.xim.mybatis.pojo.RewardProject;
|
import com.cpic.xim.mybatis.pojo.RewardProject;
|
||||||
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
import com.cpic.xim.mybatis.utils.MybatisUtils;
|
||||||
import com.cpic.xim.utils.ranking.CallerRankingList;
|
import com.cpic.xim.utils.ranking.CallerRankingList;
|
||||||
@@ -135,4 +136,26 @@ public class DesktopArchievementTest
|
|||||||
assert (false);
|
assert (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testQueryGainers()
|
||||||
|
{
|
||||||
|
SqlSession session = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
session = MybatisUtils.getSqlSession();
|
||||||
|
RewardsMapper mapper = session.getMapper( RewardsMapper.class );
|
||||||
|
|
||||||
|
ArrayList<RewardGainer> gainers = mapper.queryRewardGainers();
|
||||||
|
|
||||||
|
System.out.println( gainers );
|
||||||
|
|
||||||
|
assert( gainers != null );
|
||||||
|
}
|
||||||
|
catch ( IOException error )
|
||||||
|
{
|
||||||
|
assert (false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user