diff --git a/resource/sqlupgrade/DM/sql202503190103.sql b/resource/sqlupgrade/DM/sql202503190103.sql
new file mode 100644
index 000000000..9940e3121
--- /dev/null
+++ b/resource/sqlupgrade/DM/sql202503190103.sql
@@ -0,0 +1,38 @@
+create table hrsa_deduction_amount
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ employee_id number,
+ employee_type number,
+ employee_name varchar2(100),
+ job_num varchar2(100),
+ card_type number,
+ card_num varchar2(100),
+ nationality varchar2(200),
+ deduct_flag number,
+ successfully_declared number,
+ declare_status number,
+ declare_error_msg varchar2(1000)
+);
+/
+
+create table hrsa_deduction_amount_record
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ request_id varchar2(100)
+);
+/
+
diff --git a/resource/sqlupgrade/GS/sql202503190103.sql b/resource/sqlupgrade/GS/sql202503190103.sql
new file mode 100644
index 000000000..9940e3121
--- /dev/null
+++ b/resource/sqlupgrade/GS/sql202503190103.sql
@@ -0,0 +1,38 @@
+create table hrsa_deduction_amount
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ employee_id number,
+ employee_type number,
+ employee_name varchar2(100),
+ job_num varchar2(100),
+ card_type number,
+ card_num varchar2(100),
+ nationality varchar2(200),
+ deduct_flag number,
+ successfully_declared number,
+ declare_status number,
+ declare_error_msg varchar2(1000)
+);
+/
+
+create table hrsa_deduction_amount_record
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ request_id varchar2(100)
+);
+/
+
diff --git a/resource/sqlupgrade/JC/sql202503190103.sql b/resource/sqlupgrade/JC/sql202503190103.sql
new file mode 100644
index 000000000..9940e3121
--- /dev/null
+++ b/resource/sqlupgrade/JC/sql202503190103.sql
@@ -0,0 +1,38 @@
+create table hrsa_deduction_amount
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ employee_id number,
+ employee_type number,
+ employee_name varchar2(100),
+ job_num varchar2(100),
+ card_type number,
+ card_num varchar2(100),
+ nationality varchar2(200),
+ deduct_flag number,
+ successfully_declared number,
+ declare_status number,
+ declare_error_msg varchar2(1000)
+);
+/
+
+create table hrsa_deduction_amount_record
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ request_id varchar2(100)
+);
+/
+
diff --git a/resource/sqlupgrade/Mysql/sql202503190103.sql b/resource/sqlupgrade/Mysql/sql202503190103.sql
new file mode 100644
index 000000000..6c78f00ed
--- /dev/null
+++ b/resource/sqlupgrade/Mysql/sql202503190103.sql
@@ -0,0 +1,37 @@
+CREATE TABLE hrsa_deduction_amount
+(
+ id bigint(0),
+ create_time datetime(0),
+ update_time datetime(0),
+ creator bigint(0),
+ delete_type int(0),
+ tenant_key varchar(10),
+ tax_agent_id bigint(0),
+ year varchar(100),
+ employee_id bigint(0),
+ employee_type tinyint(0),
+ employee_name varchar(100),
+ job_num varchar(100),
+ card_type tinyint(0),
+ card_num varchar(100),
+ nationality varchar(200),
+ deduct_flag tinyint(0),
+ successfully_declared tinyint(0),
+ declare_status tinyint(0),
+ declare_error_msg varchar(3000),
+ PRIMARY KEY (id) USING BTREE
+);
+
+CREATE TABLE hrsa_deduction_amount_record
+(
+ id bigint(0),
+ create_time datetime(0),
+ update_time datetime(0),
+ creator bigint(0),
+ delete_type int(0),
+ tenant_key varchar(10),
+ tax_agent_id bigint(0),
+ year varchar(255),
+ request_id varchar(100),
+ PRIMARY KEY (id) USING BTREE
+);
diff --git a/resource/sqlupgrade/Oracle/sql202503190103.sql b/resource/sqlupgrade/Oracle/sql202503190103.sql
new file mode 100644
index 000000000..172207806
--- /dev/null
+++ b/resource/sqlupgrade/Oracle/sql202503190103.sql
@@ -0,0 +1,37 @@
+create table hrsa_deduction_amount
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ employee_id number,
+ employee_type number,
+ employee_name varchar2(100),
+ job_num varchar2(100),
+ card_type number,
+ card_num varchar2(100),
+ nationality varchar2(200),
+ deduct_flag number,
+ successfully_declared number,
+ declare_status number,
+ declare_error_msg varchar2(1000)
+)
+/
+
+create table hrsa_deduction_amount_record
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ request_id varchar2(100)
+)
+/
\ No newline at end of file
diff --git a/resource/sqlupgrade/PG/sql202503190103.sql b/resource/sqlupgrade/PG/sql202503190103.sql
new file mode 100644
index 000000000..7f39dcf84
--- /dev/null
+++ b/resource/sqlupgrade/PG/sql202503190103.sql
@@ -0,0 +1,37 @@
+create table hrsa_deduction_amount
+(
+ id bigint primary key ,
+ create_time timestamp,
+ update_time timestamp,
+ creator bigint,
+ delete_type int,
+ tenant_key varchar(10),
+ tax_agent_id bigint,
+ year varchar(100),
+ employee_id bigint,
+ employee_type smallint,
+ employee_name varchar(100),
+ job_num varchar(100),
+ card_type smallint,
+ card_num varchar(100),
+ nationality varchar(200),
+ deduct_flag smallint,
+ successfully_declared smallint,
+ declare_status smallint,
+ declare_error_msg varchar(3000)
+);
+/
+
+create table hrsa_deduction_amount_record
+(
+ id bigint primary key ,
+ create_time timestamp,
+ update_time timestamp,
+ creator bigint,
+ delete_type int default 0,
+ tenant_key varchar(10),
+ tax_agent_id bigint,
+ year varchar(100),
+ request_id varchar(100)
+);
+/
\ No newline at end of file
diff --git a/resource/sqlupgrade/SQLServer/sql202503190103.sql b/resource/sqlupgrade/SQLServer/sql202503190103.sql
new file mode 100644
index 000000000..3aaee1960
--- /dev/null
+++ b/resource/sqlupgrade/SQLServer/sql202503190103.sql
@@ -0,0 +1,37 @@
+create table hrsa_deduction_amount
+(
+ id bigint primary key ,
+ create_time datetime,
+ update_time datetime,
+ creator bigint,
+ delete_type int,
+ tenant_key nvarchar(10),
+ tax_agent_id bigint,
+ year nvarchar(100),
+ employee_id bigint,
+ employee_type tinyint,
+ employee_name nvarchar(100),
+ job_num nvarchar(100),
+ card_type tinyint,
+ card_num nvarchar(100),
+ nationality nvarchar(255),
+ deduct_flag tinyint,
+ successfully_declared tinyint,
+ declare_status tinyint,
+ declare_error_msg nvarchar(3000)
+)
+GO
+
+create table hrsa_deduction_amount_record
+(
+ id bigint primary key ,
+ create_time datetime,
+ update_time datetime,
+ creator bigint,
+ delete_type int,
+ tenant_key nvarchar(10),
+ tax_agent_id bigint,
+ year nvarchar(100),
+ request_id nvarchar(100)
+)
+GO
\ No newline at end of file
diff --git a/resource/sqlupgrade/ST/sql202503190103.sql b/resource/sqlupgrade/ST/sql202503190103.sql
new file mode 100644
index 000000000..9940e3121
--- /dev/null
+++ b/resource/sqlupgrade/ST/sql202503190103.sql
@@ -0,0 +1,38 @@
+create table hrsa_deduction_amount
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ employee_id number,
+ employee_type number,
+ employee_name varchar2(100),
+ job_num varchar2(100),
+ card_type number,
+ card_num varchar2(100),
+ nationality varchar2(200),
+ deduct_flag number,
+ successfully_declared number,
+ declare_status number,
+ declare_error_msg varchar2(1000)
+);
+/
+
+create table hrsa_deduction_amount_record
+(
+ id number primary key ,
+ create_time date,
+ update_time date,
+ creator number,
+ delete_type int,
+ tenant_key varchar2(10),
+ tax_agent_id number,
+ year varchar2(100),
+ request_id varchar2(100)
+);
+/
+
diff --git a/src/com/api/salary/web/DeductionAmountController.java b/src/com/api/salary/web/DeductionAmountController.java
new file mode 100644
index 000000000..b18635031
--- /dev/null
+++ b/src/com/api/salary/web/DeductionAmountController.java
@@ -0,0 +1,15 @@
+package com.api.salary.web;
+
+import javax.ws.rs.Path;
+
+/**
+ * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单
+ *
Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Path("/bs/hrmsalary/deductionAmount")
+public class DeductionAmountController extends com.engine.salary.web.DeductionAmountController {
+}
diff --git a/src/com/engine/salary/action/CheckStopSalaryAction.java b/src/com/engine/salary/action/CheckStopSalaryAction.java
index 78b3c0a7c..6243e6ed5 100644
--- a/src/com/engine/salary/action/CheckStopSalaryAction.java
+++ b/src/com/engine/salary/action/CheckStopSalaryAction.java
@@ -96,15 +96,18 @@ public class CheckStopSalaryAction implements Action {
List taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
+ log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
return FAILURE_AND_CONTINUE;
}
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
+ log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
return FAILURE_AND_CONTINUE;
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
+ log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
return FAILURE_AND_CONTINUE;
}
@@ -115,15 +118,17 @@ public class CheckStopSalaryAction implements Action {
List salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
if(CollectionUtils.isEmpty(salaryArchiveList)){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
+ log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
return FAILURE_AND_CONTINUE;
}
if(salaryArchiveList.size() > 1){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
+ log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
return FAILURE_AND_CONTINUE;
}
} catch (Exception e) {
- log.error("停薪校验异常", e);
+ log.error("停薪检查异常", e);
requestInfo.getRequestManager().setMessage(e.getMessage());
return FAILURE_AND_CONTINUE;
}
diff --git a/src/com/engine/salary/action/StopSalaryAction.java b/src/com/engine/salary/action/StopSalaryAction.java
index 6433e4e95..10d4d765a 100644
--- a/src/com/engine/salary/action/StopSalaryAction.java
+++ b/src/com/engine/salary/action/StopSalaryAction.java
@@ -107,15 +107,18 @@ public class StopSalaryAction implements Action {
List taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
if(CollectionUtils.isEmpty(taxAgentPOS)){
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
+ log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
return FAILURE_AND_CONTINUE;
}
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
+ log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
return FAILURE_AND_CONTINUE;
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
+ log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
return FAILURE_AND_CONTINUE;
}
@@ -123,10 +126,12 @@ public class StopSalaryAction implements Action {
List salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
if(CollectionUtils.isEmpty(salaryArchiveList)){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
+ log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
return FAILURE_AND_CONTINUE;
}
if(salaryArchiveList.size() > 1){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
+ log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
return FAILURE_AND_CONTINUE;
}
// 设置最后发薪日期
diff --git a/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java
new file mode 100644
index 000000000..234ec01cd
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/dto/DeductionAmountDTO.java
@@ -0,0 +1,126 @@
+package com.engine.salary.entity.deductionamount.dto;
+
+import com.engine.salary.annotation.TableTitle;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * 人员报送记录
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+//hrsa_deduction_amount
+public class DeductionAmountDTO {
+
+ /**
+ * ID
+ */
+ private Long id;
+
+ /**
+ * 个税扣缴义务人ID
+ */
+ private Long taxAgentId;
+
+
+ /**
+ * 税款所属年度
+ */
+ @TableTitle(title = "税款所属年度", dataIndex = "year", key = "year")
+ private String year;
+ /**
+ * 人员id
+ */
+ private Long employeeId;
+
+ /**
+ * 姓名
+ */
+ @TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName")
+ private String employeeName;
+
+ /**
+ * 人员类型
+ */
+ private Integer employeeType;
+
+ /**
+ * 工号
+ */
+ @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum")
+ private String jobNum;
+
+ /**
+ * 证件号码
+ */
+ @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum")
+ private String cardNum;
+
+ /**
+ * 证件类型
+ */
+ private Integer cardType;
+
+ /**
+ * 国籍
+ */
+ @TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality")
+ private String nationality;
+
+ /**
+ * 是否扣除
+ */
+ @TableTitle(title = "是否扣除", dataIndex = "deductFlag", key = "deductFlag")
+ private Integer deductFlag;
+
+ /**
+ * 报送状态
+ */
+ @TableTitle(title = "报送状态", dataIndex = "declareStatusName", key = "declareStatusName")
+ private String declareStatusName;
+ private Integer declareStatus;
+
+ private String declareErrorMsg;
+
+
+ /**
+ * 是否成功报送过
+ */
+ private Integer successfullyDeclared;
+
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+
+ /**
+ * 修改时间
+ */
+ private Date updateTime;
+
+ /**
+ * 创建人id
+ */
+ private Long creator;
+
+ /**
+ * 是否删除
+ */
+ private Integer deleteType;
+
+ /**
+ * 租户KEY
+ */
+ private String tenantKey;
+
+ //主键id集合
+ private Collection ids;
+
+}
\ No newline at end of file
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java
new file mode 100644
index 000000000..0deb8966f
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountAddParam.java
@@ -0,0 +1,45 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import com.engine.salary.util.valid.DataCheck;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountAddParam {
+ /**
+ * ID
+ */
+ private Long id;
+
+ /**
+ * 个税扣缴义务人id
+ */
+ @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空")
+ private Long taxAgentId;
+
+ /**
+ * 税款所属年度
+ */
+ @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误")
+ private String year;
+
+ /**
+ * 报送人员ids
+ */
+ private List employeeDeclareIds;
+}
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java
new file mode 100644
index 000000000..e5fe93593
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountConfirmParam.java
@@ -0,0 +1,31 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import com.engine.salary.util.valid.DataCheck;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountConfirmParam {
+
+ // 个税扣缴义务人id
+ @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空")
+ private Long taxAgentId;
+
+ // 税款所属年度
+ @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误")
+ private String year;
+
+}
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java
new file mode 100644
index 000000000..922884a44
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountDeleteParam.java
@@ -0,0 +1,27 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountDeleteParam {
+ /**
+ * ID
+ */
+ private List ids;
+}
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java
new file mode 100644
index 000000000..f0e2a2412
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountEditParam.java
@@ -0,0 +1,30 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import com.engine.salary.util.valid.DataCheck;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountEditParam {
+ /**
+ * ID
+ */
+ @DataCheck(require = true, message = "参数错误,id不能为空")
+ private Long id;
+
+ @DataCheck(require = true, message = "请选择是否扣除")
+ private Integer deductFlag;
+}
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java
new file mode 100644
index 000000000..111c7011e
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountFeedBackParam.java
@@ -0,0 +1,30 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import com.engine.salary.util.valid.DataCheck;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountFeedBackParam {
+
+ // 个税扣缴义务人id
+ @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空")
+ private Long taxAgentId;
+
+ // 税款所属年度
+ @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误")
+ private String year;
+}
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java
new file mode 100644
index 000000000..0ce30402b
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountListParam.java
@@ -0,0 +1,36 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import com.engine.salary.common.BaseQueryParam;
+import com.engine.salary.util.valid.DataCheck;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountListParam extends BaseQueryParam {
+
+ /**
+ * 个税扣缴义务人id
+ */
+ @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空")
+ private Long taxAgentId;
+
+ /**
+ * 税款所属年度
+ */
+ @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误")
+ private String year;
+
+}
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java
new file mode 100644
index 000000000..cd5c8f2ee
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountOnlineQueryParam.java
@@ -0,0 +1,31 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import com.engine.salary.util.valid.DataCheck;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountOnlineQueryParam {
+
+ // 个税扣缴义务人id
+ @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空")
+ private Long taxAgentId;
+
+ // 税款所属年度
+ @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误")
+ private String year;
+
+}
diff --git a/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java
new file mode 100644
index 000000000..d6b87fb23
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/param/DeductionAmountQueryParam.java
@@ -0,0 +1,31 @@
+package com.engine.salary.entity.deductionamount.param;
+
+import com.engine.salary.util.valid.DataCheck;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 扣除名单查询参数
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class DeductionAmountQueryParam {
+
+ // 个税扣缴义务人id
+ @DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空")
+ private Long taxAgentId;
+
+ // 税款所属年度
+ @DataCheck(require = true, message = "参数错误,税款所属年度参数格式错误")
+ private String year;
+
+}
diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java
new file mode 100644
index 000000000..24bd438a2
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountPO.java
@@ -0,0 +1,140 @@
+package com.engine.salary.entity.deductionamount.po;
+
+import com.engine.hrmelog.annotation.ElogTransform;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * 扣除名单
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+//hrsa_deduction_amount
+public class DeductionAmountPO {
+
+ /**
+ * ID
+ */
+ @ElogTransform(name = "ID")
+ private Long id;
+
+ /**
+ * 个税扣缴义务人ID
+ */
+ @ElogTransform(name = "个税扣缴义务人ID")
+ private Long taxAgentId;
+
+
+ /**
+ * 税款所属年度
+ */
+ @ElogTransform(name = "税款所属年度")
+ private String year;
+ /**
+ * 人员id
+ */
+ @ElogTransform(name = "人员id")
+ private Long employeeId;
+
+ /**
+ * 姓名
+ */
+ @ElogTransform(name = "姓名")
+ private String employeeName;
+
+ /**
+ * 人员类型
+ */
+ @ElogTransform(name = "人员类型")
+ private Integer employeeType;
+
+ /**
+ * 工号
+ */
+ @ElogTransform(name = "工号")
+ private String jobNum;
+
+ /**
+ * 国籍
+ */
+ @ElogTransform(name = "国籍")
+ private String nationality;
+
+ /**
+ * 证件号码
+ */
+ @ElogTransform(name = "证件号码")
+ private String cardNum;
+
+ /**
+ * 证件类型
+ */
+ @ElogTransform(name = "证件类型")
+ private Integer cardType;
+
+ /**
+ * 是否扣除
+ */
+ @ElogTransform(name = "是否扣除")
+ private Integer deductFlag;
+ /**
+ * 是否成功报送过
+ */
+ @ElogTransform(name = "是否成功报送过")
+ private Integer successfullyDeclared;
+
+ /**
+ * 报送状态
+ */
+ @ElogTransform(name = "报送状态")
+ private Integer declareStatus;
+
+ /**
+ * 申报失败的错误信息
+ */
+ @ElogTransform(name = "失败的错误信息")
+ private String declareErrorMsg;
+
+
+ /**
+ * 创建时间
+ */
+ @ElogTransform(name = "创建时间")
+ private Date createTime;
+
+
+ /**
+ * 修改时间
+ */
+ @ElogTransform(name = "修改时间")
+ private Date updateTime;
+
+ /**
+ * 创建人id
+ */
+ @ElogTransform(name = "创建人id")
+ private Long creator;
+
+ /**
+ * 是否删除
+ */
+ @ElogTransform(name = "是否删除")
+ private Integer deleteType;
+
+ /**
+ * 租户KEY
+ */
+ @ElogTransform(name = "租户KEY")
+ private String tenantKey;
+
+ //主键id集合
+ private Collection ids;
+
+}
\ No newline at end of file
diff --git a/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java
new file mode 100644
index 000000000..f476627f1
--- /dev/null
+++ b/src/com/engine/salary/entity/deductionamount/po/DeductionAmountRecordPO.java
@@ -0,0 +1,66 @@
+package com.engine.salary.entity.deductionamount.po;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * 扣减报送记录
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@Accessors(chain = true)
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+//"hrsa_employee_declare_record")
+public class DeductionAmountRecordPO {
+
+ /**
+ * 主键id
+ */
+ private Long id;
+ /**
+ * 个税扣缴义务人
+ */
+ private Long taxAgentId;
+ /**
+ * 税款所属年
+ */
+ private String year;
+ /**
+ * 请求的requestId
+ */
+ private String requestId;
+ /**
+ * 租户key
+ */
+ private String tenantKey;
+ /**
+ * 创建人id
+ */
+ private Long creator;
+ /**
+ * 是否删除
+ */
+ private Integer deleteType;
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+
+ private Collection ids;
+}
diff --git a/src/com/engine/salary/entity/extemp/dto/ExtEmpDTO.java b/src/com/engine/salary/entity/extemp/dto/ExtEmpDTO.java
new file mode 100644
index 000000000..83f356300
--- /dev/null
+++ b/src/com/engine/salary/entity/extemp/dto/ExtEmpDTO.java
@@ -0,0 +1,57 @@
+package com.engine.salary.entity.extemp.dto;
+
+
+import com.engine.hrmelog.annotation.ElogTransform;
+import com.engine.salary.annotation.TableTitle;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 外部人员
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+//hrsa_external_employee
+@ElogTransform( name = "非系统人员")
+public class ExtEmpDTO {
+
+ @ElogTransform(name = "主键id")
+ private Long id;
+
+ /**
+ * 姓名
+ */
+ @TableTitle(title = "姓名", dataIndex = "username", key = "username")
+ private String username;
+
+ /**
+ * 部门
+ */
+ @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
+ private String departmentName;
+
+
+ /**
+ * 分部
+ */
+ @TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName")
+ private String subcompanyName;
+
+ /**
+ * 入职日期
+ */
+ @TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate")
+ private String companystartdate;
+
+
+ /**
+ * 工号
+ */
+ @TableTitle(title = "工号", dataIndex = "workcode", key = "workcode")
+ private String workcode;
+
+}
diff --git a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java
index e57bd34ad..8dbd4eb20 100644
--- a/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java
+++ b/src/com/engine/salary/entity/taxdeclaration/bo/TaxDeclarationCommon.java
@@ -1,5 +1,7 @@
package com.engine.salary.entity.taxdeclaration.bo;
+import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
import com.engine.salary.annotation.SalaryFormulaVar;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.datacollection.AddUpSituation;
@@ -20,7 +22,6 @@ import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.db.IdGenerator;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.Field;
import java.math.BigDecimal;
@@ -49,29 +50,116 @@ public class TaxDeclarationCommon implements TaxDeclarationStrategy {
List taxDeclarationValues = Lists.newArrayListWithExpectedSize(employeeIdKeyMap.size());
for (Map.Entry> employeeIdEntry : employeeIdKeyMap.entrySet()) {
- // 取最后一次薪资核算记录的核算结果作为个税申报表的数据来源
- SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue());
- for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) {
- SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId());
- SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId());
- if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) {
- lastSalaryAcctEmployee = salaryAcctEmployee;
- }
- }
+
Map valueMap = Maps.newHashMap();
for (TaxReportColumnPO taxReportColumn : taxDeclareContext.getTaxReportColumns()) {
- SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap()
- .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex());
- List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId());
String value = "";
- if (salarySobTaxReportRule != null && salaryAcctResultValue != null) {
- value = salaryAcctResultValue.stream()
- .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId()))
- .findFirst()
- .orElse(new SalaryAcctResultPO())
- .getResultValue();
+
+ List firstValueList = Lists.newArrayList(
+ "taxFreeIncome",
+ "endowmentInsurance",
+ "medicalInsurance",
+ "unemploymentInsurance",
+ "housingProvidentFund",
+ "addUpChildEducation",
+ "addUpHousingLoanInterest",
+ "addUpHousingRent",
+ "addUpSupportElderly",
+ "addUpContinuingEducation",
+ "addUpInfantCare",
+ "annuity",
+ "commercialHealthInsurance",
+ "taxDeferredEndowmentInsurance",
+ "other",
+ "allowedDonation",
+ "taxDeduction",
+ "description",
+ "addUpAdvanceTax");
+
+ List lastValueList = Lists.newArrayList(
+ "addUpIncome",
+ "addUpTaxFreeIncome",
+ "addUpSubtraction",
+ "addUpSpecialDeduction",
+ "addUpOtherDeduction",
+ "addUpAllowedDonation",
+ "addUpTaxableIncome",
+ "taxRate",
+ "quickDeductionFactor",
+ "addUpTaxPayable",
+ "addUpTaxDeduction"
+ );
+
+ List mergeValueList = Lists.newArrayList(
+ "income",
+ "refundedOrSupplementedTax"
+ );
+
+ //取第一次值
+ if (firstValueList.contains(taxReportColumn.getReportColumnDataIndex())) {
+ SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue());
+ for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) {
+ SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId());
+ SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId());
+ if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) < 0) {
+ lastSalaryAcctEmployee = salaryAcctEmployee;
+ }
+ }
+ SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap()
+ .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex());
+ List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId());
+ if (salarySobTaxReportRule != null && salaryAcctResultValue != null) {
+ value = salaryAcctResultValue.stream()
+ .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId()))
+ .findFirst()
+ .orElse(new SalaryAcctResultPO())
+ .getResultValue();
+ }
+ value = StrUtil.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : "";
+ }
+ //取多次累计值
+ else if (mergeValueList.contains(taxReportColumn.getReportColumnDataIndex()) && Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) {
+ List employeePOS = employeeIdEntry.getValue();
+ BigDecimal income = new BigDecimal("0.00");
+ for (SalaryAcctEmployeePO salaryAcctEmployeePO : employeePOS) {
+ SalarySobTaxReportRulePO incomeRule = taxDeclareContext.getSalarySobTaxReportRuleMap()
+ .get(salaryAcctEmployeePO.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex());
+ List salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployeePO.getId());
+ if (incomeRule != null && salaryAcctResultValue != null) {
+ String incomeValue = salaryAcctResultValue.stream()
+ .filter(result -> result.getSalaryItemId().equals(incomeRule.getSalaryItemId()))
+ .findFirst()
+ .orElse(new SalaryAcctResultPO())
+ .getResultValue();
+ if (StrUtil.isNotBlank(incomeValue) && NumberUtil.isNumber(incomeValue)) {
+ income = income.add(new BigDecimal(incomeValue));
+ }
+ }
+ }
+ value = income.toPlainString();
+ }
+ //取最后一次值
+ else {
+ SalaryAcctEmployeePO lastSalaryAcctEmployee = SalaryEntityUtil.findFirst(employeeIdEntry.getValue());
+ for (SalaryAcctEmployeePO salaryAcctEmployee : employeeIdEntry.getValue()) {
+ SalaryAcctRecordPO salaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(salaryAcctEmployee.getSalaryAcctRecordId());
+ SalaryAcctRecordPO lastSalaryAcctRecord = taxDeclareContext.getSalaryAcctRecordMap().get(lastSalaryAcctEmployee.getSalaryAcctRecordId());
+ if (salaryAcctRecord.getCreateTime().compareTo(lastSalaryAcctRecord.getCreateTime()) > 0) {
+ lastSalaryAcctEmployee = salaryAcctEmployee;
+ }
+ }
+ SalarySobTaxReportRulePO salarySobTaxReportRule = taxDeclareContext.getSalarySobTaxReportRuleMap()
+ .get(lastSalaryAcctEmployee.getSalarySobId() + "-" + taxReportColumn.getReportColumnDataIndex());
+ List salaryAcctResultValue = salaryAcctResultValueMap.get(lastSalaryAcctEmployee.getId());
+ if (salarySobTaxReportRule != null && salaryAcctResultValue != null) {
+ value = salaryAcctResultValue.stream()
+ .filter(result -> result.getSalaryItemId().equals(salarySobTaxReportRule.getSalaryItemId()))
+ .findFirst()
+ .orElse(new SalaryAcctResultPO())
+ .getResultValue();
+ }
+ value = StrUtil.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : "";
}
- value = StringUtils.isNotBlank(value) ? value : Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue()) ? "0.00" : "";
valueMap.put(taxReportColumn.getReportColumnDataIndex(), value);
}
TaxDeclarationValuePO taxDeclarationValue = TaxDeclarationValuePO.builder()
diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java
index a6e79e5ec..a5d1ef376 100644
--- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java
+++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java
@@ -48,7 +48,7 @@ public class FailEmployeeListDTO {
private String errorMsg;
//所得项目
- @TableTitle(title = "所得项目", dataIndex = "incomeCategory", key = "incomeCategory")
- @ExcelHead(title = "所得项目", dataIndex = "incomeCategory")
+// @TableTitle(title = "所得项目", dataIndex = "incomeCategory", key = "incomeCategory")
+// @ExcelHead(title = "所得项目", dataIndex = "incomeCategory")
private String incomeCategory;
}
diff --git a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java
index 2a91aafde..e0d759613 100644
--- a/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java
+++ b/src/com/engine/salary/enums/employeedeclare/DeclareStatusEnum.java
@@ -2,6 +2,8 @@ package com.engine.salary.enums.employeedeclare;
import com.engine.salary.enums.BaseEnum;
+import java.util.Objects;
+
/**
* 人员报送状态
* Copyright: Copyright (c) 2023
@@ -43,4 +45,13 @@ public enum DeclareStatusEnum implements BaseEnum {
public Integer getLabelId() {
return labelId;
}
+
+ public static DeclareStatusEnum getByValue(Integer value) {
+ for (DeclareStatusEnum e : DeclareStatusEnum.values()) {
+ if (Objects.equals(e.getValue(), value)) {
+ return e;
+ }
+ }
+ return NOT_DECLARE;
+ }
}
diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java
new file mode 100644
index 000000000..352d00a2e
--- /dev/null
+++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.java
@@ -0,0 +1,74 @@
+package com.engine.salary.mapper.deductionamount;
+
+import com.engine.salary.entity.deductionamount.po.DeductionAmountPO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Collection;
+import java.util.List;
+
+public interface DeductionAmountMapper {
+
+ /**
+ * 查询所有记录
+ *
+ * @return 返回集合,没有返回空List
+ */
+ List listAll();
+
+ /**
+ * 条件查询
+ *
+ * @return 返回集合,没有返回空List
+ */
+ List listSome(DeductionAmountPO deductionAmount);
+
+
+ /**
+ * 根据主键查询
+ *
+ * @param id 主键
+ * @return 返回记录,没有返回null
+ */
+ DeductionAmountPO getById(Long id);
+
+ /**
+ * 新增,忽略null字段
+ *
+ * @param deductionAmount 新增的记录
+ * @return 返回影响行数
+ */
+ int insertIgnoreNull(DeductionAmountPO deductionAmount);
+
+
+ /**
+ * 修改,修改所有字段
+ *
+ * @param deductionAmount 修改的记录
+ * @return 返回影响行数
+ */
+ int update(DeductionAmountPO deductionAmount);
+
+ /**
+ * 修改,忽略null字段
+ *
+ * @param deductionAmount 修改的记录
+ * @return 返回影响行数
+ */
+ int updateIgnoreNull(DeductionAmountPO deductionAmount);
+
+ /**
+ * 删除记录
+ *
+ * @param deductionAmount 待删除的记录
+ * @return 返回影响行数
+ */
+ int delete(DeductionAmountPO deductionAmount);
+
+ /**
+ * 批量删除记录
+ *
+ * @param ids 主键id集合
+ */
+ void deleteByIds(@Param("ids") Collection ids);
+
+}
\ No newline at end of file
diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml
new file mode 100644
index 000000000..023a41f81
--- /dev/null
+++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountMapper.xml
@@ -0,0 +1,375 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ t
+ .
+ card_num
+ , t.card_type
+ , t.create_time
+ , t.creator
+ , t.declare_status
+ , t.deduct_flag
+ , t.delete_type
+ , t.employee_id
+ , t.employee_name
+ , t.employee_type
+ , t.id
+ , t.job_num
+ , t.successfully_declared
+ , t.declare_error_msg
+ , t.tax_agent_id
+ , t.tenant_key
+ , t.update_time
+ , t.year
+ , t.nationality
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO hrsa_deduction_amount
+
+
+
+ card_num,
+
+
+ card_type,
+
+
+ create_time,
+
+
+ creator,
+
+
+ declare_status,
+
+
+ deduct_flag,
+
+
+ delete_type,
+
+
+ employee_id,
+
+
+ employee_name,
+
+
+ employee_type,
+
+
+ id,
+
+
+ job_num,
+
+
+ successfully_declared,
+
+
+ declare_error_msg,
+
+
+ tax_agent_id,
+
+
+ tenant_key,
+
+
+ update_time,
+
+
+ year,
+
+
+ nationality,
+
+
+
+
+ #{cardNum},
+
+
+ #{cardType},
+
+
+ #{createTime},
+
+
+ #{creator},
+
+
+ #{declareStatus},
+
+
+ #{deductFlag},
+
+
+ #{deleteType},
+
+
+ #{employeeId},
+
+
+ #{employeeName},
+
+
+ #{employeeType},
+
+
+ #{id},
+
+
+ #{jobNum},
+
+
+ #{successfullyDeclared},
+
+
+ #{declareErrorMsg},
+
+
+ #{taxAgentId},
+
+
+ #{tenantKey},
+
+
+ #{updateTime},
+
+
+ #{year},
+
+
+ #{nationality},
+
+
+
+
+
+
+
+ UPDATE hrsa_deduction_amount
+
+ card_num=#{cardNum},
+ card_type=#{cardType},
+ create_time=#{createTime},
+ creator=#{creator},
+ declare_status=#{declareStatus},
+ deduct_flag=#{deductFlag},
+ delete_type=#{deleteType},
+ employee_id=#{employeeId},
+ employee_name=#{employeeName},
+ employee_type=#{employeeType},
+ job_num=#{jobNum},
+ successfully_declared=#{successfullyDeclared},
+ declare_error_msg=#{declareErrorMsg},
+ tax_agent_id=#{taxAgentId},
+ tenant_key=#{tenantKey},
+ update_time=#{updateTime},
+ year=#{year},
+ nationality=#{nationality},
+
+ WHERE id = #{id} AND delete_type = 0
+
+
+
+
+
+ UPDATE hrsa_deduction_amount
+
+
+ card_num=#{cardNum},
+
+
+ card_type=#{cardType},
+
+
+ create_time=#{createTime},
+
+
+ creator=#{creator},
+
+
+ declare_status=#{declareStatus},
+
+
+ deduct_flag=#{deductFlag},
+
+
+ delete_type=#{deleteType},
+
+
+ employee_id=#{employeeId},
+
+
+ employee_name=#{employeeName},
+
+
+ employee_type=#{employeeType},
+
+
+ job_num=#{jobNum},
+
+
+ successfully_declared=#{successfullyDeclared},
+
+
+ declare_error_msg=#{declareErrorMsg},
+
+
+ tax_agent_id=#{taxAgentId},
+
+
+ tenant_key=#{tenantKey},
+
+
+ update_time=#{updateTime},
+
+
+ year=#{year},
+
+
+ nationality=#{nationality},
+
+
+ WHERE id = #{id} AND delete_type = 0
+
+
+
+
+
+ UPDATE hrsa_deduction_amount
+ SET delete_type=1
+ WHERE id = #{id}
+ AND delete_type = 0
+
+
+
+ UPDATE hrsa_deduction_amount
+ SET delete_type = 1
+ WHERE delete_type = 0
+ AND id IN
+
+ #{id}
+
+
+
+
+
\ No newline at end of file
diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java
new file mode 100644
index 000000000..ca2815680
--- /dev/null
+++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.java
@@ -0,0 +1,77 @@
+package com.engine.salary.mapper.deductionamount;
+
+import com.engine.salary.entity.deductionamount.po.DeductionAmountRecordPO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Collection;
+import java.util.List;
+
+public interface DeductionAmountRecordMapper {
+
+ /**
+ * 查询所有记录
+ *
+ * @return 返回集合,没有返回空List
+ */
+ List listAll();
+
+ /**
+ * 条件查询
+ *
+ * @return 返回集合,没有返回空List
+ */
+ List listSome(DeductionAmountRecordPO deductionAmountRecord);
+
+
+ /**
+ * 根据主键查询
+ *
+ * @param id 主键
+ * @return 返回记录,没有返回null
+ */
+ DeductionAmountRecordPO getById(Long id);
+
+
+ DeductionAmountRecordPO getByTaxAgentIdAndYear(@Param("taxAgentId")Long taxAgentId,@Param("year") String year);
+
+ /**
+ * 新增,忽略null字段
+ *
+ * @param deductionAmountRecord 新增的记录
+ * @return 返回影响行数
+ */
+ int insertIgnoreNull(DeductionAmountRecordPO deductionAmountRecord);
+
+ /**
+ * 修改,修改所有字段
+ *
+ * @param deductionAmountRecord 修改的记录
+ * @return 返回影响行数
+ */
+ int update(DeductionAmountRecordPO deductionAmountRecord);
+
+ /**
+ * 修改,忽略null字段
+ *
+ * @param deductionAmountRecord 修改的记录
+ * @return 返回影响行数
+ */
+ int updateIgnoreNull(DeductionAmountRecordPO deductionAmountRecord);
+
+ /**
+ * 删除记录
+ *
+ * @param deductionAmountRecord 待删除的记录
+ * @return 返回影响行数
+ */
+ int delete(DeductionAmountRecordPO deductionAmountRecord);
+
+ /**
+ * 批量删除记录
+ * @param ids 主键id集合
+ */
+ void deleteByIds(@Param("ids") Collection ids);
+
+ void deleteByTaxAgentIdAndYear(@Param("taxAgentId")Long taxAgentId,@Param("year") String year);
+
+}
\ No newline at end of file
diff --git a/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml
new file mode 100644
index 000000000..930371420
--- /dev/null
+++ b/src/com/engine/salary/mapper/deductionamount/DeductionAmountRecordMapper.xml
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ t
+ .
+ create_time
+ , t.creator
+ , t.delete_type
+ , t.id
+ , t.request_id
+ , t.tax_agent_id
+ , t.tenant_key
+ , t.update_time
+ , t.year
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO hrsa_deduction_amount_record
+
+
+
+ create_time,
+
+
+ creator,
+
+
+ delete_type,
+
+
+ id,
+
+
+ request_id,
+
+
+ tax_agent_id,
+
+
+ tenant_key,
+
+
+ update_time,
+
+
+ year,
+
+
+
+
+ #{createTime},
+
+
+ #{creator},
+
+
+ #{deleteType},
+
+
+ #{id},
+
+
+ #{requestId},
+
+
+ #{taxAgentId},
+
+
+ #{tenantKey},
+
+
+ #{updateTime},
+
+
+ #{year},
+
+
+
+
+
+
+ UPDATE hrsa_deduction_amount_record
+
+ create_time=#{createTime},
+ creator=#{creator},
+ delete_type=#{deleteType},
+ request_id=#{requestId},
+ tax_agent_id=#{taxAgentId},
+ tenant_key=#{tenantKey},
+ update_time=#{updateTime},
+ year=#{year},
+
+ WHERE id = #{id} AND delete_type = 0
+
+
+
+
+
+ UPDATE hrsa_deduction_amount_record
+
+
+ create_time=#{createTime},
+
+
+ creator=#{creator},
+
+
+ delete_type=#{deleteType},
+
+
+ request_id=#{requestId},
+
+
+ tax_agent_id=#{taxAgentId},
+
+
+ tenant_key=#{tenantKey},
+
+
+ update_time=#{updateTime},
+
+
+ year=#{year},
+
+
+ WHERE id = #{id} AND delete_type = 0
+
+
+
+
+
+ UPDATE hrsa_deduction_amount_record
+ SET delete_type=1
+ WHERE id = #{id}
+ AND delete_type = 0
+
+
+
+ UPDATE hrsa_deduction_amount_record
+ SET delete_type = 1
+ WHERE delete_type = 0
+ AND id IN
+
+ #{id}
+
+
+
+
+ UPDATE hrsa_deduction_amount_record
+ SET delete_type = 1
+ WHERE delete_type = 0
+ AND tax_agent_id=#{taxAgentId}
+ AND year=#{year}
+
+
\ No newline at end of file
diff --git a/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java
new file mode 100644
index 000000000..05c3d3482
--- /dev/null
+++ b/src/com/engine/salary/remote/tax/client/DeductionAmountClient.java
@@ -0,0 +1,101 @@
+package com.engine.salary.remote.tax.client;
+
+import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
+import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest;
+import com.engine.salary.remote.tax.request.deductionAmount.QueryDeductionAmountRequest;
+import com.engine.salary.remote.tax.response.deductionAmount.ConfirmFeedbackResponse;
+import com.engine.salary.util.HttpUtil;
+import com.engine.salary.util.JsonUtil;
+import com.engine.salary.util.SingnatureData;
+import com.engine.salary.util.TaskUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import weaver.general.Util;
+
+import java.util.*;
+
+/**
+ * 申报扣减客户端
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Slf4j
+public class DeductionAmountClient extends TaxBaseClient {
+
+ public DeductionAmountClient(Long taxAgentId) {
+ super(taxAgentId);
+ }
+
+ public String query(String taxYear) {
+
+ String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/queryPreDeduct";
+ QueryDeductionAmountRequest queryDeductionAmountRequest = new QueryDeductionAmountRequest();
+ queryDeductionAmountRequest.setNsrsbh(returnPO.getTaxCode());
+ queryDeductionAmountRequest.setBizNo(UUID.randomUUID().toString().replace("-", ""));
+ queryDeductionAmountRequest.setQymc(returnPO.getTaxAgentName());
+ queryDeductionAmountRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
+ queryDeductionAmountRequest.setAreaid(returnPO.getAreaCode());
+ queryDeductionAmountRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
+ boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
+ queryDeductionAmountRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
+ queryDeductionAmountRequest.setJmsbmm("1");
+ queryDeductionAmountRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
+ queryDeductionAmountRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
+ queryDeductionAmountRequest.setJmsmmm("1");
+ queryDeductionAmountRequest.setMmlx("" + returnPO.getPasswordType());
+ queryDeductionAmountRequest.setSkssnd(taxYear);
+
+ String reqJson = JsonUtil.toJsonString(queryDeductionAmountRequest);
+ log.info("queryDeductionAmountRequest params --- \n{}\n", reqJson);
+ Map params = new HashMap<>(1);
+ Map header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
+
+ // 开始请求
+ String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
+ log.info("queryDeductionAmountRequest res --- {}", res);
+ return res;
+ }
+
+
+ public String confirm(String year, List kczglb) {
+
+ String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/confirmPreDeduct";
+ ConfirmPreDeductRequest request = new ConfirmPreDeductRequest();
+ request.setNsrsbh(returnPO.getTaxCode());
+ request.setBizNo(UUID.randomUUID().toString().replace("-", ""));
+ request.setQymc(returnPO.getTaxAgentName());
+ request.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
+ request.setAreaid(returnPO.getAreaCode());
+ request.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
+ boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
+ request.setSbmm(realNamePwd ? null : returnPO.getPwd());
+ request.setJmsbmm("1");
+ request.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
+ request.setSmmm(realNamePwd ? returnPO.getPwd() : null);
+ request.setJmsmmm("1");
+ request.setMmlx("" + returnPO.getPasswordType());
+ request.setSkssnd(year);
+ request.setKczglb(kczglb);
+
+ String requestId = request(url, JsonUtil.parseMap(request, Object.class));
+ return requestId;
+ }
+
+ public ConfirmFeedbackResponse feedback(String requestId) {
+ TaskUtil taskUtil = new TaskUtil();
+
+ String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/getPreDeductConfirmFeedback";
+
+ Map param = new HashMap<>(1);
+ param.put("requestId", requestId);
+
+ Map header = SingnatureData.initHeader(new HashMap<>(1), apiConfig.getAppKey(), apiConfig.getAppSecret());
+ String res = HttpUtil.getRequest(url, header, param);
+ taskUtil.writeApiTaskRecord(Util.null2String(taxAgentId), url, JsonUtil.toJsonString(param), res);
+ ConfirmFeedbackResponse response = JsonUtil.parseBean(res, ConfirmFeedbackResponse.class);
+ return response;
+ }
+}
diff --git a/src/com/engine/salary/remote/tax/client/EmployeeClient.java b/src/com/engine/salary/remote/tax/client/EmployeeClient.java
index 480d00e53..5a246b398 100644
--- a/src/com/engine/salary/remote/tax/client/EmployeeClient.java
+++ b/src/com/engine/salary/remote/tax/client/EmployeeClient.java
@@ -39,10 +39,10 @@ public class EmployeeClient extends TaxBaseClient {
mergedEmployeeArchivesRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
mergedEmployeeArchivesRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
- mergedEmployeeArchivesRequest.setJmsbmm("0");
+ mergedEmployeeArchivesRequest.setJmsbmm("1");
mergedEmployeeArchivesRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
mergedEmployeeArchivesRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
- mergedEmployeeArchivesRequest.setJmsmmm("0");
+ mergedEmployeeArchivesRequest.setJmsmmm("1");
mergedEmployeeArchivesRequest.setMmlx("" + returnPO.getPasswordType());
diff --git a/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java
new file mode 100644
index 000000000..635c146ec
--- /dev/null
+++ b/src/com/engine/salary/remote/tax/request/deductionAmount/ConfirmPreDeductRequest.java
@@ -0,0 +1,96 @@
+package com.engine.salary.remote.tax.request.deductionAmount;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ConfirmPreDeductRequest {
+ /**
+ * 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID
+ */
+ private String bizNo;
+ /**
+ * 企业名称 必填:是 代报企业全称
+ */
+ private String qymc;
+ /**
+ * 密码类型 必填:否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码
+ */
+ private String mmlx;
+ /**
+ * 实名账号 必填:选择必填 当mmlx=2时,必填
+ */
+ private String smzh;
+ /**
+ * 实名密码 必填:选择必填 当mmlx=2时,必填
+ */
+ private String smmm;
+ /**
+ * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明
+ */
+ private String jmsmmm;
+ /**
+ * 登记序号 必填:否 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
+ */
+ private String djxhid;
+ /**
+ * 税号 必填:是 扣缴单位纳税人识别号
+ */
+ private String nsrsbh;
+ /**
+ * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码
+ */
+ private String areaid;
+ /**
+ * 部门编号 必填:否 分部门代报时必传
+ */
+ private String bmbh;
+ /**
+ * 部门名称 必填:否
+ */
+ private String bmmc;
+ /**
+ * 申报密码 必填:条件必填 当mmlx=0时,必填
+ */
+ private String sbmm;
+ /**
+ * 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密
+ */
+ private String jmsbmm;
+ /**
+ * 税款所属年度 必填:必填 yyyy
+ */
+ private String skssnd;
+
+ /**
+ * 扣除资格列表
+ */
+ private List kczglb;
+
+
+ @Data
+ public static class kczg {
+ /**
+ * 姓名
+ */
+ private String xm;
+ /**
+ * 证件类型 见证件类型字典
+ */
+ private String zzlx;
+ /**
+ * 证件号码 证件号码
+ */
+ private String zzhm;
+ /**
+ * 国籍
+ */
+ private String gj;
+ /**
+ * 扣除标识 是/否
+ */
+ private String kcbs;
+ }
+
+}
diff --git a/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java b/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java
new file mode 100644
index 000000000..1aaa0a3a1
--- /dev/null
+++ b/src/com/engine/salary/remote/tax/request/deductionAmount/QueryDeductionAmountRequest.java
@@ -0,0 +1,64 @@
+package com.engine.salary.remote.tax.request.deductionAmount;
+
+import lombok.Data;
+
+@Data
+public class QueryDeductionAmountRequest {
+ /**
+ * 外部业务编号 必填:是 外部业务编号,唯一,幂等需要,最长64位,建议使用UUID
+ */
+ private String bizNo;
+ /**
+ * 企业名称 必填:是 代报企业全称
+ */
+ private String qymc;
+ /**
+ * 密码类型 必填:否 默认不传则设置为0, 0表示申报密码;2表示实名账号实名密码
+ */
+ private String mmlx;
+ /**
+ * 实名账号 必填:选择必填 当mmlx=2时,必填
+ */
+ private String smzh;
+ /**
+ * 实名密码 必填:选择必填 当mmlx=2时,必填
+ */
+ private String smmm;
+ /**
+ * 加密实名密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密 参考3.4代报、实名密码加密说明
+ */
+ private String jmsmmm;
+ /**
+ * 登记序号 必填:否 存在多个登记序号时,需要指定传入一个.例:10117440105249764755
+ */
+ private String djxhid;
+ /**
+ * 税号 必填:是 扣缴单位纳税人识别号
+ */
+ private String nsrsbh;
+ /**
+ * 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码
+ */
+ private String areaid;
+ /**
+ * 部门编号 必填:否 分部门代报时必传
+ */
+ private String bmbh;
+ /**
+ * 部门名称 必填:否
+ */
+ private String bmmc;
+ /**
+ * 申报密码 必填:条件必填 当mmlx=0时,必填
+ */
+ private String sbmm;
+ /**
+ * 加密申报密码 必填:否 默认不传则设置为0,0表示不加密;1表示加密
+ */
+ private String jmsbmm;
+ /**
+ * 税款所属年度 必填:必填 yyyy
+ */
+ private String skssnd;
+
+}
diff --git a/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java b/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java
new file mode 100644
index 000000000..783f5f359
--- /dev/null
+++ b/src/com/engine/salary/remote/tax/response/deductionAmount/ConfirmFeedbackResponse.java
@@ -0,0 +1,75 @@
+package com.engine.salary.remote.tax.response.deductionAmount;
+
+import com.engine.salary.entity.taxpayment.response.BaseResponse;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 扣除名单确认反馈
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ConfirmFeedbackResponse extends BaseResponse {
+
+ /**
+ * 返回数据
+ */
+ private Body body;
+
+ /**
+ * 神州云合接口返回状态实体类
+ **/
+ @Data
+ public static class Body {
+
+ /**
+ * 总人数
+ */
+ private String zrs;
+ /**
+ * 成功人数
+ */
+ private String cgrs;
+ /**
+ * 失败人数
+ */
+ private String sbrs;
+ /**
+ * 扣除确认失败列表
+ */
+ private List kcqrsblb;
+
+ @Data
+ public static class kcqrsb {
+
+ /**
+ * 姓名
+ */
+ private String xm;
+ /**
+ * 证件类型 见证件类型字典
+ */
+ private String zzlx;
+ /**
+ * 证件号码 证件号码
+ */
+ private String zzhm;
+ /**
+ * 国籍
+ */
+ private String gj;
+ /**
+ * 失败原因
+ */
+ private String sbyy;
+ }
+ }
+
+}
diff --git a/src/com/engine/salary/report/entity/param/SalaryStatisticsEmployeeSalaryQueryParam.java b/src/com/engine/salary/report/entity/param/SalaryStatisticsEmployeeSalaryQueryParam.java
index a1dbab11b..a5d6b0253 100644
--- a/src/com/engine/salary/report/entity/param/SalaryStatisticsEmployeeSalaryQueryParam.java
+++ b/src/com/engine/salary/report/entity/param/SalaryStatisticsEmployeeSalaryQueryParam.java
@@ -25,6 +25,9 @@ public class SalaryStatisticsEmployeeSalaryQueryParam extends BaseQueryParam {
// 关键字
private String keyword;
+ //人员ids
+ private List employeeIds;
+
// 起始年月
private String startDateStr;
private Date startDate;
diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java
index 1b45b4881..2267440fc 100644
--- a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java
+++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java
@@ -13,6 +13,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
+import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
import com.engine.salary.report.common.constant.SalaryConstant;
@@ -248,12 +249,23 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
List salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, SalaryAcctRecordPO::getAcctTimes);
+ List salaryItemPOList = getSalaryItemService(user).listAll();
+ Map itemDataTypeMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getId, SalaryItemPO::getDataType);
+
+
Map> acctResultValueList = SalaryEntityUtil.group2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmpId);
- Map> acctResultValueMap = new HashMap<>();
+ Map> acctResultValueMap = new HashMap<>();
acctResultValueList.forEach((k, v) -> {
- Map map = new HashMap();
+ Map map = new HashMap();
v.forEach(l -> {
- map.put(l.getSalaryItemId() + "", l.getResultValue());
+ String dataType = itemDataTypeMap.getOrDefault(l.getSalaryItemId(), "string");
+ SalaryDataTypeEnum typeEnum = SalaryDataTypeEnum.parseByValue(dataType);
+ String resultValue = l.getResultValue();
+ if (typeEnum == SalaryDataTypeEnum.NUMBER && NumberUtil.isNumber(resultValue)) {
+ map.put(l.getSalaryItemId() + "", Double.valueOf(resultValue));
+ } else {
+ map.put(l.getSalaryItemId() + "", resultValue);
+ }
});
acctResultValueMap.put(k, map);
});
@@ -265,7 +277,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
Map map;
for (SalaryAcctEmployeePO se : salaryStatisticsEmployeeDetailResult.getSalaryAcctEmployeeList()) {
map = Maps.newHashMap();
- Map resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
+ Map resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
Map finalMap = map;
resultValueMap.forEach((k, v) -> {
finalMap.put(k + SalaryConstant.DYNAMIC_SUFFIX, v);
@@ -332,6 +344,13 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
List employeeIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
}
+
+ //人员浏览按钮筛选
+ List employeeIds = queryParam.getEmployeeIds();
+ if(CollectionUtils.isNotEmpty(employeeIds)){
+ salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
+ }
+
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
return new PageInfo<>();
}
diff --git a/src/com/engine/salary/service/DeductionAmountService.java b/src/com/engine/salary/service/DeductionAmountService.java
new file mode 100644
index 000000000..5609882e9
--- /dev/null
+++ b/src/com/engine/salary/service/DeductionAmountService.java
@@ -0,0 +1,30 @@
+package com.engine.salary.service;
+
+import com.engine.salary.component.PageInfo;
+import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO;
+import com.engine.salary.entity.deductionamount.param.*;
+
+/**
+ * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+public interface DeductionAmountService {
+
+ PageInfo list(DeductionAmountListParam param);
+
+ void add(DeductionAmountAddParam param);
+
+ void edit(DeductionAmountEditParam param);
+
+ void delete(DeductionAmountDeleteParam param);
+
+ Object query(DeductionAmountOnlineQueryParam param);
+
+ String confirm(DeductionAmountConfirmParam param);
+
+ String feedback(DeductionAmountFeedBackParam param);
+}
diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java
index 941316ad7..94225cd42 100644
--- a/src/com/engine/salary/service/ExtEmpService.java
+++ b/src/com/engine/salary/service/ExtEmpService.java
@@ -1,6 +1,7 @@
package com.engine.salary.service;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
+import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
@@ -19,7 +20,7 @@ public interface ExtEmpService {
List list(ExtEmpQueryParam param);
- PageInfo listPage (ExtEmpQueryParam param);
+ PageInfo listPage (ExtEmpQueryParam param);
void save(ExtEmpSaveParam po);
diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java
index ca998e4b7..28a142b39 100644
--- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java
+++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java
@@ -1650,7 +1650,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
}
private void setExistedDataMap(AddUpDeductionOnlineRequestWrapper requestWrapper) {
- List taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId, Collectors.toList());
+ Set taxAgentIds = SalaryEntityUtil.properties(requestWrapper.getSalaryArchiveList(), SalaryArchivePO::getTaxAgentId);
List poList = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(requestWrapper.getRequestPOList().get(0).getTaxYearMonth()).taxAgentIds(taxAgentIds).build());
requestWrapper.setExistedDataMap(SalaryEntityUtil.convert2Map(poList, e -> e.getTaxAgentId() + "-" + e.getEmployeeId(), AddUpDeduction::getId));
}
diff --git a/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java
new file mode 100644
index 000000000..e6b3c6b4c
--- /dev/null
+++ b/src/com/engine/salary/service/impl/DeductionAmountServiceImpl.java
@@ -0,0 +1,255 @@
+package com.engine.salary.service.impl;
+
+
+import cn.hutool.core.collection.CollUtil;
+import com.engine.core.impl.Service;
+import com.engine.salary.component.PageInfo;
+import com.engine.salary.constant.SalaryDefaultTenantConstant;
+import com.engine.salary.constant.SzyhApiConstant;
+import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO;
+import com.engine.salary.entity.deductionamount.param.*;
+import com.engine.salary.entity.deductionamount.po.DeductionAmountPO;
+import com.engine.salary.entity.deductionamount.po.DeductionAmountRecordPO;
+import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
+import com.engine.salary.enums.SalaryOnOffEnum;
+import com.engine.salary.enums.employeedeclare.CardTypeEnum;
+import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
+import com.engine.salary.exception.SalaryRunTimeException;
+import com.engine.salary.mapper.deductionamount.DeductionAmountMapper;
+import com.engine.salary.mapper.deductionamount.DeductionAmountRecordMapper;
+import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
+import com.engine.salary.remote.tax.client.DeductionAmountClient;
+import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest;
+import com.engine.salary.remote.tax.response.deductionAmount.ConfirmFeedbackResponse;
+import com.engine.salary.service.DeductionAmountService;
+import com.engine.salary.util.SalaryEntityUtil;
+import com.engine.salary.util.SalaryI18nUtil;
+import com.engine.salary.util.db.IdGenerator;
+import com.engine.salary.util.db.MapperProxyFactory;
+import com.engine.salary.util.page.SalaryPageUtil;
+import com.engine.salary.util.valid.ValidUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.math.NumberUtils;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 年收入不足6万元的纳税人暂不预扣预缴税款扣除名单
+ * Copyright: Copyright (c) 2023
+ * Company: 泛微软件
+ *
+ * @author qiantao
+ * @version 1.0
+ **/
+@Slf4j
+public class DeductionAmountServiceImpl extends Service implements DeductionAmountService {
+
+ private DeductionAmountRecordMapper getDeductionAmountRecordMapper() {
+ return MapperProxyFactory.getProxy(DeductionAmountRecordMapper.class);
+ }
+
+ private DeductionAmountMapper getDeductionAmountMapper() {
+ return MapperProxyFactory.getProxy(DeductionAmountMapper.class);
+ }
+
+ private EmployeeDeclareMapper getEmployeeDeclareMapper() {
+ return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class);
+ }
+
+
+ @Override
+ public PageInfo list(DeductionAmountListParam param) {
+ ValidUtil.doValidator(param);
+
+ List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().year(param.getYear()).taxAgentId(param.getTaxAgentId()).build());
+
+ List list = deductionAmountPOS.stream()
+ .map(deductionAmountPO -> DeductionAmountDTO.builder()
+ .id(deductionAmountPO.getId())
+ .taxAgentId(deductionAmountPO.getEmployeeId())
+ .year(deductionAmountPO.getYear())
+ .employeeId(deductionAmountPO.getEmployeeId())
+ .employeeName(deductionAmountPO.getEmployeeName())
+ .employeeType(deductionAmountPO.getEmployeeType())
+ .jobNum(deductionAmountPO.getJobNum())
+ .nationality(deductionAmountPO.getNationality())
+ .cardNum(deductionAmountPO.getCardNum())
+ .cardType(deductionAmountPO.getCardType())
+ .declareStatus(deductionAmountPO.getDeclareStatus())
+ .declareStatusName(DeclareStatusEnum.getByValue(deductionAmountPO.getDeclareStatus()).getDefaultLabel())
+ .declareErrorMsg(deductionAmountPO.getDeclareErrorMsg())
+ .deductFlag(deductionAmountPO.getDeductFlag())
+ .successfullyDeclared(deductionAmountPO.getSuccessfullyDeclared())
+ .creator(deductionAmountPO.getCreator())
+ .createTime(deductionAmountPO.getCreateTime())
+ .updateTime(deductionAmountPO.getUpdateTime())
+ .build())
+ .collect(Collectors.toList());
+
+ return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, DeductionAmountDTO.class);
+ }
+
+ @Override
+ public void add(DeductionAmountAddParam param) {
+ ValidUtil.doValidator(param);
+
+ //已存在
+ List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(param.getTaxAgentId()).year(param.getYear()).build());
+ List oldIds = SalaryEntityUtil.properties(deductionAmountPOS, DeductionAmountPO::getEmployeeId, Collectors.toList());
+
+ //本次新增
+ List employeeDeclareIds = param.getEmployeeDeclareIds();
+ List employeeDeclarePOS = getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(employeeDeclareIds).build());
+
+ Date now = new Date();
+ employeeDeclarePOS.stream()
+ .filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId()))
+ .map(employeeDeclarePO -> DeductionAmountPO.builder()
+ .id(IdGenerator.generate())
+ .taxAgentId(employeeDeclarePO.getTaxAgentId())
+ .year(param.getYear())
+ .employeeId(employeeDeclarePO.getEmployeeId())
+ .employeeName(employeeDeclarePO.getEmployeeName())
+ .employeeType(employeeDeclarePO.getEmployeeType())
+ .jobNum(employeeDeclarePO.getJobNum())
+ .cardNum(employeeDeclarePO.getCardNum())
+ .cardType(employeeDeclarePO.getCardType())
+ .nationality(employeeDeclarePO.getNationality())
+ .declareStatus(DeclareStatusEnum.NOT_DECLARE.getValue())
+ .deductFlag(SalaryOnOffEnum.ON.getValue())
+ .successfullyDeclared(SalaryOnOffEnum.OFF.getValue())
+ .creator((long) user.getUID())
+ .createTime(now)
+ .updateTime(now)
+ .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
+ .deleteType(NumberUtils.INTEGER_ZERO)
+ .build())
+ .forEach(deductionAmountPO -> getDeductionAmountMapper().insertIgnoreNull(deductionAmountPO));
+ }
+
+ @Override
+ public void edit(DeductionAmountEditParam param) {
+ ValidUtil.doValidator(param);
+
+ DeductionAmountPO po = getDeductionAmountMapper().getById(param.getId());
+ if (po == null) {
+ throw new SalaryRunTimeException("扣除名单不存在");
+ }
+
+ po.setDeductFlag(param.getDeductFlag());
+ getDeductionAmountMapper().updateIgnoreNull(po);
+ }
+
+ @Override
+ public void delete(DeductionAmountDeleteParam param) {
+ if (CollUtil.isEmpty(param.getIds())) {
+ return;
+ }
+ param.getIds().forEach(id -> {
+ getDeductionAmountMapper().delete(DeductionAmountPO.builder().id(id).build());
+ });
+ }
+
+ @Override
+ public Object query(DeductionAmountOnlineQueryParam param) {
+ Long taxAgentId = param.getTaxAgentId();
+ DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId);
+ return deductionAmountClient.query(param.getYear());
+ }
+
+ @Override
+ public String confirm(DeductionAmountConfirmParam param) {
+ ValidUtil.doValidator(param);
+ Long taxAgentId = param.getTaxAgentId();
+ String year = param.getYear();
+ List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(taxAgentId).year(year).build());
+ List kczglb = deductionAmountPOS.stream()
+ .map(deductionAmountPO -> {
+ ConfirmPreDeductRequest.kczg kczg = new ConfirmPreDeductRequest.kczg();
+ kczg.setXm(deductionAmountPO.getEmployeeName());
+ kczg.setZzhm(deductionAmountPO.getCardNum());
+ kczg.setZzlx(CardTypeEnum.getByValue(deductionAmountPO.getCardType()).getDefaultLabel());
+ kczg.setGj(deductionAmountPO.getNationality());
+ kczg.setKcbs(SalaryOnOffEnum.parseByValue(deductionAmountPO.getDeductFlag()).getDefaultLabel());
+ return kczg;
+ }).collect(Collectors.toList());
+
+ DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId);
+ String requestId = deductionAmountClient.confirm(year, kczglb);
+
+ //更新状态
+ deductionAmountPOS.forEach(deductionAmountPO -> {
+ deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARING.getValue());
+ getDeductionAmountMapper().updateIgnoreNull(deductionAmountPO);
+ });
+
+ //插入记录
+ getDeductionAmountRecordMapper().deleteByTaxAgentIdAndYear(taxAgentId, year);
+ DeductionAmountRecordPO recordPO = DeductionAmountRecordPO.builder()
+ .id(IdGenerator.generate())
+ .taxAgentId(taxAgentId)
+ .year(year)
+ .requestId(requestId)
+ .creator((long) user.getUID())
+ .createTime(new Date())
+ .updateTime(new Date())
+ .deleteType(NumberUtils.INTEGER_ZERO)
+ .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
+ .build();
+ getDeductionAmountRecordMapper().insertIgnoreNull(recordPO);
+
+ return requestId;
+ }
+
+ @Override
+ public String feedback(DeductionAmountFeedBackParam param) {
+ Long taxAgentId = param.getTaxAgentId();
+ String year = param.getYear();
+ DeductionAmountRecordPO recordPO = getDeductionAmountRecordMapper().getByTaxAgentIdAndYear(taxAgentId, year);
+
+ if (recordPO == null) {
+ throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "请先点击报送扣除名单,再点击反馈"));
+ }
+
+ String requestId = recordPO.getRequestId();
+ DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId);
+ ConfirmFeedbackResponse feedback = deductionAmountClient.feedback(requestId);
+
+ if (feedback == null || feedback.getHead() == null) {
+ throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, "服务异常,请稍后重试"));
+ }
+ // 如果税友返回错误信息
+ String code = feedback.getHead().getCode();
+ if (SzyhApiConstant.HANDLING_CODE.equals(code) || SzyhApiConstant.TASK_HANDLING_CODE.equals(code)) {
+ //进行中的任务,重试
+ throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(175337, "任务还在处理中,请稍后点击反馈"));
+ }
+
+ if (!SzyhApiConstant.SUCCESS_CODE.equals(code)) {
+ throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(95828, feedback.getHead().getMsg()));
+ }
+
+ List deductionAmountPOS = getDeductionAmountMapper().listSome(DeductionAmountPO.builder().taxAgentId(taxAgentId).year(year).build());
+
+ List kcqrsblb = feedback.getBody().getKcqrsblb();
+ Map failMap = SalaryEntityUtil.convert2Map(kcqrsblb, ConfirmFeedbackResponse.Body.kcqrsb::getZzhm, ConfirmFeedbackResponse.Body.kcqrsb::getSbyy);
+
+ deductionAmountPOS.forEach(deductionAmountPO -> {
+ String cardNum = deductionAmountPO.getCardNum();
+ if (failMap.containsKey(cardNum)) {
+ deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
+ deductionAmountPO.setDeclareErrorMsg(failMap.get(cardNum));
+ } else {
+ deductionAmountPO.setDeclareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue());
+ deductionAmountPO.setSuccessfullyDeclared(SalaryOnOffEnum.ON.getValue());
+ }
+ getDeductionAmountMapper().updateIgnoreNull(deductionAmountPO);
+ });
+
+ return String.format("成功%s条,失败%s条", feedback.getBody().getCgrs(), feedback.getBody().getSbrs());
+
+ }
+}
diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java
index d3fbbb043..956094d91 100644
--- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java
+++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java
@@ -749,9 +749,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
}
// 更新员工的报送状态
if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) {
- //todo
needUpdateEmployeeDeclares.forEach(getEmployeeDeclareMapper()::updateIgnoreNull);
-// updateBatchById(needUpdateEmployeeDeclares);
}
// 删除原来的人员报送记录
getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java
index af7945eac..9d6b27f36 100644
--- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java
+++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java
@@ -5,6 +5,7 @@ import com.engine.core.impl.Service;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
+import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
@@ -83,9 +84,21 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
}
@Override
- public PageInfo listPage(ExtEmpQueryParam param) {
+ public PageInfo listPage(ExtEmpQueryParam param) {
List extEmpPOS = list(param);
- return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class);
+
+ List list = extEmpPOS.stream().map(po -> {
+ return ExtEmpDTO.builder()
+ .id(po.getId())
+ .username(po.getUsername())
+ .departmentName(po.getDepartmentName())
+ .subcompanyName(po.getSubcompanyName())
+ .companystartdate(po.getCompanystartdate())
+ .workcode(po.getWorkcode())
+ .build();
+ }).collect(Collectors.toList());
+
+ return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, ExtEmpDTO.class);
}
diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java
index 5fe982069..19430af08 100644
--- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java
+++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java
@@ -85,6 +85,8 @@ import java.util.concurrent.LinkedBlockingDeque;
import java.util.regex.Matcher;
import java.util.stream.Collectors;
+import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE;
+
import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN;
/**
@@ -204,6 +206,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
private VariableItemService getVariableItemService(User user) {
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
}
+
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
}
@@ -910,6 +913,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
// 12.4、是否采用系统算税
TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration();
// 12.5、多线程运算,运算结果存放在临时表中
+ //是否同步计算
+ boolean isSync = "0".equals(getSalarySysConfService(user).getValueByCode(SALARY_ACCT_SYNC_TYPE));
for (List acctEmployeePOS : partition) {
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
.setSalaryAcctRecordPO(salaryAcctRecordPO)
@@ -932,13 +937,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
.setTaxDeclarationFunction(taxDeclarationFunction)
.setTaxIds(taxIds);
List finalSalarySobBackItems = salarySobBackItems;
- LocalRunnable localRunnable = new LocalRunnable() {
- @Override
- public void execute() {
- getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
- }
- };
- ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
+ if (isSync) {
+ getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
+ } else {
+ LocalRunnable localRunnable = new LocalRunnable() {
+ @Override
+ public void execute() {
+ getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
+ }
+ };
+ ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
+ }
}
// 13、等待所有子线程执行完毕
childMonitor.await();
@@ -967,7 +976,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), true);
//更新薪资核算记录最后操作日期
- getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(),new Date());
+ getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(), new Date());
stopWatch.stop();
log.info(stopWatch.prettyPrint());
@@ -975,6 +984,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
// 记录日志
// 查询操作日志的targetName
String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId());
+ Collection ids = calculateParam.getIds();
+ if (CollectionUtils.isNotEmpty(ids)) {
+ targetName += ids;
+ }
LoggerContext loggerContext = new LoggerContext<>();
loggerContext.setUser(user);
loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId()));
diff --git a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java
index 77e7d2244..8e88e73da 100644
--- a/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java
+++ b/src/com/engine/salary/service/impl/TaxDeclareRecordServiceImpl.java
@@ -830,27 +830,72 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
if (declareFeedBackStatusEnum == DeclareFeedBackStatusEnum.DECLARE_FAIL) {
List