Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-staff
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 37aaebe5
authored
Jan 14, 2026
by
zhoulm
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工资计算
1 parent
90588a35
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
398 additions
and
212 deletions
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/dto/salary/StaffMonthSalarySlipDTO.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthBusinessData.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthSalarySlip.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemote.java
rpc-dj-staff/pom.xml
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/config/dubbo/SmartCarLifeDubboConfig.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/constant/CommonConstants.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthBusinessDataMapper.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthSalarySlipMapper.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemoteImpl.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthBusinessDataService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthSalarySlipService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/util/CommonUtil.java
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthBusinessDataMapper.xml
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthSalarySlipMapper.xml
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/dto/salary/StaffMonthSalarySlipDTO.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
dto
.
salary
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
import
lombok.experimental.SuperBuilder
;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@ToString
public
class
StaffMonthSalarySlipDTO
extends
StaffMonthSalarySlip
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
4482729958297967553L
;
@ApiModelProperty
(
notes
=
"员工手机号列表"
)
private
List
<
String
>
staffPhones
;
@ApiModelProperty
(
notes
=
"月份列表(格式:yyyy-MM)"
)
private
List
<
String
>
salaryMonthList
;
@ApiModelProperty
(
notes
=
"工资月份-开始"
)
private
String
salaryMonthBegin
;
@ApiModelProperty
(
notes
=
"工资月份-结束"
)
private
String
salaryMonthEnd
;
private
BigDecimal
totalActualSalary
;
}
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthBusinessData.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
model
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
model
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
javax.persistence.*
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.ToString
;
import
lombok.experimental.SuperBuilder
;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
@ToString
@Table
(
name
=
"dj_car_life_staff_month_business_data"
)
@Table
(
name
=
"dj_car_life_staff_month_business_data"
)
public
class
StaffMonthBusinessData
{
public
class
StaffMonthBusinessData
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
9037646833505966717L
;
/**
/**
* 主键ID
* 主键ID
*/
*/
...
@@ -26,10 +47,10 @@ public class StaffMonthBusinessData {
...
@@ -26,10 +47,10 @@ public class StaffMonthBusinessData {
private
String
salaryMonth
;
private
String
salaryMonth
;
/**
/**
* 业务场景类型
* 业务场景类型
(0:轻改,1:权益;2:延保)
*/
*/
@Column
(
name
=
"business_type"
)
@Column
(
name
=
"business_type"
)
private
String
businessType
;
private
Byte
businessType
;
/**
/**
* 产值
* 产值
...
@@ -72,202 +93,4 @@ public class StaffMonthBusinessData {
...
@@ -72,202 +93,4 @@ public class StaffMonthBusinessData {
*/
*/
@Column
(
name
=
"deleted_flag"
)
@Column
(
name
=
"deleted_flag"
)
private
String
deletedFlag
;
private
String
deletedFlag
;
/**
* 获取主键ID
*
* @return id - 主键ID
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置主键ID
*
* @param id 主键ID
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取驻店员工手机号
*
* @return staff_phone - 驻店员工手机号
*/
public
String
getStaffPhone
()
{
return
staffPhone
;
}
/**
* 设置驻店员工手机号
*
* @param staffPhone 驻店员工手机号
*/
public
void
setStaffPhone
(
String
staffPhone
)
{
this
.
staffPhone
=
staffPhone
==
null
?
null
:
staffPhone
.
trim
();
}
/**
* 获取工资月份
*
* @return salary_month - 工资月份
*/
public
String
getSalaryMonth
()
{
return
salaryMonth
;
}
/**
* 设置工资月份
*
* @param salaryMonth 工资月份
*/
public
void
setSalaryMonth
(
String
salaryMonth
)
{
this
.
salaryMonth
=
salaryMonth
==
null
?
null
:
salaryMonth
.
trim
();
}
/**
* 获取业务场景类型
*
* @return business_type - 业务场景类型
*/
public
String
getBusinessType
()
{
return
businessType
;
}
/**
* 设置业务场景类型
*
* @param businessType 业务场景类型
*/
public
void
setBusinessType
(
String
businessType
)
{
this
.
businessType
=
businessType
==
null
?
null
:
businessType
.
trim
();
}
/**
* 获取产值
*
* @return order_total_price - 产值
*/
public
BigDecimal
getOrderTotalPrice
()
{
return
orderTotalPrice
;
}
/**
* 设置产值
*
* @param orderTotalPrice 产值
*/
public
void
setOrderTotalPrice
(
BigDecimal
orderTotalPrice
)
{
this
.
orderTotalPrice
=
orderTotalPrice
;
}
/**
* 获取提成
*
* @return commission_price - 提成
*/
public
BigDecimal
getCommissionPrice
()
{
return
commissionPrice
;
}
/**
* 设置提成
*
* @param commissionPrice 提成
*/
public
void
setCommissionPrice
(
BigDecimal
commissionPrice
)
{
this
.
commissionPrice
=
commissionPrice
;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public
String
getCreatedBy
()
{
return
createdBy
;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public
void
setCreatedBy
(
String
createdBy
)
{
this
.
createdBy
=
createdBy
==
null
?
null
:
createdBy
.
trim
();
}
/**
* 获取创建时间
*
* @return created_date - 创建时间
*/
public
Date
getCreatedDate
()
{
return
createdDate
;
}
/**
* 设置创建时间
*
* @param createdDate 创建时间
*/
public
void
setCreatedDate
(
Date
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
/**
* 获取修改人
*
* @return updated_by - 修改人
*/
public
String
getUpdatedBy
()
{
return
updatedBy
;
}
/**
* 设置修改人
*
* @param updatedBy 修改人
*/
public
void
setUpdatedBy
(
String
updatedBy
)
{
this
.
updatedBy
=
updatedBy
==
null
?
null
:
updatedBy
.
trim
();
}
/**
* 获取修改时间
*
* @return updated_date - 修改时间
*/
public
Date
getUpdatedDate
()
{
return
updatedDate
;
}
/**
* 设置修改时间
*
* @param updatedDate 修改时间
*/
public
void
setUpdatedDate
(
Date
updatedDate
)
{
this
.
updatedDate
=
updatedDate
;
}
/**
* 获取删除标识(D:已删除;N:未删除)
*
* @return deleted_flag - 删除标识(D:已删除;N:未删除)
*/
public
String
getDeletedFlag
()
{
return
deletedFlag
;
}
/**
* 设置删除标识(D:已删除;N:未删除)
*
* @param deletedFlag 删除标识(D:已删除;N:未删除)
*/
public
void
setDeletedFlag
(
String
deletedFlag
)
{
this
.
deletedFlag
=
deletedFlag
==
null
?
null
:
deletedFlag
.
trim
();
}
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthSalarySlip.java
View file @
37aaebe
This diff is collapsed.
Click to expand it.
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemote.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
remote
.
salary
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.framework.core.annotation.ApiMethod
;
import
cn.com.glsx.framework.core.annotation.ApiParam
;
import
cn.com.glsx.framework.core.annotation.ApiParams
;
import
cn.com.glsx.framework.core.annotation.ApiResponse
;
import
cn.com.glsx.framework.core.annotation.ApiService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
@ApiService
(
value
=
"员工工资接口"
,
owner
=
"zhoulm"
,
protocol
=
ApiService
.
ProtocolEnum
.
dubbo
,
version
=
"1.0.0"
)
public
interface
StaffMonthSalarySlipRemote
{
@ApiMethod
(
"分页查询员工月度工资"
)
@ApiParam
(
name
=
"pagination"
,
notes
=
"分页查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"分页查询结果"
)
RpcResponse
<
RpcPagination
<
StaffMonthSalarySlipDTO
>>
pageStaffMonthSalary
(
@NotNull
RpcPagination
<
StaffMonthSalarySlipDTO
>
pagination
);
@ApiMethod
(
"统计员工月度工资"
)
@ApiParam
(
name
=
"dto"
,
notes
=
"查询条件"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"统计结果"
)
RpcResponse
<
StaffMonthSalarySlipDTO
>
statStaffMonthSalary
(
@NotNull
StaffMonthSalarySlipDTO
dto
);
@ApiMethod
(
"查询员工月度工资"
)
@ApiParams
({
@ApiParam
(
name
=
"staffPhone"
,
notes
=
"手机号"
,
dataType
=
ApiParam
.
DataTypeEnum
.
STRING
,
required
=
true
),
@ApiParam
(
name
=
"salaryMonth"
,
notes
=
"工资月份"
,
dataType
=
ApiParam
.
DataTypeEnum
.
STRING
,
required
=
true
)
})
@ApiResponse
(
"员工月度工资"
)
RpcResponse
<
StaffMonthSalarySlip
>
getStaffSalary
(
@NotBlank
String
staffPhone
,
@NotBlank
String
salaryMonth
);
}
rpc-dj-staff/pom.xml
View file @
37aaebe
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<dependency>
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<groupId>
cn.com.glsx.dj
</groupId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<version>
5.
3
.0-SNAPSHOT
</version>
<version>
5.
6
.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.com.glsx.entmicro
</groupId>
<groupId>
cn.com.glsx.entmicro
</groupId>
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/config/dubbo/SmartCarLifeDubboConfig.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
config
.
dubbo
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
config
.
dubbo
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.MerchantDailyReportHuaweiRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.MerchantDailyReportHuaweiRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffBehaviorDeductMoneyRecordRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote
;
import
cn.com.glsx.dj.staff.config.DubboConfig
;
import
cn.com.glsx.dj.staff.config.DubboConfig
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@Configuration
public
class
SmartCarLifeDubboConfig
extends
DubboConfig
{
public
class
SmartCarLifeDubboConfig
extends
DubboConfig
{
...
@@ -19,4 +23,19 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
...
@@ -19,4 +23,19 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
return
factory
.
builder
(
MerchantDailyReportHuaweiRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
return
factory
.
builder
(
MerchantDailyReportHuaweiRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
}
@Bean
public
StaffBaseInfoRemote
staffBaseInfoRemote
()
{
return
factory
.
builder
(
StaffBaseInfoRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
@Bean
public
GoodsOrderRemote
goodsOrderRemote
()
{
return
factory
.
builder
(
GoodsOrderRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
build
();
}
@Bean
public
StaffBehaviorDeductMoneyRecordRemote
staffBehaviorDeductMoneyRecordRemote
()
{
return
factory
.
builder
(
StaffBehaviorDeductMoneyRecordRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
}
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/constant/CommonConstants.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
constant
;
import
java.math.BigDecimal
;
public
class
CommonConstants
{
public
static
final
String
DEFAULT_UPDATE_BY
=
"system"
;
public
static
final
BigDecimal
ONEHUNDRED_BIGDECIMAL
=
BigDecimal
.
valueOf
(
100
);
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthBusinessDataMapper.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthBusinessData
;
import
cn.com.glsx.dj.staff.model.StaffMonthBusinessData
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
@Mapper
public
interface
StaffMonthBusinessDataMapper
extends
OreMapper
<
StaffMonthBusinessData
>
{
public
interface
StaffMonthBusinessDataMapper
extends
OreMapper
<
StaffMonthBusinessData
>
{
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/StaffMonthSalarySlipMapper.java
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
mapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
@Mapper
public
interface
StaffMonthSalarySlipMapper
extends
OreMapper
<
StaffMonthSalarySlip
>
{
public
interface
StaffMonthSalarySlipMapper
extends
OreMapper
<
StaffMonthSalarySlip
>
{
List
<
StaffMonthSalarySlipDTO
>
list
(
StaffMonthSalarySlipDTO
condition
);
StaffMonthSalarySlipDTO
statStaffMonthSalary
(
StaffMonthSalarySlipDTO
dto
);
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/remote/salary/StaffMonthSalarySlipRemoteImpl.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
remote
.
salary
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.dj.staff.service.salary.StaffMonthSalarySlipService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
@DubboService
(
version
=
"1.0.0"
,
validation
=
"true"
)
public
class
StaffMonthSalarySlipRemoteImpl
implements
StaffMonthSalarySlipRemote
{
@Autowired
private
StaffMonthSalarySlipService
staffMonthSalarySlipService
;
@Override
public
RpcResponse
<
RpcPagination
<
StaffMonthSalarySlipDTO
>>
pageStaffMonthSalary
(
@NotNull
RpcPagination
<
StaffMonthSalarySlipDTO
>
pagination
)
{
try
{
pagination
=
RpcPagination
.
copyPage
(
staffMonthSalarySlipService
.
pageStaffMonthSalary
(
pagination
));
return
RpcResponse
.
success
(
pagination
);
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
@Override
public
RpcResponse
<
StaffMonthSalarySlipDTO
>
statStaffMonthSalary
(
@NotNull
StaffMonthSalarySlipDTO
dto
)
{
try
{
return
RpcResponse
.
success
(
staffMonthSalarySlipService
.
statStaffMonthSalary
(
dto
));
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
@Override
public
RpcResponse
<
StaffMonthSalarySlip
>
getStaffSalary
(
@NotBlank
String
staffPhone
,
@NotBlank
String
salaryMonth
)
{
try
{
return
RpcResponse
.
success
(
staffMonthSalarySlipService
.
get
(
staffPhone
,
salaryMonth
));
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthBusinessDataService.java
0 → 100644
View file @
37aaebe
package
cn
.
com
.
glsx
.
dj
.
staff
.
service
.
salary
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
org.oreframework.boot.env.OrePropertyConfigurer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
cn.com.glsx.dj.smartcarlife.dto.GoodsOrderDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.OrderCountDTO
;
import
cn.com.glsx.dj.smartcarlife.enums.BusinessTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum.OrderStatus
;
import
cn.com.glsx.dj.smartcarlife.enums.OrderBusinessTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote
;
import
cn.com.glsx.dj.smartcarlife.util.DateUtils
;
import
cn.com.glsx.dj.staff.constant.CommonConstants
;
import
cn.com.glsx.dj.staff.mapper.StaffMonthBusinessDataMapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthBusinessData
;
import
cn.com.glsx.dj.staff.util.CommonUtil
;
import
cn.com.glsx.framework.core.beans.BaseModel
;
import
cn.com.glsx.framework.core.beans.BaseModel.DeletedFlagEnum
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.util.RpcAssert
;
import
lombok.extern.slf4j.Slf4j
;
import
tk.mybatis.mapper.entity.Example
;
@Slf4j
@Service
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
rollbackFor
=
RpcServiceException
.
class
)
public
class
StaffMonthBusinessDataService
{
@Lazy
@Autowired
private
StaffMonthBusinessDataService
thiz
;
@Autowired
private
StaffMonthBusinessDataMapper
staffMonthBusinessDataMapper
;
@Autowired
private
GoodsOrderRemote
goodsOrderRemote
;
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
List
<
StaffMonthBusinessData
>
updateStaffMonthBusinessData
(
String
staffPhone
,
String
salaryMonth
)
{
RpcAssert
.
assertNotEmpty
(
staffPhone
,
DefaultErrorEnum
.
DATA_NULL
,
"staffPhone not be null"
);
RpcAssert
.
assertNotEmpty
(
salaryMonth
,
DefaultErrorEnum
.
DATA_NULL
,
"salaryMonth not be null"
);
try
{
StaffMonthBusinessData
staffMonthBusinessData
=
new
StaffMonthBusinessData
();
staffMonthBusinessData
.
setDeletedFlag
(
BaseModel
.
DeletedFlagEnum
.
D
.
name
());
staffMonthBusinessData
.
setUpdatedDate
(
new
Date
());
Example
example
=
new
Example
(
StaffMonthBusinessData
.
class
);
example
.
createCriteria
().
andEqualTo
(
"staffPhone"
,
staffPhone
)
.
andEqualTo
(
"salaryMonth"
,
salaryMonth
)
.
andEqualTo
(
"deletedFlag"
,
BaseModel
.
DeletedFlagEnum
.
N
.
name
());
staffMonthBusinessDataMapper
.
updateByExampleSelective
(
staffMonthBusinessData
,
example
);
List
<
StaffMonthBusinessData
>
list
=
new
ArrayList
<>();
list
.
add
(
thiz
.
init
(
staffPhone
,
salaryMonth
,
OrderBusinessTypeEnum
.
LIGHTLY_MODIFY
));
list
.
add
(
thiz
.
init
(
staffPhone
,
salaryMonth
,
OrderBusinessTypeEnum
.
EQUITY
));
list
.
add
(
thiz
.
init
(
staffPhone
,
salaryMonth
,
OrderBusinessTypeEnum
.
EXTENDED_WARRANTY
));
staffMonthBusinessDataMapper
.
insertList
(
list
);
return
list
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
public
StaffMonthBusinessData
init
(
String
staffPhone
,
String
salaryMonth
,
OrderBusinessTypeEnum
businessType
)
{
RpcAssert
.
assertNotEmpty
(
staffPhone
,
DefaultErrorEnum
.
DATA_NULL
,
"staffPhone not be null"
);
RpcAssert
.
assertNotEmpty
(
salaryMonth
,
DefaultErrorEnum
.
DATA_NULL
,
"salaryMonth not be null"
);
RpcAssert
.
assertNotNull
(
businessType
,
DefaultErrorEnum
.
DATA_NULL
,
"businessType not be null"
);
try
{
String
monthFirstAndLastDayTime
=
DateUtils
.
getMonthFirstAndLastDayTime
(
salaryMonth
);
String
startDate
=
monthFirstAndLastDayTime
.
split
(
","
)[
0
];
String
endDate
=
monthFirstAndLastDayTime
.
split
(
","
)[
1
];
GoodsOrderDTO
condition
=
GoodsOrderDTO
.
builder
()
.
paySuccessStartDate
(
startDate
).
paySuccessEndDate
(
endDate
)
.
notAllRefund
(
true
).
sellerPhone
(
staffPhone
)
.
statusList
(
Arrays
.
asList
(
OrderStatus
.
PAYED
.
getValue
(),
OrderStatus
.
FINISHED
.
getValue
(),
OrderStatus
.
REFUNDED
.
getValue
()))
.
build
();
final
Date
now
=
new
Date
();
StaffMonthBusinessData
data
=
StaffMonthBusinessData
.
builder
()
.
staffPhone
(
staffPhone
).
salaryMonth
(
salaryMonth
)
.
businessType
(
businessType
.
getValue
())
.
orderTotalPrice
(
BigDecimal
.
ZERO
)
.
commissionPrice
(
BigDecimal
.
ZERO
)
.
createdBy
(
CommonConstants
.
DEFAULT_UPDATE_BY
).
createdDate
(
now
)
.
updatedBy
(
CommonConstants
.
DEFAULT_UPDATE_BY
).
updatedDate
(
now
)
.
deletedFlag
(
DeletedFlagEnum
.
N
.
name
())
.
build
();
OrderCountDTO
orderCount
=
null
;
switch
(
businessType
)
{
case
EQUITY:
condition
.
setSceneType
(
SceneTypeEnum
.
SCENE1_0
.
getValue
());
//权益服务
condition
.
setUpgradeGoodsTypeList
(
CommonUtil
.
convert2Integer
(
OrePropertyConfigurer
.
getString
(
"smartcarlife.goodsType.equity"
,
"126"
).
split
(
","
)));
orderCount
=
goodsOrderRemote
.
countSubOrderTotal
(
condition
).
getResult
();
break
;
case
EXTENDED_WARRANTY:
condition
.
setSceneType
(
SceneTypeEnum
.
SCENE1_0
.
getValue
());
//延保类
condition
.
setUpgradeGoodsTypeList
(
CommonUtil
.
convert2Integer
(
OrePropertyConfigurer
.
getString
(
"smartcarlife.goodsType.extendedInsurance"
,
"155"
).
split
(
","
)));
orderCount
=
goodsOrderRemote
.
countSubOrderTotal
(
condition
).
getResult
();
break
;
case
LIGHTLY_MODIFY:
condition
.
setSceneType
(
SceneTypeEnum
.
SCENE1_1
.
getValue
());
orderCount
=
goodsOrderRemote
.
countOrderTotal
(
condition
).
getResult
();
break
;
default
:
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVER_ERROR
,
"业务类型错误"
);
}
if
(
orderCount
!=
null
&&
orderCount
.
getTotalOutputPrice
()
!=
null
)
{
data
.
setOrderTotalPrice
(
orderCount
.
getTotalOutputPrice
());
}
//TODO //填充提成
return
data
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
}
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthSalarySlipService.java
0 → 100644
View file @
37aaebe
This diff is collapsed.
Click to expand it.
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/util/CommonUtil.java
View file @
37aaebe
...
@@ -4,6 +4,7 @@ package cn.com.glsx.dj.staff.util;
...
@@ -4,6 +4,7 @@ package cn.com.glsx.dj.staff.util;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Slf4j
@Slf4j
...
@@ -16,4 +17,17 @@ public class CommonUtil {
...
@@ -16,4 +17,17 @@ public class CommonUtil {
return
null
;
return
null
;
}
}
public
static
List
<
Integer
>
convert2Integer
(
String
[]
strArr
)
{
if
(
strArr
==
null
||
strArr
.
length
==
0
)
{
return
null
;
}
List
<
Integer
>
list
=
new
ArrayList
<>();
for
(
String
s:
strArr
)
{
try
{
list
.
add
(
Integer
.
valueOf
(
s
));
}
catch
(
Exception
e
)
{
}
}
return
list
.
isEmpty
()
?
null
:
list
;
}
}
}
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthBusinessDataMapper.xml
View file @
37aaebe
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"staff_phone"
property=
"staffPhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_phone"
property=
"staffPhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"salary_month"
property=
"salaryMonth"
jdbcType=
"CHAR"
/>
<result
column=
"salary_month"
property=
"salaryMonth"
jdbcType=
"CHAR"
/>
<result
column=
"business_type"
property=
"businessType"
jdbcType=
"VARCHAR"
/>
<result
column=
"business_type"
property=
"businessType"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
...
...
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthSalarySlipMapper.xml
View file @
37aaebe
...
@@ -20,16 +20,19 @@
...
@@ -20,16 +20,19 @@
<result
column=
"basic_salary"
property=
"basicSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"basic_salary"
property=
"basicSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"order_total_price"
property=
"orderTotalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"commission_price"
property=
"commissionPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduct_count"
property=
"dailyDeductCount"
/>
<result
column=
"daily_deduct_money"
property=
"dailyDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduct_money"
property=
"dailyDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduct_count"
property=
"padDeductCount"
/>
<result
column=
"pad_deduct_money"
property=
"padDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduct_money"
property=
"padDeductMoney"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_expenses"
property=
"deferExpenses"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_expenses"
property=
"deferExpenses"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_income"
property=
"deferIncome"
jdbcType=
"DECIMAL"
/>
<result
column=
"defer_income"
property=
"deferIncome"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduction"
property=
"dailyDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"daily_deduction"
property=
"dailyDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduction"
property=
"padDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"pad_deduction"
property=
"padDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"deferred_ratio"
property=
"deferredRatio"
jdbcType=
"DECIMAL"
/>
<result
column=
"deferred_ratio"
property=
"deferredRatio"
jdbcType=
"DECIMAL"
/>
<result
column=
"refund_offset"
property=
"refundOffset"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_deduction"
property=
"otherDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_deduction"
property=
"otherDeduction"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_deduction_detail"
property=
"otherDeductionDetail"
/>
<result
column=
"other_rewards"
property=
"otherRewards"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_rewards"
property=
"otherRewards"
jdbcType=
"DECIMAL"
/>
<result
column=
"other_rewards_detail"
property=
"otherRewardsDetail"
/>
<result
column=
"salary"
property=
"salary"
jdbcType=
"DECIMAL"
/>
<result
column=
"salary"
property=
"salary"
jdbcType=
"DECIMAL"
/>
<result
column=
"correct_salary"
property=
"correctSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"correct_salary"
property=
"correctSalary"
jdbcType=
"DECIMAL"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
<result
column=
"created_by"
property=
"createdBy"
jdbcType=
"VARCHAR"
/>
...
@@ -38,15 +41,61 @@
...
@@ -38,15 +41,61 @@
<result
column=
"updated_date"
property=
"updatedDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"updated_date"
property=
"updatedDate"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"deleted_flag"
property=
"deletedFlag"
jdbcType=
"CHAR"
/>
<result
column=
"deleted_flag"
property=
"deletedFlag"
jdbcType=
"CHAR"
/>
</resultMap>
</resultMap>
<resultMap
id=
"DTOResultMap"
type=
"cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO"
extends=
"BaseResultMap"
>
<result
column=
"totalActualSalary"
property=
"totalActualSalary"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
id, staff_name, staff_phone, business_types, salary_month, final_data_flag, should_work_day,
id, staff_name, staff_phone, business_types, salary_month, final_data_flag, should_work_day,
actual_work_day, salary_standard, minimum_salary, performance_level, performance_salary,
actual_work_day, salary_standard, minimum_salary, performance_level, performance_salary,
basic_salary, order_total_price, commission_price,
daily_deduct_money
, pad_deduct_money,
basic_salary, order_total_price, commission_price,
daily_deduct_count, daily_deduct_money,pad_deduct_count
, pad_deduct_money,
defer_expenses, defer_income, daily_deduction, pad_deduction, deferred_ratio,
refund_offset,
defer_expenses, defer_income, daily_deduction, pad_deduction, deferred_ratio,
other_deduction,
other_rewards
, salary, correct_salary, created_by, created_date,
other_deduction,
other_deduction_detail, other_rewards,other_rewards_detail
, salary, correct_salary, created_by, created_date,
updated_by, updated_date, deleted_flag
updated_by, updated_date, deleted_flag
</sql>
</sql>
<select
id=
"list"
parameterType=
"cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipDTO"
resultMap=
"DTOResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from dj_car_life_staff_month_salary_slip
<include
refid=
"list_condition"
/>
order by salary_month desc
</select>
<select
id=
"statStaffMonthSalary"
resultMap=
"DTOResultMap"
>
select ifnull(sum(ifnull(correct_salary, salary)), 0) totalActualSalary
from dj_car_life_staff_month_salary_slip
<include
refid=
"list_condition"
/>
</select>
<sql
id=
"list_condition"
>
<where>
deleted_flag = 'N'
<if
test=
"staffPhone != null and staffPhone != ''"
>
and staff_phone = #{staffPhone}
</if>
<if
test=
"staffPhones != null and staffPhones.size()>0"
>
and staff_phone in
<foreach
collection=
"staffPhones"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"salaryMonthList != null and salaryMonthList.size()>0"
>
and salary_month in
<foreach
collection=
"salaryMonthList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"salaryMonth != null and salaryMonth != ''"
>
and salary_month = #{salaryMonth}
</if>
<if
test=
"salaryMonthBegin != null and salaryMonthBegin != ''"
>
and salary_month
>
= #{salaryMonthBegin}
</if>
<if
test=
"salaryMonthEnd != null and salaryMonthEnd != ''"
>
and salary_month
<
= #{salaryMonthEnd}
</if>
</where>
</sql>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment