保存进度!

This commit is contained in:
Kane Wang 2023-09-08 17:57:34 +08:00
parent 22157b11eb
commit efebd548c6
13 changed files with 309 additions and 19 deletions

View File

@ -14,10 +14,19 @@
<el-divider content-position="left"> <el-divider content-position="left">
90俱乐部 90俱乐部
</el-divider> </el-divider>
<div class="toolbutton-wrapper">
<el-button type="primary">
新增
</el-button>
<el-button type="danger">
删除
</el-button>
</div>
<el-table <el-table
border border
stripe stripe
style="width:100%;" style="width:100%;"
:height="tableHeight"
> >
<el-table-column type="selection" /> <el-table-column type="selection" />
<el-table-column <el-table-column
@ -34,10 +43,19 @@
<el-divider content-position="left"> <el-divider content-position="left">
XXX XXX
</el-divider> </el-divider>
<div class="toolbutton-wrapper">
<el-button type="primary">
新增
</el-button>
<el-button type="danger">
删除
</el-button>
</div>
<el-table <el-table
border border
stripe stripe
style="width:100%;" style="width:100%;"
:height="tableHeight"
> >
<el-table-column type="selection" /> <el-table-column type="selection" />
<el-table-column <el-table-column
@ -54,11 +72,23 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { reactive, computed } from "vue";
export default { export default {
name: "DataManagement", name: "DataManagement",
setup() setup()
{ {
return {}; const ui = reactive({});
const tableHeight = computed((): number =>
{
return 5 * 50 + 40;
});
return {
ui,
tableHeight,
};
}, },
}; };
</script> </script>
@ -113,4 +143,12 @@ export default {
.dishonor-wrapper { .dishonor-wrapper {
flex-grow: 1; flex-grow: 1;
} }
.toolbutton-wrapper {
text-align: left;
margin-bottom: 10px;
>*+* {
margin-left: 15px;
}
}
</style> </style>

View File

@ -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();
} }

View File

@ -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;
}

View File

@ -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;

View File

@ -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()

View File

@ -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()
{ {

View File

@ -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
{ {
/** /**
* *

View File

@ -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;
} }

View File

@ -63,4 +63,6 @@ public class RewardController
return response; return response;
} }
} }

View File

@ -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;
}

View File

@ -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)

View File

@ -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>

View File

@ -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);
}
}
} }