Merge branch 'develop' into release

This commit is contained in:
钱涛 2022-05-31 18:29:34 +08:00
commit d800ab1925
6 changed files with 177 additions and 27 deletions

View File

@ -0,0 +1,116 @@
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_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

View File

@ -24,7 +24,7 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SalaryTable(pageId = "a4f85287-e3f9-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX, operates = {
@SalaryTable(pageId = "a4f85287-e3f9-4275-adn9-7d06e54y67j8", tableType = WeaTableType.CHECKBOX, operates = {
@SalaryTableOperate(text = "查看明细")
})
public class AddUpDeductionDTO {

View File

@ -16,11 +16,12 @@ import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import dm.jdbc.util.IdGenerator;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.hrm.User;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
@ -157,7 +158,8 @@ public class TaxDeclarationBO {
// 核算结果按照人员id分类
Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAcctResults, SalaryAcctResultPO::getEmployeeId);
acctResultMap.forEach((k, v) -> {
Map<String, BigDecimal> valueMap = Maps.newHashMapWithExpectedSize(32);
Long employeeId = k;
Map<String, BigDecimal> valueMap = new HashMap<>();
Map<Long, List<SalaryAcctResultPO>> resultMap = SalaryEntityUtil.group2Map(v, SalaryAcctResultPO::getSalaryItemId);
// 收入
BigDecimal income = SalaryEntityUtil.reduce(resultMap.get(salaryItemMap.getOrDefault("income", 0L)), e -> SalaryEntityUtil.empty2Zero(e.getResultValue()));
@ -204,6 +206,9 @@ public class TaxDeclarationBO {
// 累计收入
BigDecimal addUpIncome = findAddUpValue("addUpIncome", resultMap, salaryItemMap);
valueMap.put("addUpIncome", addUpIncome);
// 累计免税收入
BigDecimal addUpTaxFreeIncome = findAddUpValue("addUpTaxFreeIncome", resultMap, salaryItemMap);
valueMap.put("addUpTaxFreeIncome", addUpTaxFreeIncome);
// 累计减除费用
BigDecimal addUpSubtraction = findAddUpValue("addUpSubtraction", resultMap, salaryItemMap);
valueMap.put("addUpSubtraction", addUpSubtraction);
@ -225,6 +230,12 @@ public class TaxDeclarationBO {
// 累计赡养老人
BigDecimal addUpSupportElderly = findAddUpValue("addUpSupportElderly", resultMap, salaryItemMap);
valueMap.put("addUpSupportElderly", addUpSupportElderly);
// 累计大病医疗
BigDecimal addUpIllnessMedical = findAddUpValue("addUpIllnessMedical", resultMap, salaryItemMap);
valueMap.put("addUpIllnessMedical", addUpIllnessMedical);
// 累计婴幼儿照护
BigDecimal addUpInfantCare = findAddUpValue("addUpInfantCare", resultMap, salaryItemMap);
valueMap.put("addUpInfantCare", addUpInfantCare);
// 累计其他扣除
BigDecimal addUpOtherDeduction = findAddUpValue("addUpOtherDeduction", resultMap, salaryItemMap);
valueMap.put("addUpOtherDeduction", addUpOtherDeduction);
@ -249,6 +260,9 @@ public class TaxDeclarationBO {
// 减免税额
BigDecimal addUpTaxDeduction = BigDecimal.ZERO;
valueMap.put("addUpTaxDeduction", addUpTaxDeduction);
// 减免税额
BigDecimal taxDeduction = findValue("taxDeduction", resultMap, salaryItemMap);
valueMap.put("taxDeduction", taxDeduction);
// 应补缴税额
BigDecimal refundedOrSupplementedTax = SalaryEntityUtil.reduce(resultMap.get(salaryItemMap.getOrDefault("refundedOrSupplementedTax", 0L)),
e -> SalaryEntityUtil.empty2Zero(e.getResultValue()));
@ -281,9 +295,9 @@ public class TaxDeclarationBO {
// 更新累计情况
AddUpSituation accumulatedSituation = AddUpSituation.builder()
.id(IdGenerator.generate())
.employeeId(k)
.employeeId(employeeId)
.taxAgentId(taxDeclaration.getTaxAgentId())
.taxYearMonth((taxDeclaration.getSalaryMonth()))
.taxYearMonth(taxDeclaration.getSalaryMonth())
.year(taxDeclaration.getSalaryMonth().getYear())
.addUpIncome(addUpIncome.toPlainString())
.addUpSocialSecurityTotal(addUpSocialSecurityTotal.toPlainString())
@ -295,15 +309,18 @@ public class TaxDeclarationBO {
.addUpHousingLoanInterest(addUpHousingLoanInterest.toPlainString())
.addUpHousingRent(addUpHousingRent.toPlainString())
.addUpSupportElderly(addUpSupportElderly.toPlainString())
.addUpIllnessMedical(addUpIllnessMedical.toPlainString())
.addUpInfantCare(addUpInfantCare.toPlainString())
.addUpOtherDeduction(addUpOtherDeduction.toPlainString())
.addUpTaxExemptIncome("0")
.addUpTaxExemptIncome(addUpTaxFreeIncome.toPlainString())
.addUpAllowedDonation(addUpAllowedDonation.toPlainString())
.addUpAdvanceTax(addUpTaxPayable.toPlainString())
// .addUpTaxSavings(taxDeduction.toPlainString())
.creator(taxDeclaration.getCreator())
.createTime(taxDeclaration.getCreateTime())
.updateTime(taxDeclaration.getUpdateTime())
.tenantKey(taxDeclaration.getTenantKey())
.deleteType(0)
.deleteType(NumberUtils.INTEGER_ZERO)
.build();
result.getNeedInsertAccumulatedSituations().add(accumulatedSituation);
});

View File

@ -16,13 +16,8 @@
e.lastname as username,
e.status as status,
e.workcode as workcode,
d.departmentname as departmentName,
d.id as departmentId,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.companystartdate as companystartdate,
e.mobile as mobile,
b.dismissdate as dismissdate
e.mobile as mobile
from hrmresource e
where e.status not in (7)
<if test="collection != null and collection.size()>0">

View File

@ -323,7 +323,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
@Override
public void batchSave(Collection<SalaryAcctEmployeePO> salaryAcctEmployeePOS) {
if(CollectionUtils.isEmpty(salaryAcctEmployeePOS)){
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
return;
}
List<List<SalaryAcctEmployeePO>> partition = Lists.partition((List) salaryAcctEmployeePOS, 100);
@ -396,11 +396,13 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
SalarySobCycleDTO salarySobCycleDTO = getSalarySobService(user).getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()));
// 根据薪资账套的"核算人员范围"过滤入职日期大于薪资周期止的人员
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)
.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)
.collect(Collectors.toList());

View File

@ -99,6 +99,7 @@ public class SalaryDateUtil {
return StringUtils.EMPTY;
}
}
public static String getFormatLocalDate(LocalDate localDate) {
if (localDate == null) {
return StringUtils.EMPTY;
@ -165,6 +166,7 @@ public class SalaryDateUtil {
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}
public static Date localDateTimeToDate(LocalDateTime localDateTime) {
if (null == localDateTime) {
return null;
@ -323,23 +325,23 @@ public class SalaryDateUtil {
}
/**
* LocalDate转YearMonth
*
* @param localDate
* @return
*/
public static YearMonth toYearMonth(LocalDate localDate){
public static YearMonth toYearMonth(LocalDate localDate) {
Objects.requireNonNull(localDate, "localDate");
return YearMonth.of(localDate.getYear(), localDate.getMonthValue());
}
/**
* YearMonth转Date
* 注意dayOfMonth范围1到31之间最大值根据月份确定特殊情况如2月闰年29非闰年28
* 如果要转换为当月最后一天可以使用下面方法toDateEndOfMonth(YearMonth)
*
* @param yearMonth
* @param dayOfMonth
* @return
@ -351,6 +353,7 @@ public class SalaryDateUtil {
/**
* YearMonth转Date转换为当月第一天
*
* @param yearMonth
* @return
*/
@ -360,6 +363,7 @@ public class SalaryDateUtil {
/**
* YearMonth转Date转换为当月最后一天
*
* @param yearMonth
* @return
*/
@ -373,6 +377,7 @@ public class SalaryDateUtil {
* YearMonth转LocalDate
* 注意dayOfMonth范围1到31之间最大值根据月份确定特殊情况如2月闰年29非闰年28
* 如果要转换为当月最后一天可以使用下面方法toLocalDateEndOfMonth(YearMonth)
*
* @param yearMonth
* @param dayOfMonth
* @return
@ -384,6 +389,7 @@ public class SalaryDateUtil {
/**
* YearMonth转LocalDate转换为当月第一天
*
* @param yearMonth
* @return
*/
@ -393,6 +399,7 @@ public class SalaryDateUtil {
/**
* YearMonth转LocalDate转换为当月最后一天
*
* @param yearMonth
* @return
*/
@ -403,6 +410,7 @@ public class SalaryDateUtil {
/**
* String转Date
*
* @param date
* @return
*/
@ -420,16 +428,7 @@ public class SalaryDateUtil {
}
public static Date stringToDate(String date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date parse = null;
if (date != null) {
try {
parse = sdf.parse(date);
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
return parse;
return dateStrToLocalDate(date);
}
//格式化日期
@ -443,4 +442,25 @@ public class SalaryDateUtil {
String str = new SimpleDateFormat("yyyy-MM").format(date);//再将时间转换为对应格式字符串
return str;
}
private static Date dateStrToLocalDate(String date) {
Date localDate = null;
try {
date = date.substring(0, 10);
if (date.contains("/")) {
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
localDate = format.parse(date);
} else if (date.contains("-")) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
localDate = format.parse(date);
}
} catch (Exception e) {
log.error("日期解析异常,{}", date);
localDate = null;
}
return localDate;
}
}