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
0c6401a1
Commit
0c6401a1
authored
May 08, 2020
by
tangzhaoqian
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录人信息API 优化,企业中心-显示常用的企业开票资料API 优化
parent
1a77e4f5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
42 deletions
+82
-42
src/main/java/cn/timer/api/aspect/BindingResultAspect.java
+5
-28
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
+9
-7
src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java
+20
-5
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+0
-0
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 @
0c6401a1
...
...
@@ -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
);
...
...
@@ -93,26 +89,7 @@ public class BindingResultAspect {
Console
.
log
(
"返回内容 {}: "
,
JSONObject
.
toJSONString
(
retVal
));
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 @
0c6401a1
...
...
@@ -229,13 +229,15 @@ 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
();
if
(
one
.
getShippingArea
()
==
null
)
{
one
.
setShippingArea
(
""
);
}
if
(
one
.
getShippingAddress
()
==
null
)
{
one
.
setShippingAddress
(
""
);
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 @
0c6401a1
...
...
@@ -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,17 +248,31 @@ 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
){
List
<
Integer
>
depts
=
zzglBmgwMService
.
empNumupGetDepts
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
());
System
.
out
.
println
(
depts
);
return
ResultUtil
.
data
(
spmkApprovalGMapper
.
selectListAgInCa
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
depts
),
"操作成功!"
);
return
ResultUtil
.
data
(
spmkApprovalGMapper
.
selectListAgInCa
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
depts
),
"操作成功!"
);
}
/**
...
...
@@ -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 @
0c6401a1
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/spmk/SpmkApprovalGMapper.java
View file @
0c6401a1
...
...
@@ -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 @
0c6401a1
...
...
@@ -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 @
0c6401a1
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 @
0c6401a1
...
...
@@ -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