Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
c0900d0c
Commit
c0900d0c
authored
Aug 17, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
cbdd5384
1964a95d
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
185 additions
and
6 deletions
+185
-6
DaprSalarylProperties.java
...lus/v1/yifu/common/dapr/config/DaprSalarylProperties.java
+39
-0
daprConfig.properties
...yifu-common-dapr/src/main/resources/daprConfig.properties
+4
-0
salaryTask.java
...n/java/com/yifu/cloud/plus/v1/job/compont/salaryTask.java
+74
-0
TStatisticsRemunerationController.java
.../salary/controller/TStatisticsRemunerationController.java
+15
-0
TStatisticsRemunerationMapper.java
.../v1/yifu/salary/mapper/TStatisticsRemunerationMapper.java
+10
-0
TStatisticsRemunerationService.java
...1/yifu/salary/service/TStatisticsRemunerationService.java
+6
-0
TStatisticsLaborServiceImpl.java
...yifu/salary/service/impl/TStatisticsLaborServiceImpl.java
+0
-1
TStatisticsRemunerationServiceImpl.java
...lary/service/impl/TStatisticsRemunerationServiceImpl.java
+22
-0
TStatisticsDeclarerMapper.xml
...z/src/main/resources/mapper/TStatisticsDeclarerMapper.xml
+1
-1
TStatisticsLaborMapper.xml
...-biz/src/main/resources/mapper/TStatisticsLaborMapper.xml
+3
-4
TStatisticsRemunerationMapper.xml
...c/main/resources/mapper/TStatisticsRemunerationMapper.xml
+11
-0
No files found.
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/config/DaprSalarylProperties.java
0 → 100644
View file @
c0900d0c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
/**
* @Author huyc
* @Date 2022-8-17 10:38:08
* @Description
* @Version 1.0
*/
@Data
@Component
@PropertySource
(
"classpath:daprConfig.properties"
)
@ConfigurationProperties
(
value
=
"dapr.salary"
,
ignoreInvalidFields
=
false
)
public
class
DaprSalarylProperties
{
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String
appUrl
;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String
appId
;
String
appPort
;
String
httpPort
;
String
grpcPort
;
String
metricsPort
;
}
yifu-common/yifu-common-dapr/src/main/resources/daprConfig.properties
View file @
c0900d0c
...
...
@@ -15,3 +15,7 @@ dapr.archives.appId=yifu-archives
dapr.insurances.appUrl
=
http://yifu-auth.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.insurances.appId
=
yifu-insurances
#\u6D4B\u8BD5\u73AF\u5883-\u85AA\u8D44\u670D\u52A1
dapr.salary.appUrl
=
http://yifu-salary.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.salary.appId
=
yifu-salary
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/salaryTask.java
0 → 100644
View file @
c0900d0c
package
com
.
yifu
.
cloud
.
plus
.
v1
.
job
.
compont
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalarylProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsLabor
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.stereotype.Component
;
/**
* @Author huyc
* @Description 定时任务具体执行类
* @Date 10:48 2022/8/17
* @Param
* @return
**/
@Component
(
value
=
"salaryTask"
)
@Slf4j
@EnableConfigurationProperties
(
DaprSalarylProperties
.
class
)
public
class
salaryTask
{
@Autowired
private
DaprSalarylProperties
daprSalarylProperties
;
/**
* @return
* @Author huyc
* @Description
* @Date 10:48 2022/8/17
* @Param
**/
public
void
doStatisticsTaxDeclarer
()
throws
Exception
{
log
.
info
(
"-------------生成申报对象-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprSalarylProperties
.
getAppUrl
(),
daprSalarylProperties
.
getAppId
(),
"/tstatisticsdeclarer/inner/doStatisticsTaxDeclarer"
,
""
,
TStatisticsDeclarer
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"-------------生成申报对象-定时任务结束------------"
);
}
/**
* @return
* @Author huyc
* @Description
* @Date 10:48 2022/8/17
* @Param
**/
public
void
doStatisticsLabor
()
throws
Exception
{
log
.
info
(
"-------------生成本期劳务费-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprSalarylProperties
.
getAppUrl
(),
daprSalarylProperties
.
getAppId
(),
"/tstatisticslabor/inner/doStatisticsLabor"
,
""
,
TStatisticsLabor
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"-------------生成本期劳务费-定时任务结束------------"
);
}
/**
* @return
* @Author huyc
* @Description
* @Date 10:48 2022/8/17
* @Param
**/
public
void
doStatisticsRemuneration
()
throws
Exception
{
log
.
info
(
"-------------生成本期劳务费-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprSalarylProperties
.
getAppUrl
(),
daprSalarylProperties
.
getAppId
(),
"/tstatisticsremuneration/inner/doStatisticsRemuneration"
,
""
,
TStatisticsRemuneration
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"-------------生成本期劳务费-定时任务结束------------"
);
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TStatisticsRemunerationController.java
View file @
c0900d0c
...
...
@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsRemunerationService
;
import
com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsRemunerationSearchVo
;
...
...
@@ -112,4 +113,18 @@ public class TStatisticsRemunerationController {
public
R
batchDelete
(
@RequestParam
String
declareMonth
){
return
tStatisticsRemunerationService
.
batchDelete
(
declareMonth
);
}
/**
* @param
* @Description: 生成本期稿酬
* @Author: huyc
* @Date: 2022-08-17 18:17:48
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Inner
@Operation
(
description
=
"生成本期稿酬"
)
@PostMapping
(
"/inner/doStatisticsRemuneration"
)
public
R
doStatisticsRemuneration
()
{
return
tStatisticsRemunerationService
.
doStatisticsRemuneration
();
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/mapper/TStatisticsRemunerationMapper.java
View file @
c0900d0c
...
...
@@ -23,6 +23,9 @@ import org.apache.ibatis.annotations.Mapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 本期稿酬申报表
*
...
...
@@ -37,4 +40,11 @@ public interface TStatisticsRemunerationMapper extends BaseMapper<TStatisticsRem
* @return
*/
IPage
<
TStatisticsRemuneration
>
getTStatisticsRemunerationPage
(
Page
<
TStatisticsRemuneration
>
page
,
@Param
(
"tStatisticsRemuneration"
)
TStatisticsRemuneration
tStatisticsRemuneration
);
/**
* @param
* @Description: 统计
* @return:
**/
List
<
TStatisticsRemuneration
>
doStatisticsRemuneration
(
@Param
(
"nowMonth"
)
String
nowMonth
,
@Param
(
"lastYear"
)
String
lastYear
);
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TStatisticsRemunerationService.java
View file @
c0900d0c
...
...
@@ -49,4 +49,10 @@ public interface TStatisticsRemunerationService extends IService<TStatisticsRemu
*/
R
batchDelete
(
String
declareMonth
);
/** 生成本期稿酬
* @param
* @return
**/
R
doStatisticsRemuneration
();
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TStatisticsLaborServiceImpl.java
View file @
c0900d0c
...
...
@@ -269,7 +269,6 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
TStatisticsLaborVo
excel
=
excelVOList
.
get
(
i
);
// 数据合法情况 TODO
// 插入
insertExcel
(
excel
);
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TStatisticsRemunerationServiceImpl.java
View file @
c0900d0c
...
...
@@ -20,6 +20,7 @@ import com.alibaba.excel.EasyExcel;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -143,6 +144,27 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
return
null
;
}
@Override
public
R
doStatisticsRemuneration
()
{
String
nowMonth
=
DateUtil
.
addMonth
(
0
);
//本月
TStatisticsRemuneration
std
=
new
TStatisticsRemuneration
();
std
.
setDeclareMonth
(
nowMonth
);
QueryWrapper
<
TStatisticsRemuneration
>
queryWrapperSs
=
new
QueryWrapper
<>();
queryWrapperSs
.
setEntity
(
std
);
long
num
=
this
.
count
(
queryWrapperSs
);
if
(
num
>
0
)
{
return
R
.
failed
(
"上月数据已生成,不可重复生成!"
);
}
else
{
String
lastMonth
=
DateUtil
.
addMonth
(-
1
);
//上月
String
lastYear
=
lastMonth
.
substring
(
0
,
4
);
List
<
TStatisticsRemuneration
>
stdvoList
=
baseMapper
.
doStatisticsRemuneration
(
nowMonth
,
lastYear
);
for
(
TStatisticsRemuneration
remuneration
:
stdvoList
)
{
this
.
save
(
remuneration
);
}
return
R
.
ok
();
}
}
private
List
<
TStatisticsRemuneration
>
noPageDiy
(
TStatisticsRemunerationSearchVo
searchVo
)
{
LambdaQueryWrapper
<
TStatisticsRemuneration
>
wrapper
=
buildQueryWrapper
(
searchVo
);
List
<
String
>
idList
=
Common
.
getList
(
searchVo
.
getIds
());
...
...
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TStatisticsDeclarerMapper.xml
View file @
c0900d0c
...
...
@@ -105,7 +105,7 @@
b.UNIT_NAME DECLARE_UNIT,'雇员' OCCUPATION_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG =
0
and a.SETTLEMENT_MONTH like '${lastYear}%'
where a.DELETE_FLAG =
'0'
and a.SETTLEMENT_MONTH like '${lastYear}%'
GROUP BY a.EMP_IDCARD
</select>
</mapper>
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TStatisticsLaborMapper.xml
View file @
c0900d0c
...
...
@@ -85,18 +85,17 @@
1=1
<include
refid=
"tStatisticsLabor_where"
/>
</where>
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select
id=
"doStatisticsLabor"
resultMap=
"tStatisticsLaborMap"
>
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,
a.SALARY_TAX PERSONAL_TAX,a.ACTUAL_SALARY
INCOME,
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,
sum(a.SALARY_TAX) PERSONAL_TAX,sum(a.ACTUAL_SALARY)
INCOME,
b.UNIT_NAME DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG =
0 and a.SETTLEMENT_MONTH like '${lastYear}%
'
GROUP BY a.EMP_IDCARD
where a.DELETE_FLAG =
'1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '3
'
GROUP BY a.EMP_IDCARD
,a.EMP_NAME
</select>
</mapper>
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TStatisticsRemunerationMapper.xml
View file @
c0900d0c
...
...
@@ -83,4 +83,15 @@
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select
id=
"doStatisticsRemuneration"
resultMap=
"tStatisticsRemunerationMap"
>
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,
sum(a.ACTUAL_SALARY) INCOME,b.UNIT_NAME DECLARE_UNIT,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '4'
GROUP BY a.EMP_IDCARD,a.EMP_NAME
</select>
</mapper>
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