Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
de977859
Commit
de977859
authored
May 08, 2020
by
tangzhaoqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录人信息API 优化,企业中心-显示常用的企业开票资料API 优化
parent
4d80a30b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
98 additions
and
39 deletions
+98
-39
src/main/java/cn/timer/api/aspect/BindingResultAspect.java
+4
-27
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
+4
-2
src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java
+18
-3
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+24
-5
src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java
+2
-0
src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java
+0
-2
src/main/java/cn/timer/api/dto/yggl/LoginInfoDto.java
+34
-0
src/main/resources/mapping/spmk/SpmkApprovalGMapper.xml
+12
-0
No files found.
src/main/java/cn/timer/api/aspect/BindingResultAspect.java
View file @
de977859
...
...
@@ -3,19 +3,16 @@ package cn.timer.api.aspect;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.stereotype.Component
;
import
org.springframework.validation.BeanPropertyBindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.ObjectError
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -23,7 +20,6 @@ import com.alibaba.fastjson.JSONObject;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.lang.Console
;
import
cn.hutool.core.util.ClassUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.timer.api.aspect.lang.annotation.BindingResultCtrol
;
import
cn.timer.api.aspect.lang.bean.ValidationError
;
import
cn.timer.api.utils.ResultUtil
;
...
...
@@ -43,7 +39,7 @@ public class BindingResultAspect {
{
}
// execution 配置织入点
// execution 配置织入点
-匹配 cn.timer.api.controller 包下的所有子包的类的方法
@Pointcut
(
"execution(* cn.timer.api.controller.*.*.*(..))"
)
public
void
clazzPointCut
()
{
...
...
@@ -78,9 +74,9 @@ public class BindingResultAspect {
fieldString
=
fieldString
.
substring
(
fieldString
.
lastIndexOf
(
"."
)
+
1
);
}
for
(
String
str
:
one
.
getCodes
())
{
System
.
err
.
println
(
str
);
}
//
for (String str : one.getCodes()) {
//
System.err.println(str);
//
}
ve
=
ValidationError
.
builder
().
field
(
fieldString
).
msg
(
one
.
getDefaultMessage
()).
build
();
listVe
.
add
(
ve
);
...
...
@@ -94,25 +90,6 @@ public class BindingResultAspect {
Long
endtime
=
System
.
currentTimeMillis
();
Console
.
log
(
"执行耗时为{}:"
,
endtime
-
startTime
+
"ms"
);
// Object[] objs = joinPoint.getArgs();
//
// List<Object> listObj = CollectionUtil.toList(objs);
// BeanPropertyBindingResult optional = (BeanPropertyBindingResult)listObj.stream()
// .filter(p -> "BeanPropertyBindingResult".equals(ClassUtil.getClassName(p, true)))
// .findFirst()
// .orElse(null);
// if (optional != null && optional.hasErrors()) {
// System.err.println("Optional: "+ optional);
// }
return
retVal
;
}
...
...
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
View file @
de977859
...
...
@@ -229,14 +229,16 @@ public class QyzxController {
@GetMapping
(
value
=
"/invoiceusual"
)
@ApiOperation
(
value
=
"显示常用的企业开票资料"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
QyzxInvoiceUsual
>
invoiceusual
(
@CurrentUser
UserBean
userBean
)
{
QyzxInvoiceUsual
one
=
new
LambdaQueryChainWrapper
<
QyzxInvoiceUsual
>(
qyzxInvoiceUsualMapper
)
.
eq
(
QyzxInvoiceUsual:
:
getOrgCode
,
userBean
.
getOrgCode
()).
one
();
QyzxInvoiceUsual
one
=
qyzxInvoiceUsualMapper
.
selectOne
(
new
QueryWrapper
<
QyzxInvoiceUsual
>().
lambda
()
.
eq
(
QyzxInvoiceUsual:
:
getOrgCode
,
userBean
.
getOrgCode
()));
if
(
one
!=
null
)
{
if
(
one
.
getShippingArea
()
==
null
)
{
one
.
setShippingArea
(
""
);
}
if
(
one
.
getShippingAddress
()
==
null
)
{
one
.
setShippingAddress
(
""
);
}
}
return
ResultUtil
.
data
(
one
,
"显示常用的企业开票资料"
);
}
...
...
src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java
View file @
de977859
...
...
@@ -9,6 +9,7 @@ import javax.validation.Valid;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.ObjectError
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -30,6 +31,7 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.aspect.lang.annotation.BindingResultCtrol
;
import
cn.timer.api.aspect.lang.bean.ValidationError
;
import
cn.timer.api.bean.spmk.SpmkApprovalG
;
import
cn.timer.api.bean.spmk.SpmkApprovalTemplate
;
import
cn.timer.api.bean.spmk.SpmkApprovalTemplateG
;
...
...
@@ -246,10 +248,24 @@ public class SpmkServiceImpl {
}
/**
* 查询列表-审批组
* 查询列表-审批组-审批管理
*/
@GetMapping
(
value
=
"/all_approval_g"
)
@ApiOperation
(
value
=
"11.查询列表-审批组-审批管理"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-审批管理"
)
@ApiOperationSupport
(
order
=
11
)
public
Result
<
Object
>
selectListAgByAdmin
(
@CurrentUser
UserBean
userBean
){
List
<
Integer
>
depts
=
zzglBmgwMService
.
empNumupGetDepts
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
());
System
.
out
.
println
(
depts
);
return
ResultUtil
.
data
(
spmkApprovalGMapper
.
selectListAgInCaByAdmin
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
depts
),
"操作成功!"
);
}
/**
* 查询列表-审批组-个人审批
*/
@GetMapping
(
value
=
"/list_approval_g"
)
@ApiOperation
(
value
=
"11.查询列表-审批组
"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组
"
)
@ApiOperation
(
value
=
"11.查询列表-审批组
-个人审批"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-个人审批
"
)
@ApiOperationSupport
(
order
=
11
)
public
Result
<
Object
>
selectListAg
(
@CurrentUser
UserBean
userBean
){
...
...
@@ -399,7 +415,6 @@ public class SpmkServiceImpl {
@Transactional
(
rollbackFor
=
Exception
.
class
)
// @BindingResultCtrol(title = "发起审批")
public
Result
<
Object
>
saveCa
(
@CurrentUser
UserBean
userBean
,
@Valid
@RequestBody
SpmkApproveSummaryDto
spmkApproveSummaryDto
,
BindingResult
bindingResult
)
throws
Exception
{
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
.
lambda
()
.
select
(
YgglMainEmp:
:
getHeadUrl
,
YgglMainEmp:
:
getName
)
...
...
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
de977859
...
...
@@ -79,6 +79,7 @@ import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import
cn.timer.api.dao.yggl.YgglMainLzbMapper
;
import
cn.timer.api.dao.zzgl.ZzglBmgwMMapper
;
import
cn.timer.api.dto.yggl.AddygdaDto
;
import
cn.timer.api.dto.yggl.LoginInfoDto
;
import
cn.timer.api.dto.yggl.LoginerChargeDto
;
import
cn.timer.api.dto.yggl.LzbQueryDto
;
import
cn.timer.api.dto.yggl.LzygQueryDto
;
...
...
@@ -145,17 +146,35 @@ public class YgglController {
@GetMapping
(
value
=
"/loginmessage"
)
@ApiOperation
(
value
=
" 获取登录人的相关信息"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
68
)
public
Result
<
YgglMainEmp
>
loginmessage
(
@CurrentUser
UserBean
userBean
)
{
public
Result
<
LoginInfoDto
>
loginmessage
(
@CurrentUser
UserBean
userBean
)
{
Integer
empNum
=
userBean
.
getEmpNum
();
Integer
orgCode
=
userBean
.
getOrgCode
();
LoginInfoDto
loginInfo
=
LoginInfoDto
.
builder
().
build
();
YgglMainEmp
ygglMainEmp
=
new
LambdaQueryChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
select
(
YgglMainEmp:
:
getBmgwId
,
YgglMainEmp:
:
getName
,
YgglMainEmp:
:
getRzTime
,
YgglMainEmp:
:
getEmpNum
)
.
select
(
YgglMainEmp:
:
getBmgwId
,
YgglMainEmp:
:
getName
,
YgglMainEmp:
:
getRzTime
,
YgglMainEmp:
:
getZzTime
,
YgglMainEmp:
:
getEmpNum
)
.
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
).
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
one
();
if
(
ygglMainEmp
!=
null
)
{
Integer
gw
=
ygglMainEmp
.
getBmgwId
();
ZzglBmgwM
bmid
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getUpId
)
ZzglBmgwM
gwObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getUpId
,
ZzglBmgwM:
:
getName
)
.
eq
(
ZzglBmgwM:
:
getId
,
gw
).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
ygglMainEmp
.
setUnionid
(
bmid
.
toString
());
return
ResultUtil
.
data
(
ygglMainEmp
,
"部门id返回字段为unionid"
);
ZzglBmgwM
bmObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getId
,
ZzglBmgwM:
:
getName
)
.
eq
(
ZzglBmgwM:
:
getId
,
gwObj
.
getUpId
()).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
loginInfo
.
setEmpNum
(
ygglMainEmp
.
getEmpNum
());
loginInfo
.
setName
(
ygglMainEmp
.
getName
());
loginInfo
.
setBmId
(
bmObj
!=
null
?
bmObj
.
getId
()
:
null
);
loginInfo
.
setBmName
(
bmObj
!=
null
?
bmObj
.
getName
()
:
null
);
loginInfo
.
setGwId
(
gw
);
loginInfo
.
setGwName
(
gwObj
!=
null
?
gwObj
.
getName
()
:
""
);
loginInfo
.
setEntryTime
(
ygglMainEmp
.
getRzTime
());
loginInfo
.
setRegularTime
(
ygglMainEmp
.
getRzTime
());
}
return
ResultUtil
.
data
(
loginInfo
,
"操作成功!"
);
}
/**
...
...
src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java
View file @
de977859
...
...
@@ -21,4 +21,6 @@ public interface SpmkApprovalGMapper extends BaseMapper<SpmkApprovalG> {
boolean
updateListRandsById
(
List
<
SpmkApprovalG
>
list
);
List
<
SpmkApprovalG
>
selectListAgInCaByAdmin
(
@Param
(
"org_code"
)
Integer
org_code
,
@Param
(
"emp_num"
)
Integer
emp_num
,
@Param
(
"deptIds"
)
List
<
Integer
>
deptIds
);
}
src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java
View file @
de977859
...
...
@@ -2,12 +2,10 @@ package cn.timer.api.dto.spmk;
import
java.util.List
;
import
javax.validation.Valid
;
import
javax.validation.constraints.DecimalMax
;
import
javax.validation.constraints.DecimalMin
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
cn.hutool.json.JSONObject
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
src/main/java/cn/timer/api/dto/yggl/LoginInfoDto.java
0 → 100644
View file @
de977859
package
cn
.
timer
.
api
.
dto
.
yggl
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
LoginInfoDto
{
@ApiModelProperty
(
value
=
"员工id"
,
example
=
"1"
)
private
Integer
empNum
;
@ApiModelProperty
(
value
=
"员工姓名"
,
example
=
"1"
)
private
String
name
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"1"
)
private
Integer
bmId
;
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
"1"
)
private
String
bmName
;
@ApiModelProperty
(
value
=
"岗位id"
,
example
=
"1"
)
private
Integer
gwId
;
@ApiModelProperty
(
value
=
"岗位名称"
,
example
=
"1"
)
private
String
gwName
;
@ApiModelProperty
(
value
=
"入职日期"
,
example
=
"1"
)
private
Date
entryTime
;
@ApiModelProperty
(
value
=
"转正时间"
,
example
=
"1"
)
private
Date
regularTime
;
}
src/main/resources/mapping/spmk/SpmkApprovalGMapper.xml
View file @
de977859
...
...
@@ -66,6 +66,18 @@
b.router SpmkCustomApproval_router -->
</sql>
<select
id=
"selectListAgInCaByAdmin"
resultMap=
"BaseResultMapDto"
>
SELECT
<include
refid=
"Base_Column_List_Alias_a"
/>
,
<include
refid=
"Base_Column_List_Alias_ca"
/>
FROM spmk_approval_g a
LEFT JOIN spmk_custom_approval b
ON a.id = b.approval_g_id
WHERE a.org_code = #{org_code}
ORDER BY a.ranks, b.ranks
</select>
<select
id=
"selectListAgInCa"
resultMap=
"BaseResultMapDto"
>
SELECT
<include
refid=
"Base_Column_List_Alias_a"
/>
,
...
...
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