申报和往期异常
This commit is contained in:
parent
d765ede418
commit
860c89b560
|
|
@ -1,8 +1,5 @@
|
|||
#<23>Ƿ<EFBFBD><C7B7>ӡ<EFBFBD><D3A1>־
|
||||
log=ture
|
||||
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>
|
||||
isPermission=false
|
||||
#н<><D0BD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ɫ
|
||||
salaryAdminRoleId=28
|
||||
#是否开启默认关闭非标-开启后,默认不启用非标,在应用中心非标中进行开启
|
||||
chiefAdminRoleId=28
|
||||
defaultCloseNonStandard149=true
|
||||
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
|
||||
|
|
@ -1,116 +1,132 @@
|
|||
delete from hrsa_acct_result_temp where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_add_up_deduction where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_add_up_situation where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_attend_quote where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_attend_quote_data where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_attend_quote_data_value where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_attend_quote_field where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_attend_quote_sync_set where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_bill_batch where 1=1
|
||||
GO
|
||||
delete from hrsa_bill_batch_encdata where 1=1
|
||||
GO
|
||||
;
|
||||
|
||||
delete from hrsa_bill_detail where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_bill_detail_temp where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_bill_inspect where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_check_result where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_check_result_record where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_ck_result_detail_temp where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_excel_acct_result where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_fund_archives where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_other_archives where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_other_deduction where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_acct_emp where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_acct_record where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_acct_result where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_archive where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_archive_dimission where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_archive_item where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_archive_tax_agent where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_item where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_send where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_send_info where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_sob where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_sob_adjust_rule where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_sob_emp_field where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_sob_item where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_sob_item_group where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_sob_range where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_salary_template where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_scheme_detail where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_social_archives where 1=1
|
||||
GO
|
||||
delete from hrsa_social_archives_encdata where 1=1
|
||||
GO
|
||||
;
|
||||
|
||||
delete from hrsa_social_security_scheme where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_sys_tax_rate_base where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_sys_tax_rate_detail where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_tax_agent where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_tax_agent_emp where 1=1
|
||||
;
|
||||
delete from hrsa_tax_agent_emp_change where 1=1
|
||||
;
|
||||
delete from hrsa_tax_agent_admin where 1=1
|
||||
;
|
||||
delete from hrsa_tax_agent_manage_range where 1=1
|
||||
;
|
||||
delete from hrsa_tax_agent_base where 1=1
|
||||
;
|
||||
delete from hrsa_tax_agent_sub_admin where 1=1
|
||||
;
|
||||
delete from hrsa_tax_agent_sub_admin_emp where 1=1
|
||||
;
|
||||
|
||||
delete from hrsa_tax_declaration where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_tax_declaration_detail where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_tax_rate_base where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_tax_rate_detail where 1=1
|
||||
GO
|
||||
;
|
||||
delete from hrsa_insurance_category where 1=1
|
||||
GO
|
||||
;
|
||||
|
||||
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9001, '养老保险', 1, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9002, '医疗保险', 1, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9003, '工伤保险', 1, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9004, '失业保险', 1, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9005, '生育保险', 1, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9006, '住房公积金', 2, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9007, '企业年金', 3, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
INSERT INTO hrsa_insurance_category (id, insurance_name, welfare_type, is_use, payment_scope, data_type, create_time, update_time, creator, delete_type, tenant_key) VALUES (9008, '补充住房公积金', 2, 1, '1,2', 1, '2022-02-22 10:46:02', '2022-02-22 10:46:02', 0, 0, 'all_teams')
|
||||
GO
|
||||
;
|
||||
|
||||
|
||||
INSERT INTO hrsa_tax_agent_base(id, devolution_status, create_time, update_time, creator, delete_type, tenant_key) VALUES (1653303537239, 0, '2022-05-23 18:58:53', '2022-05-23 19:12:12', 1, 0, 'all_teams');
|
||||
|
|
|
|||
|
|
@ -1,100 +0,0 @@
|
|||
package com.engine.salary.cmd.datacollection;
|
||||
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteListDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AttendQuoteListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public AttendQuoteListCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
|
||||
AttendQuoteQueryParam queryParam = (AttendQuoteQueryParam) params.get("queryParam");
|
||||
List<String> declareMonth = queryParam.getSalaryYearMonth();
|
||||
if (CollectionUtils.isNotEmpty(declareMonth)) {
|
||||
queryParam.setSalaryYearMonth(declareMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
String fields = " t1.id," +
|
||||
" t1.salary_year_month," +
|
||||
" t1.salary_sob_id," +
|
||||
" t2.name AS salary_sob_name," +
|
||||
" t1.source_type," +
|
||||
" t1.attend_cycle," +
|
||||
" t1.salary_cycle," +
|
||||
" t1.description," +
|
||||
" e.lastname AS creator," +
|
||||
" t1.salary_accounting_status";
|
||||
|
||||
String fromSql = " FROM" +
|
||||
" hrsa_attend_quote t1" +
|
||||
" LEFT JOIN hrsa_salary_sob t2 ON t1.salary_sob_id = t2.id" +
|
||||
" LEFT JOIN hrmresource e ON e.id = t1.creator";
|
||||
|
||||
SalaryWeaTable<AttendQuoteListDTO> table = new SalaryWeaTable<AttendQuoteListDTO>(user, AttendQuoteListDTO.class);
|
||||
table.setBackfields(fields);
|
||||
table.setSqlform(fromSql);
|
||||
table.setSqlwhere(makeSqlWhere());
|
||||
table.setSqlorderby("t1.id DESC");
|
||||
table.setSqlprimarykey("t1.id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
}
|
||||
|
||||
|
||||
private String makeSqlWhere() {
|
||||
|
||||
AttendQuoteQueryParam queryParam = (AttendQuoteQueryParam) params.get("queryParam");
|
||||
//薪资所属月
|
||||
List<String> salaryYearMonth = queryParam.getSalaryYearMonth();
|
||||
if (CollectionUtils.isNotEmpty(salaryYearMonth)) {
|
||||
queryParam.setSalaryYearMonth(salaryYearMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
String sqlWhere = "t1.delete_type = 0 AND t2.delete_type = 0";
|
||||
Collection<Long> ids = queryParam.getIds();
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
String idsStr = ids.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||
sqlWhere += " AND t1.id IN (" + idsStr + ")";
|
||||
}
|
||||
// 申报月份
|
||||
List<String> months = queryParam.getSalaryYearMonth();
|
||||
if (CollectionUtils.isNotEmpty(months)) {
|
||||
if (months.size() == 1) {
|
||||
sqlWhere += " AND t1.salary_year_month = '" + months.get(0) + "'";
|
||||
}
|
||||
if (months.size() == 2) {
|
||||
sqlWhere += " AND (t1.salary_year_month BETWEEN '" + months.get(0) + "' AND '" + months.get(1) + "')";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.minidev.json.annotate.JsonIgnore;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -29,22 +30,27 @@ public class ExpressFormula {
|
|||
/**
|
||||
* 模块
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String module;
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String useFor;
|
||||
/**
|
||||
* 引用类型,formula,sql
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String referenceType;
|
||||
/**
|
||||
* 返回类型,number,string
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String returnType;
|
||||
/**
|
||||
* 校验类型,number,string
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String validateType;
|
||||
/**
|
||||
* 扩展参数
|
||||
|
|
@ -68,18 +74,22 @@ public class ExpressFormula {
|
|||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -45,19 +45,19 @@ public class TaxDeclarationBO {
|
|||
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgent::getId, TaxAgent::getName);
|
||||
Map<Long, String> employeeNameMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
|
||||
return taxDeclarations.stream().map(e -> TaxDeclarationListDTO.builder()
|
||||
.id(e.getId())
|
||||
.salaryMonth(e.getSalaryMonth())
|
||||
.taxAgentId(e.getTaxAgentId())
|
||||
.taxAgentName(taxAgentNameMap.getOrDefault(e.getTaxAgentId(), ""))
|
||||
.taxCycle(e.getTaxCycle())
|
||||
.operateEmployeeId(e.getCreator())
|
||||
.operateEmployeeName(employeeNameMap.getOrDefault(e.getCreator(), ""))
|
||||
.operateTime(SalaryDateUtil.getFormatLocalDateTime(e.getCreateTime()))
|
||||
.description(e.getDescription())
|
||||
.build()).collect(Collectors.toList());
|
||||
.id(e.getId())
|
||||
.salaryMonth(e.getSalaryMonth())
|
||||
.taxAgentId(e.getTaxAgentId())
|
||||
.taxAgentName(taxAgentNameMap.getOrDefault(e.getTaxAgentId(), ""))
|
||||
.taxCycle(e.getTaxCycle())
|
||||
.operateEmployeeId(e.getCreator())
|
||||
.operateEmployeeName(employeeNameMap.getOrDefault(e.getCreator(), ""))
|
||||
.operateTime(SalaryDateUtil.getFormatLocalDateTime(e.getCreateTime()))
|
||||
.description(e.getDescription())
|
||||
.build()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static void buildDetailListDTO(Long taxDeclarationId,
|
||||
public static void buildDetailListDTO(Long taxDeclarationId,
|
||||
PageInfo<TaxDeclarationDetailListDTO> page,
|
||||
List<TaxDeclarationDetailPO> taxDeclarationDetails,
|
||||
List<DataCollectionEmployee> simpleEmployees) {
|
||||
|
|
@ -75,43 +75,43 @@ public class TaxDeclarationBO {
|
|||
dto.setSeq(++index);
|
||||
dto.setEmployeeId(simpleEmployee.getEmployeeId());
|
||||
dto.setEmployeeName(simpleEmployee.getUsername());
|
||||
dto.setIdCardType(SalaryI18nUtil.getI18nLabel(101696,"身份证"));
|
||||
dto.setIdCardType(SalaryI18nUtil.getI18nLabel(101696, "身份证"));
|
||||
dto.setIdCardNo("");
|
||||
dto.setTaxpayerIdNo("");
|
||||
dto.setResidentType(SalaryI18nUtil.getI18nLabel(101697,"居民"));
|
||||
dto.setIncomeType(SalaryI18nUtil.getI18nLabel(101698,"工资、薪金"));
|
||||
dto.setIncome(valueMap.getOrDefault("income",""));
|
||||
dto.setResidentType(SalaryI18nUtil.getI18nLabel(101697, "居民"));
|
||||
dto.setIncomeType(SalaryI18nUtil.getI18nLabel(101698, "工资、薪金"));
|
||||
dto.setIncome(valueMap.getOrDefault("income", ""));
|
||||
dto.setFee(valueMap.getOrDefault("fee", ""));
|
||||
dto.setTaxFreeIncome(valueMap.getOrDefault("taxFreeIncome", ""));
|
||||
dto.setSubtraction(valueMap.getOrDefault("subtraction", ""));
|
||||
dto.setEndowmentInsurance(valueMap.getOrDefault("endowmentInsurance", ""));
|
||||
dto.setMedicalInsurance(valueMap.getOrDefault("medicalInsurance",""));
|
||||
dto.setUnemploymentInsurance(valueMap.getOrDefault("unemploymentInsurance",""));
|
||||
dto.setHousingProvidentFund(valueMap.getOrDefault("housingProvidentFund",""));
|
||||
dto.setAnnuity(valueMap.getOrDefault("annuity",""));
|
||||
dto.setCommercialHealthInsurance(valueMap.getOrDefault("commercialHealthInsurance",""));
|
||||
dto.setTaxDeferredEndowmentInsurance(valueMap.getOrDefault("taxDeferredEndowmentInsurance",""));
|
||||
dto.setOriginalValueOfProperty(valueMap.getOrDefault("originalValueOfProperty",""));
|
||||
dto.setDeductedTax(valueMap.getOrDefault("deductedTax",""));
|
||||
dto.setOther(valueMap.getOrDefault("other",""));
|
||||
dto.setAddUpIncome(valueMap.getOrDefault("addUpIncome",""));
|
||||
dto.setAddUpSubtraction(valueMap.getOrDefault("addUpSubtraction",""));
|
||||
dto.setAddUpSpecialDeduction(valueMap.getOrDefault("addUpSpecialDeduction",""));
|
||||
dto.setAddUpChildEducation(valueMap.getOrDefault("addUpChildEducation",""));
|
||||
dto.setAddUpContinuingEducation(valueMap.getOrDefault("addUpContinuingEducation",""));
|
||||
dto.setAddUpHousingLoanInterest(valueMap.getOrDefault("addUpHousingLoanInterest",""));
|
||||
dto.setAddUpHousingRent(valueMap.getOrDefault("addUpHousingRent",""));
|
||||
dto.setAddUpSupportElderly(valueMap.getOrDefault("addUpSupportElderly",""));
|
||||
dto.setAddUpOther(valueMap.getOrDefault("addUpOtherDeduction",""));
|
||||
dto.setLessTaxProportion(valueMap.getOrDefault("lessTaxProportion",""));
|
||||
dto.setAllowedDonation(valueMap.getOrDefault("addUpAllowedDonation",""));
|
||||
dto.setTaxableIncome(valueMap.getOrDefault("addUpTaxableIncome",""));
|
||||
dto.setTaxRate(valueMap.getOrDefault("taxRate",""));
|
||||
dto.setQuickDeductionFactor(valueMap.getOrDefault("quickDeductionFactor",""));
|
||||
dto.setTaxPayable(valueMap.getOrDefault("addUpTaxPayable",""));
|
||||
dto.setTaxSavings(valueMap.getOrDefault("addUpTaxDeduction",""));
|
||||
dto.setTaxWithheld(valueMap.getOrDefault("taxWithheld",""));
|
||||
dto.setRefundedOrSupplementedTax(valueMap.getOrDefault("refundedOrSupplementedTax",""));
|
||||
dto.setMedicalInsurance(valueMap.getOrDefault("medicalInsurance", ""));
|
||||
dto.setUnemploymentInsurance(valueMap.getOrDefault("unemploymentInsurance", ""));
|
||||
dto.setHousingProvidentFund(valueMap.getOrDefault("housingProvidentFund", ""));
|
||||
dto.setAnnuity(valueMap.getOrDefault("annuity", ""));
|
||||
dto.setCommercialHealthInsurance(valueMap.getOrDefault("commercialHealthInsurance", ""));
|
||||
dto.setTaxDeferredEndowmentInsurance(valueMap.getOrDefault("taxDeferredEndowmentInsurance", ""));
|
||||
dto.setOriginalValueOfProperty(valueMap.getOrDefault("originalValueOfProperty", ""));
|
||||
dto.setDeductedTax(valueMap.getOrDefault("deductedTax", ""));
|
||||
dto.setOther(valueMap.getOrDefault("other", ""));
|
||||
dto.setAddUpIncome(valueMap.getOrDefault("addUpIncome", ""));
|
||||
dto.setAddUpSubtraction(valueMap.getOrDefault("addUpSubtraction", ""));
|
||||
dto.setAddUpSpecialDeduction(valueMap.getOrDefault("addUpSpecialDeduction", ""));
|
||||
dto.setAddUpChildEducation(valueMap.getOrDefault("addUpChildEducation", ""));
|
||||
dto.setAddUpContinuingEducation(valueMap.getOrDefault("addUpContinuingEducation", ""));
|
||||
dto.setAddUpHousingLoanInterest(valueMap.getOrDefault("addUpHousingLoanInterest", ""));
|
||||
dto.setAddUpHousingRent(valueMap.getOrDefault("addUpHousingRent", ""));
|
||||
dto.setAddUpSupportElderly(valueMap.getOrDefault("addUpSupportElderly", ""));
|
||||
dto.setAddUpOther(valueMap.getOrDefault("addUpOtherDeduction", ""));
|
||||
dto.setLessTaxProportion(valueMap.getOrDefault("lessTaxProportion", ""));
|
||||
dto.setAllowedDonation(valueMap.getOrDefault("addUpAllowedDonation", ""));
|
||||
dto.setTaxableIncome(valueMap.getOrDefault("addUpTaxableIncome", ""));
|
||||
dto.setTaxRate(valueMap.getOrDefault("taxRate", ""));
|
||||
dto.setQuickDeductionFactor(valueMap.getOrDefault("quickDeductionFactor", ""));
|
||||
dto.setTaxPayable(valueMap.getOrDefault("addUpTaxPayable", ""));
|
||||
dto.setTaxSavings(valueMap.getOrDefault("addUpTaxDeduction", ""));
|
||||
dto.setTaxWithheld(valueMap.getOrDefault("taxWithheld", ""));
|
||||
dto.setRefundedOrSupplementedTax(valueMap.getOrDefault("refundedOrSupplementedTax", ""));
|
||||
dtos.add(dto);
|
||||
}
|
||||
page.setList(dtos);
|
||||
|
|
@ -123,7 +123,7 @@ public class TaxDeclarationBO {
|
|||
List<SalaryItemPO> salaryItems,
|
||||
List<SalarySobPO> salarySobs,
|
||||
List<SalaryAcctResultPO> salaryAcctResults
|
||||
) {
|
||||
) {
|
||||
Result result = new Result();
|
||||
if (CollectionUtils.isEmpty(salaryAcctResults)) {
|
||||
return result;
|
||||
|
|
@ -140,7 +140,7 @@ public class TaxDeclarationBO {
|
|||
Map<Long, List<SalaryAcctResultPO>> taxAgentIdKeyAcctResultMap = SalaryEntityUtil.group2Map(salaryAcctResults, SalaryAcctResultPO::getTaxAgentId);
|
||||
taxAgentIdKeyAcctResultMap.forEach((k, v) -> {
|
||||
// 新增的个税申报表
|
||||
TaxDeclarationPO taxDeclaration = convert2PO(saveParam,user, taxCycle, k);
|
||||
TaxDeclarationPO taxDeclaration = convert2PO(saveParam, user, taxCycle, k);
|
||||
result.getNeedInsertTaxDeclarations().add(taxDeclaration);
|
||||
// 处理个税申报明细以及累计情况
|
||||
handleTaxDeclarationDetail(result, taxDeclaration, v, salaryItemMap);
|
||||
|
|
@ -294,11 +294,11 @@ public class TaxDeclarationBO {
|
|||
BigDecimal addUpEnterpriseAndOther = findAddUpValue("addUpEnterpriseAndOther", resultMap, salaryItemMap);
|
||||
// 更新累计情况
|
||||
AddUpSituation accumulatedSituation = AddUpSituation.builder()
|
||||
.id(IdGenerator.generate())
|
||||
// .id(IdGenerator.generate())
|
||||
.employeeId(employeeId)
|
||||
.taxAgentId(taxDeclaration.getTaxAgentId())
|
||||
.taxYearMonth(taxDeclaration.getSalaryMonth())
|
||||
.year(taxDeclaration.getSalaryMonth().getYear())
|
||||
.taxYearMonth(taxDeclaration.getTaxCycle())
|
||||
.year(SalaryDateUtil.date2Year(taxDeclaration.getTaxCycle()))
|
||||
.addUpIncome(addUpIncome.toPlainString())
|
||||
.addUpSocialSecurityTotal(addUpSocialSecurityTotal.toPlainString())
|
||||
.addUpAccumulationFundTotal(addUpAccumulationFundTotal.toPlainString())
|
||||
|
|
@ -326,9 +326,9 @@ public class TaxDeclarationBO {
|
|||
});
|
||||
}
|
||||
|
||||
private static TaxDeclarationPO convert2PO(TaxDeclarationSaveParam saveParam, User user,Date taxCycle, Long taxAgentId) {
|
||||
private static TaxDeclarationPO convert2PO(TaxDeclarationSaveParam saveParam, User user, Date taxCycle, Long taxAgentId) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if(saveParam.getDescription()==null){
|
||||
if (saveParam.getDescription() == null) {
|
||||
saveParam.setDescription("");
|
||||
}
|
||||
return TaxDeclarationPO.builder()
|
||||
|
|
@ -337,7 +337,7 @@ public class TaxDeclarationBO {
|
|||
.salaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)))
|
||||
.taxCycle(taxCycle)
|
||||
.description(saveParam.getDescription())
|
||||
.creator((long)user.getUID())
|
||||
.creator((long) user.getUID())
|
||||
.createTime(SalaryDateUtil.localDateTimeToDate(now))
|
||||
.updateTime(SalaryDateUtil.localDateTimeToDate(now))
|
||||
.deleteType(0)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
|
|
@ -59,4 +60,6 @@ public interface AddUpSituationMapper {
|
|||
void deleteSome(@Param("param") AddUpSituation params);
|
||||
|
||||
void deleteByTaxYearMonthAndTaxAgentIds(@Param("param") AddUpSituation params);
|
||||
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
}
|
||||
|
|
@ -699,9 +699,9 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteSome">
|
||||
<update id="deleteSome">
|
||||
UPDATE hrsa_add_up_situation
|
||||
SET delete_type=1
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND tax_year_month = #{param.taxYearMonth}
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
|
|
@ -710,12 +710,12 @@
|
|||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteByTaxYearMonthAndTaxAgentIds">
|
||||
<update id="deleteByTaxYearMonthAndTaxAgentIds">
|
||||
UPDATE hrsa_add_up_situation
|
||||
SET delete_type=1
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND tax_year_month = #{param.taxYearMonth}
|
||||
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
|
||||
|
|
@ -724,6 +724,16 @@
|
|||
#{taxAgentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE hrsa_add_up_situation
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -122,6 +122,12 @@
|
|||
#{targetId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.targetType == 'SUBCOMPANY'">
|
||||
e.subcompanyid1 IN
|
||||
<foreach collection="param.targetIds" open="(" item="targetId" separator="," close=")">
|
||||
#{targetId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.employeeStatus != null and param.employeeStatus.size() > 0">
|
||||
AND e.status IN
|
||||
<foreach collection="param.employeeStatus" open="(" item="status" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||
|
||||
import java.time.YearMonth;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -63,11 +64,10 @@ public interface AddUpSituationService {
|
|||
/**
|
||||
* 删除累计情况
|
||||
*
|
||||
* @param taxYearMonth
|
||||
* @param employeeIds
|
||||
* @return
|
||||
*/
|
||||
boolean deleteAddUpSituationList(YearMonth taxYearMonth, List<Long> employeeIds);
|
||||
boolean deleteAddUpSituationList(Date taxCycle, List<Long> employeeIds);
|
||||
|
||||
XSSFWorkbook downloadTemplate(AddUpSituationQueryParam queryParam);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,14 +6,8 @@ import com.engine.salary.util.page.PageInfo;
|
|||
|
||||
import java.time.YearMonth;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public interface AttendQuoteService {
|
||||
/**
|
||||
* AttendQuoteDataService
|
||||
* 数据采集-考勤引用列表
|
||||
*/
|
||||
Map<String, Object> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 数据采集-考勤引用列表(分页)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.taxdeclaration.TaxDeclaration;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
|
||||
|
|
@ -7,7 +8,6 @@ import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
|||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.time.YearMonth;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -34,8 +34,7 @@ public interface TaxDeclarationService {
|
|||
/**
|
||||
* 删除个税申报表
|
||||
*
|
||||
* @param salaryMonth
|
||||
*/
|
||||
void deleteBySalaryMonth(YearMonth salaryMonth);
|
||||
void deleteBySalaryMonth(SalaryAcctRecordPO salaryAcctRecordPO);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.engine.salary.service.AddUpSituationService;
|
|||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelComment;
|
||||
|
|
@ -223,14 +224,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteAddUpSituationList(YearMonth taxYearMonth, List<Long> employeeIds) {
|
||||
if (taxYearMonth == null) {
|
||||
public boolean deleteAddUpSituationList(Date taxCycle, List<Long> employeeIds) {
|
||||
if (taxCycle == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100353, "参数有误:税款所属期必传"));
|
||||
}
|
||||
AddUpSituationBiz biz = new AddUpSituationBiz();
|
||||
String formatLocalDate = SalaryDateUtil.getFormatLocalDate(SalaryDateUtil.toDateStartOfMonth(taxYearMonth));
|
||||
Date date = SalaryDateUtil.localDateToDate(LocalDate.parse(formatLocalDate, SalaryDateUtil.DATE_FORMATTER));
|
||||
biz.deleteSome(AddUpSituation.builder().employeeIds(employeeIds).taxYearMonth(date).build());
|
||||
List<AddUpSituation> addUpSituations = biz.listSome(AddUpSituation.builder().employeeIds(employeeIds).taxYearMonth(taxCycle).build());
|
||||
Set<Long> properties = SalaryEntityUtil.properties(addUpSituations, AddUpSituation::getId);
|
||||
getAddUpSituationMapper().deleteByIds(properties);
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.biz.AttendQuoteBiz;
|
||||
import com.engine.salary.biz.AttendQuoteDataBiz;
|
||||
import com.engine.salary.biz.AttendQuoteDataValueBiz;
|
||||
import com.engine.salary.cmd.datacollection.AttendQuoteListCmd;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteListDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam;
|
||||
|
|
@ -30,7 +29,10 @@ import weaver.hrm.User;
|
|||
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -56,11 +58,6 @@ public class AttendQuoteServiceImpl extends Service implements AttendQuoteServic
|
|||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> list(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new AttendQuoteListCmd(params, user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<AttendQuoteListDTO> listPage(AttendQuoteQueryParam queryParam) {
|
||||
long currentEmployeeId = user.getUID();
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
|||
}
|
||||
});
|
||||
String formula = expressFormula.getFormulaRunScript();
|
||||
log.info("formula run {}", formula);
|
||||
return runner.execute(formula, context, null, true, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -394,17 +394,19 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
}
|
||||
// 根据薪资账套查询薪资周期
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()));
|
||||
|
||||
List<DataCollectionEmployee> finalSalaryEmployees = new ArrayList<>();
|
||||
// 根据薪资账套的"核算人员范围"过滤入职日期大于薪资周期止的人员
|
||||
salaryEmployees = salaryEmployees.stream()
|
||||
.filter(salaryEmployee -> SalaryDateUtil.stringToDate(salaryEmployee.getCompanystartdate()) != null)
|
||||
.filter(salaryEmployee -> StringUtils.isBlank(salaryEmployee.getCompanystartdate())
|
||||
|| SalaryDateUtil.stringToDate(salaryEmployee.getCompanystartdate()).compareTo(salarySobCycleDTO.getSalaryCycle().getEndDate()) <= 0)
|
||||
|| (SalaryDateUtil.stringToDate(salaryEmployee.getCompanystartdate()) != null && SalaryDateUtil.stringToDate(salaryEmployee.getCompanystartdate()).compareTo(salarySobCycleDTO.getSalaryCycle().getEndDate()) <= 0))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
// 根据薪资账套的"核算人员范围"过滤离职日期小于薪资周期起的人员
|
||||
salaryEmployees = salaryEmployees.stream()
|
||||
.filter(salaryEmployee -> SalaryDateUtil.stringToDate(salaryEmployee.getCompanystartdate()) != null)
|
||||
.filter(salaryEmployee -> StringUtils.isBlank(salaryEmployee.getDismissdate())
|
||||
|| SalaryDateUtil.stringToDate(salaryEmployee.getDismissdate()).compareTo(salarySobCycleDTO.getSalaryCycle().getEndDate()) >= 0)
|
||||
|| (SalaryDateUtil.stringToDate(salaryEmployee.getCompanystartdate()) != null && SalaryDateUtil.stringToDate(salaryEmployee.getDismissdate()).compareTo(salarySobCycleDTO.getSalaryCycle().getEndDate()) > 0))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// TODO: 2/9/22 过滤离职人员
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
//撤回工资单
|
||||
getSalarySendService(user).revokeSalaryBill(salaryAcctRecordId);
|
||||
//删除个税申报表(个税申报表、个税申报表详情、往期累计情况)
|
||||
getTaxDeclarationService(user).deleteBySalaryMonth(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()));
|
||||
getTaxDeclarationService(user).deleteBySalaryMonth(salaryAcctRecordPO);
|
||||
// 记录日志
|
||||
// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey);
|
||||
// LoggerContext<SalaryAcctRecordPO> loggerContext = new LoggerContext<>();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.engine.salary.cmd.taxDeclaration.TaxDeclarationGetFormCmd;
|
|||
import com.engine.salary.cmd.taxDeclaration.TaxDeclarationGetTaxDeclarationInfoCmd;
|
||||
import com.engine.salary.cmd.taxDeclaration.TaxDeclarationUpdateCmd;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxdeclaration.TaxDeclaration;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
|
|
@ -32,7 +33,6 @@ import org.apache.ibatis.session.SqlSession;
|
|||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.YearMonth;
|
||||
import java.util.*;
|
||||
|
||||
public class TaxDeclarationServiceImpl extends Service implements TaxDeclarationService {
|
||||
|
|
@ -137,9 +137,9 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalaryMonth(YearMonth salaryMonth) {
|
||||
public void deleteBySalaryMonth(SalaryAcctRecordPO salaryAcctRecordPO) {
|
||||
// 薪资所属月的日期范围
|
||||
LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(SalaryDateUtil.localDateToDate(salaryMonth.atDay(1)));
|
||||
LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(salaryAcctRecordPO.getSalaryMonth());
|
||||
if (Objects.isNull(salaryMonthDateRange)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
// 删除个税申报表详情
|
||||
getTaxDeclarationDetailService(user).deleteByTaxDeclarationIds(taxDeclarationIds);
|
||||
// 删除往期累计情况
|
||||
getAddUpSituationService(user).deleteAddUpSituationList(salaryMonth, Collections.emptyList());
|
||||
getAddUpSituationService(user).deleteAddUpSituationList(salaryAcctRecordPO.getTaxCycle(), Collections.emptyList());
|
||||
}
|
||||
|
||||
public List<TaxDeclarationPO> listBySalaryMonth(LocalDateRange salaryMonthDateRange) {
|
||||
|
|
|
|||
|
|
@ -201,6 +201,16 @@ public class SalaryDateUtil {
|
|||
return YearMonth.parse(localDate);
|
||||
}
|
||||
|
||||
public static Integer date2Year(Date localDate) {
|
||||
if (localDate == null) {
|
||||
return null;
|
||||
}
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(localDate);
|
||||
int year = c.get(Calendar.YEAR);
|
||||
return year ;
|
||||
}
|
||||
|
||||
public static LocalDateRange localDate2Range(Date localDate) {
|
||||
if (localDate == null) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue