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
fc4b1b5e
Commit
fc4b1b5e
authored
Oct 17, 2020
by
ilal
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
045629c3
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
141 additions
and
10 deletions
+141
-10
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
+10
-0
src/main/java/cn/timer/api/controller/xcgl/SalaryManagementController.java
+34
-9
src/main/java/cn/timer/api/controller/xcgl/SalaryTool.java
+36
-0
src/main/java/cn/timer/api/dao/xcgl/XcglAssoXzbMapper.java
+4
-1
src/main/java/cn/timer/api/dto/xcgl/FloatingDataDto.java
+16
-0
src/main/java/cn/timer/api/dto/xcgl/UserPersonnelDto.java
+16
-0
src/main/resources/mapping/xcgl/XcglAssoXzbMapper.xml
+25
-0
No files found.
src/main/java/cn/timer/api/controller/kqgl/ClockInTool.java
View file @
fc4b1b5e
...
@@ -753,4 +753,14 @@ public class ClockInTool {
...
@@ -753,4 +753,14 @@ public class ClockInTool {
return
cst
;
return
cst
;
}
}
/**
* Sun Nov 01 00:00:00 CST 2020
*/
public
static
String
SunNovCSTYMD
(
Date
date2
){
String
cst
;
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
cst
=
simpleDateFormat
.
format
(
date2
);
return
cst
;
}
}
}
src/main/java/cn/timer/api/controller/xcgl/SalaryManagementController.java
View file @
fc4b1b5e
...
@@ -1242,12 +1242,16 @@ public class SalaryManagementController {
...
@@ -1242,12 +1242,16 @@ public class SalaryManagementController {
@ApiOperation
(
value
=
"每月手动导入所需导出的表头数据"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"每月手动导入所需导出的表头数据"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
MonthlyManualImport
(
@CurrentUser
UserBean
userBean
,
@PathVariable
Integer
id
)
{
public
Result
<
Object
>
MonthlyManualImport
(
@CurrentUser
UserBean
userBean
,
@PathVariable
Integer
id
)
{
FloatingDataDto
data
=
new
FloatingDataDto
();
//rulestate:规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入]
//rulestate:规则状态[0:系统自动提取;1:系统固定值;2:固定公式计算;3:自定义公式计算;4:每月自动导入]
List
<
XcglAssoJsgzzx
>
jsgzzx
=
XcglAssoJsgzzx
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
XcglAssoJsgzzx
>().
lambda
().
eq
(
XcglAssoJsgzzx:
:
getXzzid
,
id
)
List
<
XcglAssoJsgzzx
>
jsgzzx
=
XcglAssoJsgzzx
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
XcglAssoJsgzzx
>().
lambda
().
eq
(
XcglAssoJsgzzx:
:
getXzzid
,
id
)
.
eq
(
XcglAssoJsgzzx:
:
getRulestate
,
4
));
.
eq
(
XcglAssoJsgzzx:
:
getRulestate
,
4
));
data
.
setJsgzzx
(
jsgzzx
);
List
<
UserPersonnelDto
>
sonn
=
xcglassoxzbmapper
.
UserPersonnel
(
id
,
userBean
.
getOrgCode
());
data
.
setUsers
(
sonn
);
return
ResultUtil
.
data
(
jsgzzx
);
return
ResultUtil
.
data
(
data
);
}
}
/**
/**
...
@@ -1693,8 +1697,9 @@ public class SalaryManagementController {
...
@@ -1693,8 +1697,9 @@ public class SalaryManagementController {
* @param wages_payable 应发工资
* @param wages_payable 应发工资
* @return
* @return
*/
*/
public
double
CalculationOfIndividualIncomeTax
(
String
gsus
,
String
salary_month
,
int
orgcode
,
int
wages_payable
)
{
public
double
CalculationOfIndividualIncomeTax
(
String
gsus
,
String
salary_month
,
int
orgcode
,
double
wages_payable
)
{
double
personalincome
=
0
;
double
personalincome
=
0
;
String
strY
=
new
SimpleDateFormat
(
"yyyy"
).
format
(
new
Date
());
//当月个税存在则直接获取 无则根据计算薪资月的上月个税为基准计算
//当月个税存在则直接获取 无则根据计算薪资月的上月个税为基准计算
XcglAssoGsjsmx
dyxzgs
=
XcglAssoGsjsmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
XcglAssoGsjsmx
>().
lambda
().
eq
(
XcglAssoGsjsmx:
:
getUserNum
,
gsus
).
eq
(
XcglAssoGsjsmx:
:
getQyid
,
orgcode
)
XcglAssoGsjsmx
dyxzgs
=
XcglAssoGsjsmx
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
XcglAssoGsjsmx
>().
lambda
().
eq
(
XcglAssoGsjsmx:
:
getUserNum
,
gsus
).
eq
(
XcglAssoGsjsmx:
:
getQyid
,
orgcode
)
.
eq
(
XcglAssoGsjsmx:
:
getSalaryMonth
,
salary_month
));
.
eq
(
XcglAssoGsjsmx:
:
getSalaryMonth
,
salary_month
));
...
@@ -1729,9 +1734,6 @@ public class SalaryManagementController {
...
@@ -1729,9 +1734,6 @@ public class SalaryManagementController {
}
}
//asdasds
gsmx
.
setTaxMonth
(
taxmonth
);
//税款所属月份
gsmx
.
setTaxMonth
(
taxmonth
);
//税款所属月份
// gsmx.setThmonthPersonal(thmonthPersonal);//本月个税
// gsmx.setThmonthPersonal(thmonthPersonal);//本月个税
// gsmx.setCumZljy(zxf == null ? 0 : zxf.getChildrenedu());//累计子女教育
// gsmx.setCumZljy(zxf == null ? 0 : zxf.getChildrenedu());//累计子女教育
...
@@ -1741,10 +1743,33 @@ public class SalaryManagementController {
...
@@ -1741,10 +1743,33 @@ public class SalaryManagementController {
// gsmx.setCumJxjy(zxf == null ? 0 : zxf.getContinueedu());//累计继续教育
// gsmx.setCumJxjy(zxf == null ? 0 : zxf.getContinueedu());//累计继续教育
// gsmx.setCumZxfjkc(zxf == null ? 0 : zxf.getTotalmoney());//累计专项附加扣除
// gsmx.setCumZxfjkc(zxf == null ? 0 : zxf.getTotalmoney());//累计专项附加扣除
// gsmx.setTaxType("工资薪金所得");//计税类型
// gsmx.setTaxType("工资薪金所得");//计税类型
// gsmx.setCurrentIncome(
currentIncom
e);//本期收入 【应发工资】
// gsmx.setCurrentIncome(
wages_payabl
e);//本期收入 【应发工资】
// gsmx.setCurrentSpecialDeduction(currentSpecialDeduction);//本期专项扣除 【个人的社保公积金缴纳扣除】
// gsmx.setCurrentSpecialDeduction(currentSpecialDeduction);//本期专项扣除 【个人的社保公积金缴纳扣除】
// gsmx.setCumSre(cumSre);//累计收入额 【本期收入+累计收入额(上月)】
// gsmx.setCumSre(cumSre);//累计收入额 【本期收入+累计收入额(上月)】
// gsmx.setCumJcfy(cumJcfy);//累计减除费用 【5000*在职月份数】
//
// double cumjcfy = 0;
// int xcy = 0;
// YgglMainEmp xzrz = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, gsus).eq(YgglMainEmp::getOrgCode, orgcode));
// if(xzrz != null) {
// String entry_date = ClockInTool.SunNovCSTYMD(xzrz.getRzTime());//yyyyMMdd
// if(bssz.getTaxReturnCycle().equals(1)) {//当月报税
// if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年
// xcy = SalaryTool.getMonthDiff(entry_date, salary_month+"-01");
// }else {
// xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01");
// }
// cumjcfy = xcy*5000;
// }else {//次月报税
// if(entry_date.substring(0,4).equals(strY)) {//判断是否是本年
// xcy = SalaryTool.getMonthDiff(entry_date, salary_month+"-01")+1;
// }else {
// xcy = SalaryTool.getMonthDiff(strY+"-01-01", salary_month+"-01")+1;
// }
// cumjcfy = xcy*5000;
// }
// }
// gsmx.setCumJcfy(cumjcfy);//累计减除费用 【5000*在职月份数】
//
// gsmx.setCumZxkc(cumZxkc);//累计专项扣除 【本期专项扣除+累计专项扣除(上月)】
// gsmx.setCumZxkc(cumZxkc);//累计专项扣除 【本期专项扣除+累计专项扣除(上月)】
// gsmx.setCumQtkc(cumQtkc);//累计其他扣除 【本期其他扣除+累计其他扣除(上月)】
// gsmx.setCumQtkc(cumQtkc);//累计其他扣除 【本期其他扣除+累计其他扣除(上月)】
// gsmx.setCumYnssde(cumYnssde);//累计应纳税所得额 【累计收入额-累计减除费用-累计专项扣除-累计专项附加扣除-累计其他扣除】
// gsmx.setCumYnssde(cumYnssde);//累计应纳税所得额 【累计收入额-累计减除费用-累计专项扣除-累计专项附加扣除-累计其他扣除】
...
@@ -1753,7 +1778,7 @@ public class SalaryManagementController {
...
@@ -1753,7 +1778,7 @@ public class SalaryManagementController {
// gsmx.setCumYnse(cumYnse);//累计应纳税额 【累计应纳税所得额*税率-速算扣除数】
// gsmx.setCumYnse(cumYnse);//累计应纳税额 【累计应纳税所得额*税率-速算扣除数】
// gsmx.setCumYyjse(cumYyjse);//累计已预缴纳税额 【累计已预缴税额(上月)+累计应补(退)税额(上月)】
// gsmx.setCumYyjse(cumYyjse);//累计已预缴纳税额 【累计已预缴税额(上月)+累计应补(退)税额(上月)】
// gsmx.setCumYbtse(cumYbtse);//累计应补(退)税额(本月个税) 【累计应纳税额-累计已预缴纳税额】
// gsmx.setCumYbtse(cumYbtse);//累计应补(退)税额(本月个税) 【累计应纳税额-累计已预缴纳税额】
// gsmx.setQyid(userBean.getOrgCode()
);//企业id
gsmx
.
setQyid
(
orgcode
);
//企业id
gsmx
.
insert
();
gsmx
.
insert
();
}
}
...
...
src/main/java/cn/timer/api/controller/xcgl/SalaryTool.java
View file @
fc4b1b5e
...
@@ -10,6 +10,42 @@ public class SalaryTool {
...
@@ -10,6 +10,42 @@ public class SalaryTool {
static
SimpleDateFormat
mat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
static
SimpleDateFormat
mat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
static
SimpleDateFormat
matM
=
new
SimpleDateFormat
(
"yyyy-MM"
);
static
SimpleDateFormat
matM
=
new
SimpleDateFormat
(
"yyyy-MM"
);
/**
* 获取两个日期相差的月数
* @param d2 较大的日期
* @param d1 较小的日期
* @return 如果d1>d2返回 月数差 否则返回0
*/
public
static
int
getMonthDiff
(
String
d1
,
String
d2
)
throws
ParseException
{
Calendar
c1
=
Calendar
.
getInstance
();
Calendar
c2
=
Calendar
.
getInstance
();
//将String日期转换成date
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
java
.
util
.
Date
date1
=
sdf
.
parse
(
d1
);
java
.
util
.
Date
date2
=
sdf
.
parse
(
d2
);
c1
.
setTime
(
date1
);
c2
.
setTime
(
date2
);
//判断两个日期的大小
if
(
c2
.
getTimeInMillis
()
<
c1
.
getTimeInMillis
())
return
0
;
int
year1
=
c1
.
get
(
Calendar
.
YEAR
);
int
year2
=
c2
.
get
(
Calendar
.
YEAR
);
int
month1
=
c1
.
get
(
Calendar
.
MONTH
);
int
month2
=
c2
.
get
(
Calendar
.
MONTH
);
int
day1
=
c1
.
get
(
Calendar
.
DAY_OF_MONTH
);
int
day2
=
c2
.
get
(
Calendar
.
DAY_OF_MONTH
);
// 获取年的差值 假设 d1 = 2015-9-30 d2 = 2015-12-16
int
yearInterval
=
year2
-
year1
;
// 如果 d1的 月-日 小于 d2的 月-日 那么 yearInterval-- 这样就得到了相差的年数
if
(
month2
<
month1
||
month1
==
month2
&&
day2
<
day1
)
yearInterval
--;
// 获取月数差值
int
monthInterval
=
(
month2
+
12
)
-
month1
;
if
(
day2
>
day1
)
monthInterval
++;
monthInterval
%=
12
;
return
yearInterval
*
12
+
monthInterval
+
1
;
}
public
static
Date
strToDateLong
(
String
strDate
)
{
public
static
Date
strToDateLong
(
String
strDate
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
ParsePosition
pos
=
new
ParsePosition
(
0
);
...
...
src/main/java/cn/timer/api/dao/xcgl/XcglAssoXzbMapper.java
View file @
fc4b1b5e
package
cn
.
timer
.
api
.
dao
.
xcgl
;
package
cn
.
timer
.
api
.
dao
.
xcgl
;
import
java.util.List
;
import
java.util.List
;
import
cn.timer.api.dto.xcgl.CheckSalaryStaffDto
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
@@ -9,6 +8,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -9,6 +8,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
cn.timer.api.bean.xcgl.XcglAssoXzb
;
import
cn.timer.api.bean.xcgl.XcglAssoXzb
;
import
cn.timer.api.dto.xcgl.CalculationDto
;
import
cn.timer.api.dto.xcgl.CalculationDto
;
import
cn.timer.api.dto.xcgl.CalculationValueDto
;
import
cn.timer.api.dto.xcgl.CalculationValueDto
;
import
cn.timer.api.dto.xcgl.CheckSalaryStaffDto
;
import
cn.timer.api.dto.xcgl.UserPersonnelDto
;
/**
/**
* 薪资表
* 薪资表
...
@@ -40,4 +41,6 @@ public interface XcglAssoXzbMapper extends BaseMapper<XcglAssoXzb> {
...
@@ -40,4 +41,6 @@ public interface XcglAssoXzbMapper extends BaseMapper<XcglAssoXzb> {
int
NumberOvertime
(
int
orgcode
,
String
apptime
,
int
userid
);
int
NumberOvertime
(
int
orgcode
,
String
apptime
,
int
userid
);
int
PeriodsOvertime
(
int
orgcode
,
String
apptime
,
int
overtimetypeid
,
int
userid
);
int
PeriodsOvertime
(
int
orgcode
,
String
apptime
,
int
overtimetypeid
,
int
userid
);
List
<
UserPersonnelDto
>
UserPersonnel
(
int
xzzid
,
int
orgcode
);
}
}
src/main/java/cn/timer/api/dto/xcgl/FloatingDataDto.java
0 → 100644
View file @
fc4b1b5e
package
cn
.
timer
.
api
.
dto
.
xcgl
;
import
java.util.List
;
import
cn.timer.api.bean.xcgl.XcglAssoJsgzzx
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
FloatingDataDto
{
List
<
UserPersonnelDto
>
users
;
List
<
XcglAssoJsgzzx
>
jsgzzx
;
}
src/main/java/cn/timer/api/dto/xcgl/UserPersonnelDto.java
0 → 100644
View file @
fc4b1b5e
package
cn
.
timer
.
api
.
dto
.
xcgl
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
UserPersonnelDto
{
String
orgcode
;
int
empnum
;
String
empname
;
String
dept
;
//部门
String
post
;
//职位
}
src/main/resources/mapping/xcgl/XcglAssoXzbMapper.xml
View file @
fc4b1b5e
...
@@ -35,6 +35,14 @@
...
@@ -35,6 +35,14 @@
<result
column=
"xzxjg"
property=
"xzxjg"
/>
<result
column=
"xzxjg"
property=
"xzxjg"
/>
</resultMap>
</resultMap>
<resultMap
id=
"UserPersonnelDtoMap"
type=
"cn.timer.api.dto.xcgl.UserPersonnelDto"
>
<result
column=
"orgcode"
property=
"orgcode"
/>
<result
column=
"empnum"
property=
"empnum"
/>
<result
column=
"empname"
property=
"empname"
/>
<result
column=
"dept"
property=
"dept"
/>
<result
column=
"post"
property=
"post"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id,
id,
userid,
userid,
...
@@ -53,6 +61,23 @@
...
@@ -53,6 +61,23 @@
qyid XcglAssoXzb_qyid
qyid XcglAssoXzb_qyid
</sql>
</sql>
<select
id=
"UserPersonnel"
resultMap=
"UserPersonnelDtoMap"
>
select aa.orgcode,aa.empnum,aa.empname,aa.dept,aa.post
from (select emp.org_code as orgcode,
emp.emp_num as empnum,
emp.`name` as empname,
bmgw.dept,
bmgw.post
from yggl_main_emp emp
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
) as bmgw on bmgw.mid = emp.bmgw_id
where emp.emp_num in (select xzury.userid from xcgl_asso_xzury xzury where xzury.xzzid = #{xzzid})
) as aa
where aa.orgcode = #{orgcode}
</select>
<select
id=
"Holidayamount"
>
<select
id=
"Holidayamount"
>
select IFNULL(SUM(su.duration),0)
select IFNULL(SUM(su.duration),0)
from kqgl_asso_relation_summary su
from kqgl_asso_relation_summary su
...
...
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