Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
fee4c7b0
Commit
fee4c7b0
authored
Jun 03, 2021
by
陈浩建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动申报+kpi打分+销售预警数据设置
parent
136c42a1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
317 additions
and
0 deletions
+317
-0
common/src/main/java/com/winsun/bean/KpiScore.java
+29
-0
common/src/main/java/com/winsun/bean/SalesAlert.java
+37
-0
common/src/main/java/com/winsun/mapper/KpiScoreMapper.java
+15
-0
common/src/main/java/com/winsun/mapper/SalesAlertMapper.java
+14
-0
service-manager/src/main/java/com/winsun/controller/KpiScoreController.java
+105
-0
service-manager/src/main/java/com/winsun/controller/SalesAlertController.java
+117
-0
No files found.
common/src/main/java/com/winsun/bean/KpiScore.java
0 → 100644
View file @
fee4c7b0
package
com
.
winsun
.
bean
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableId
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.IdType
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* KPI打分
* @author chenhaojian
* @create 2021/6/3 14:59
*/
@Data
@TableName
(
"hhr_kpi_score"
)
public
class
KpiScore
implements
Serializable
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@TableField
(
value
=
"position"
)
private
String
position
;
@TableField
(
value
=
"score"
)
private
String
score
;
@TableField
(
value
=
"remarks"
)
private
String
remarks
;
}
common/src/main/java/com/winsun/bean/SalesAlert.java
0 → 100644
View file @
fee4c7b0
package
com
.
winsun
.
bean
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableId
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
com.baomidou.mybatisplus.enums.IdType
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 销售预警数据
* @author chenhaojian
* @create 2021/6/3 15:00
*/
@Data
@TableName
(
"hhr_sales_alert"
)
public
class
SalesAlert
implements
Serializable
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@TableField
(
value
=
"name"
)
private
String
name
;
@TableField
(
value
=
"alert_type"
)
private
String
alertType
;
@TableField
(
value
=
"alert_area"
)
private
String
alertArea
;
@TableField
(
value
=
"alert_number"
)
private
String
alertNumber
;
@TableField
(
value
=
"remarks"
)
private
String
remarks
;
}
common/src/main/java/com/winsun/mapper/KpiScoreMapper.java
0 → 100644
View file @
fee4c7b0
package
com
.
winsun
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.winsun.bean.KpiScore
;
import
com.winsun.bean.Teacher
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Component
;
/**
* KPI打分对应使用表的Mapper
*/
@Mapper
@Component
public
interface
KpiScoreMapper
extends
BaseMapper
<
KpiScore
>
{
}
common/src/main/java/com/winsun/mapper/SalesAlertMapper.java
0 → 100644
View file @
fee4c7b0
package
com
.
winsun
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.winsun.bean.SalesAlert
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Component
;
/**
* 销售预警对应使用表的Mapper
*/
@Mapper
@Component
public
interface
SalesAlertMapper
extends
BaseMapper
<
SalesAlert
>
{
}
service-manager/src/main/java/com/winsun/controller/KpiScoreController.java
0 → 100644
View file @
fee4c7b0
package
com
.
winsun
.
controller
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.winsun.auth.core.annotion.Permission
;
import
com.winsun.auth.core.base.controller.BaseController
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.bean.KpiScore
;
import
com.winsun.mapper.KpiScoreMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* KPI打分 controller
* @Author: chenhaojian
* @Date: 2021/6/3
*/
@Slf4j
@RestController
@RequestMapping
(
"/kpiScore"
)
public
class
KpiScoreController
extends
BaseController
{
@Autowired
private
KpiScoreMapper
kpiScoreMapper
;
@Permission
(
menuname
=
"查询信息"
,
value
=
"list"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
Object
>
dataList
(
@RequestParam
(
name
=
"position"
,
required
=
false
)
String
position
,
@RequestParam
(
name
=
"pageNo"
,
required
=
false
)
int
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
required
=
false
)
int
pageSize
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Wrapper
<
KpiScore
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
position
),
"position"
,
position
);
List
<
String
>
objects
=
new
ArrayList
<>();
objects
.
add
(
"id"
);
wrapper
.
orderDesc
(
objects
);
Page
<
KpiScore
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
List
<
KpiScore
>
aPackage
=
kpiScoreMapper
.
selectPage
(
page
,
wrapper
);
page
.
setRecords
(
aPackage
);
map
.
put
(
"page"
,
ResponseData
.
success
(
page
,
"查询成功!"
));
return
map
;
}
@RequestMapping
(
value
=
"addData"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
addData
(
@RequestParam
(
name
=
"position"
)
String
position
,
@RequestParam
(
name
=
"score"
)
String
score
,
@RequestParam
(
name
=
"remarks"
)
String
remarks
){
KpiScore
kpiScore
=
new
KpiScore
();
kpiScore
.
setPosition
(
position
);
kpiScore
.
setScore
(
score
);
kpiScore
.
setRemarks
(
remarks
);
try
{
kpiScoreMapper
.
insert
(
kpiScore
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
ResponseData
.
success
();
}
@RequestMapping
(
value
=
"updateData"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
updateData
(
@RequestParam
(
name
=
"id"
)
String
id
,
@RequestParam
(
name
=
"position"
)
String
position
,
@RequestParam
(
name
=
"score"
)
String
score
,
@RequestParam
(
name
=
"remarks"
)
String
remarks
){
Wrapper
<
KpiScore
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"id"
,
id
);
KpiScore
kpiScore
=
new
KpiScore
();
kpiScore
.
setPosition
(
position
);
kpiScore
.
setScore
(
score
);
kpiScore
.
setRemarks
(
remarks
);
try
{
kpiScoreMapper
.
update
(
kpiScore
,
wrapper
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
ResponseData
.
success
();
}
@RequestMapping
(
value
=
"deleteData"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
deleteData
(
@RequestParam
(
name
=
"id"
)
String
id
){
if
(
StringUtils
.
isBlank
(
id
)){
return
ResponseData
.
error
(
""
);
};
Wrapper
<
KpiScore
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
try
{
kpiScoreMapper
.
delete
(
wrapper
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
ResponseData
.
success
();
}
}
service-manager/src/main/java/com/winsun/controller/SalesAlertController.java
0 → 100644
View file @
fee4c7b0
package
com
.
winsun
.
controller
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.winsun.auth.core.annotion.Permission
;
import
com.winsun.auth.core.base.controller.BaseController
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.bean.SalesAlert
;
import
com.winsun.mapper.SalesAlertMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 销售预警 controller
* @Author: chenhaojian
* @Date: 2021/6/3
*/
@Slf4j
@RestController
@RequestMapping
(
"/salesAlert"
)
public
class
SalesAlertController
extends
BaseController
{
@Autowired
private
SalesAlertMapper
salesAlertMapper
;
@Permission
(
menuname
=
"查询信息"
,
value
=
"list"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
Object
>
dataList
(
@RequestParam
(
name
=
"alertType"
,
required
=
false
)
String
alertType
,
@RequestParam
(
name
=
"alertArea"
,
required
=
false
)
String
alertArea
,
@RequestParam
(
name
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
name
=
"pageNo"
,
required
=
false
)
int
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
required
=
false
)
int
pageSize
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Wrapper
<
SalesAlert
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
alertType
),
"alert_type"
,
alertType
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
alertArea
),
"alert_area"
,
alertArea
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
name
),
"name"
,
name
);
List
<
String
>
objects
=
new
ArrayList
<>();
objects
.
add
(
"id"
);
wrapper
.
orderDesc
(
objects
);
Page
<
SalesAlert
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
List
<
SalesAlert
>
aPackage
=
salesAlertMapper
.
selectPage
(
page
,
wrapper
);
page
.
setRecords
(
aPackage
);
map
.
put
(
"page"
,
ResponseData
.
success
(
page
,
"查询成功!"
));
return
map
;
}
@RequestMapping
(
value
=
"addData"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
addData
(
@RequestParam
(
name
=
"name"
)
String
name
,
@RequestParam
(
name
=
"alertType"
)
String
alertType
,
@RequestParam
(
name
=
"alertArea"
)
String
alertArea
,
@RequestParam
(
name
=
"alertNumber"
)
String
alertNumber
,
@RequestParam
(
name
=
"remarks"
)
String
remarks
){
SalesAlert
salesAlert
=
new
SalesAlert
();
salesAlert
.
setName
(
name
);
salesAlert
.
setAlertType
(
alertType
);
salesAlert
.
setAlertArea
(
alertArea
);
salesAlert
.
setAlertNumber
(
alertNumber
);
salesAlert
.
setRemarks
(
remarks
);
try
{
salesAlertMapper
.
insert
(
salesAlert
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
ResponseData
.
success
();
}
@RequestMapping
(
value
=
"updateData"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
updateData
(
@RequestParam
(
name
=
"id"
)
String
id
,
@RequestParam
(
name
=
"name"
)
String
name
,
@RequestParam
(
name
=
"alertType"
)
String
alertType
,
@RequestParam
(
name
=
"alertArea"
)
String
alertArea
,
@RequestParam
(
name
=
"alertNumber"
)
String
alertNumber
,
@RequestParam
(
name
=
"remarks"
)
String
remarks
){
Wrapper
<
SalesAlert
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
"id"
,
id
);
SalesAlert
salesAlert
=
new
SalesAlert
();
salesAlert
.
setName
(
name
);
salesAlert
.
setAlertType
(
alertType
);
salesAlert
.
setAlertArea
(
alertArea
);
salesAlert
.
setAlertNumber
(
alertNumber
);
salesAlert
.
setRemarks
(
remarks
);
try
{
salesAlertMapper
.
update
(
salesAlert
,
wrapper
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
ResponseData
.
success
();
}
@RequestMapping
(
value
=
"deleteData"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
deleteData
(
@RequestParam
(
name
=
"id"
)
String
id
){
if
(
StringUtils
.
isBlank
(
id
)){
return
ResponseData
.
error
(
""
);
};
Wrapper
<
SalesAlert
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
try
{
salesAlertMapper
.
delete
(
wrapper
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
ResponseData
.
success
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment