Compare commits

...

37 Commits

Author SHA1 Message Date
Harryxzy 9155501bba Merge branch 'release/2.19.1.2501.01' into custom/科蓝柏
# Conflicts:
#	src/com/engine/salary/service/SalaryApprovalRuleService.java
#	src/com/engine/salary/service/impl/SalaryApprovalRuleServiceImpl.java
#	src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java
2025-08-29 13:23:39 +08:00
Harryxzy fb239f34ed 修复薪资核算筛选为空时导出报错 2025-07-09 10:08:27 +08:00
钱涛 8168a42b61 日志 2025-07-07 10:20:53 +08:00
Harryxzy bfd953d082 水印单独配置分部不显示 2025-06-19 17:28:09 +08:00
Harryxzy e402029f6c Merge remote-tracking branch 'origin/release/2.19.1.2501.01' into release/2.19.1.2501.01 2025-06-19 11:38:40 +08:00
Harryxzy 63c9558331 修复社保上下限校验 漏掉只开启了公司没开启个人的场景 2025-06-19 11:38:05 +08:00
钱涛 f7cba636b3 修复默认值保留位数 2025-06-18 17:21:22 +08:00
钱涛 919ade5715 Merge remote-tracking branch 'origin/release/2.19.1.2501.01' into release/2.19.1.2501.01 2025-06-18 13:32:17 +08:00
钱涛 de5caded9e 修复工资单性别问题 2025-06-18 13:32:12 +08:00
Harryxzy c2f2390013 修复薪资明细导出,合计行统计文本字段 2025-06-16 16:41:38 +08:00
Harryxzy aff5dbf185 Merge remote-tracking branch 'origin/release/2.19.1.2501.01' into release/2.19.1.2501.01 2025-05-29 10:39:32 +08:00
Harryxzy 578842aa39 修复数据穿透过滤条件 2025-05-29 10:39:06 +08:00
钱涛 1026ff1aae fix邮件中数据为null 2025-05-27 15:56:33 +08:00
钱涛 d9982d2508 fix邮件中数据为null 2025-05-27 10:46:11 +08:00
钱涛 93dc70de26 fix邮件中数据为null 2025-05-26 10:36:38 +08:00
钱涛 81e87ec9ce 优化,导出时过滤空字符串 2025-05-20 16:44:46 +08:00
Harryxzy 05e92add4a 修复明细导出 2025-05-13 16:07:46 +08:00
钱涛 7de3dca2a3 撤回的工资单不允许查看 2025-05-13 13:14:30 +08:00
钱涛 ca75a5f403 fix导出明细 2025-04-29 16:57:33 +08:00
钱涛 bc8e80b4e6 增加SUBSTR拦截处理 2025-04-28 18:14:17 +08:00
Harryxzy 25c8479d53 修复社保福利台账线下对比和核算人数不匹配问题 2025-04-24 17:48:54 +08:00
钱涛 22f494fe12 修复按照扣缴义务人名称检索 2025-04-24 16:02:34 +08:00
钱涛 7a7030a91c 申报表税款所属期检索和申报 2025-04-23 17:39:30 +08:00
钱涛 552cee8a6f 修复合并计税问题 2025-04-21 15:49:28 +08:00
钱涛 0e93cbab04 t 2025-04-21 10:37:44 +08:00
Harryxzy b931707280 更改计算方式 2024-11-04 15:28:01 +08:00
Harryxzy 95161b1007 Merge branch 'feature/sql采用mybatis执行' into custom/科蓝柏 2024-11-04 14:54:19 +08:00
Harryxzy fed5f367bf 增加日志 2024-11-04 09:22:56 +08:00
Harryxzy 0349ba3d81 科蓝柏 数据库兼容问题修复 2024-11-01 13:22:44 +08:00
Harryxzy 410983f37b Merge branch 'release/2.16.1.2410.01' into custom/科蓝柏
# Conflicts:
#	src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java
#	src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java
2024-10-30 16:15:30 +08:00
Harryxzy a638c1b062 科蓝柏 分段计算二开 2024-10-30 16:03:26 +08:00
Harryxzy 969e6ed8c1 科蓝柏 分段计算二开 2024-10-30 16:02:09 +08:00
钱涛 48f8469f81 sql采用mybatis执行 2024-10-15 14:50:31 +08:00
Harryxzy 7609341a8e 科蓝柏解决合并冲突 2024-09-10 11:43:54 +08:00
Harryxzy 6fd687f8d5 Merge branch 'release/2.15.1.2407.01' into custom/科蓝柏
# Conflicts:
#	src/com/engine/salary/service/impl/SalarySobServiceImpl.java
#	src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java
2024-09-10 11:33:58 +08:00
Harryxzy cec9811da8 流程审批增加合计行 2024-08-13 10:05:52 +08:00
Harryxzy ac766c83a5 Merge branch 'feature/工资单审批' into custom/科蓝柏 2024-04-26 11:25:28 +08:00
33 changed files with 535 additions and 114 deletions

Binary file not shown.

View File

@ -267,7 +267,7 @@ public class SalaryBillBO {
}
Util_Message.store(messageBean);
} catch (IOException e) {
log.error("消息发送失败",e);
log.error("消息发送失败", e);
}
}
@ -649,7 +649,8 @@ public class SalaryBillBO {
} else {
for (Object keyName : e.keySet()) {
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString()))
String itemValue = Util.null2String(e.get(keyName.toString()));
boolean isHide = (isHideNull && StringUtils.isEmpty(itemValue))
||
(isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString())
&& BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0);
@ -660,7 +661,7 @@ public class SalaryBillBO {
emailContent.append("</th>");
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
emailContent.append(e.get(keyName.toString()));
emailContent.append(itemValue.replaceAll("null", ""));
emailContent.append("</td>");
}
break;
@ -729,7 +730,8 @@ public class SalaryBillBO {
SalaryTemplateSalaryItemListDTO salaryItem = itemPartition.get(i);
for (Object keyName : e.keySet()) {
if ((salaryItem.getId() + SalaryArchiveConstant.DYNAMIC_SUFFIX).equals(keyName.toString())) {
boolean isHide = (isHideNull && StringUtils.isEmpty(e.getOrDefault(keyName.toString(), StringUtils.EMPTY).toString()))
String itemValue = Util.null2String(e.get(keyName.toString()));
boolean isHide = (isHideNull && StringUtils.isEmpty(itemValue))
||
(isHideZero && NumberUtils.isCreatable(e.getOrDefault(keyName.toString(), "0").toString())
&& BigDecimal.ZERO.compareTo(new BigDecimal(e.getOrDefault(keyName.toString(), "0").toString())) == 0);
@ -740,7 +742,7 @@ public class SalaryBillBO {
emailContent.append("</th>");
emailContent.append("<td style=\"padding: 16px 24px;display: table-cell;flex: 1;color: #000000d9;font-size: 12px;line-height: 1.5715;word-break: break-word;overflow-wrap: break-word;border-collapse: collapse;border: 1px solid rgba(0,0,0,.06);\">");
emailContent.append(e.get(keyName.toString()));
emailContent.append(itemValue.replaceAll("null", ""));
emailContent.append("</td>");
}
break;
@ -867,7 +869,7 @@ public class SalaryBillBO {
if ("text".equals(wmClassify)) {
wmTextFieldIds = (List<String>) salaryBillWatermark.getWmSetting().getOrDefault("wmSelectedFieldIds", Collections.emptyList());
List<String> empFields = Arrays.asList(HRM_Name, HRM_Num, HRM_Mobile, HRM_Email, HRM_CurrentOperatorId, HRM_Department);
List<String> empFields = Arrays.asList(HRM_Name, HRM_Num, HRM_Mobile, HRM_Email, HRM_CurrentOperatorId, HRM_Department, HRM_SecondDepartment);
if (wmTextFieldIds.contains(HRM_SecondDepartment)) {
// 需要查分部
salaryBillWatermark.getWmSetting().put("needQuerySubDepart", true);

View File

@ -1,6 +1,7 @@
package com.engine.salary.entity.salaryacct.bo;
import cn.hutool.core.util.NumberUtil;
import com.engine.kq.service.KQGroupService;
import com.engine.salary.annotation.SalaryFormulaVar;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.constant.SalaryFormulaFieldConstant;
@ -24,21 +25,26 @@ import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum;
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
import com.engine.salary.enums.salarysob.SalarySobAdjustRuleTypeEnum;
import com.engine.salary.mapper.SQLMapper;
import com.engine.salary.util.JsonUtil;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -127,12 +133,12 @@ public class CalculateFormulaVarBO {
* @param salaryAcctCalculateBO 核算参数
* @return
*/
public Map<String, List<FormulaVarValue>> convert2FormulaVar(SalaryAcctCalculateBO salaryAcctCalculateBO) {
public Map<String, List<FormulaVarValue>> convert2FormulaVar(SalaryAcctCalculateBO salaryAcctCalculateBO, KQGroupService kqGroupService) {
Map<String, List<FormulaVarValue>> resultMap = Maps.newHashMapWithExpectedSize(salaryAcctCalculateBO.getSalaryAcctEmployeePOS().size());
// 处理薪资核算结果
handleSalaryAcctResult(salaryAcctCalculateBO, resultMap);
// 处理薪资档案
handleSalaryArchiveData(salaryAcctCalculateBO, resultMap);
handleSalaryArchiveData(salaryAcctCalculateBO, resultMap, kqGroupService);
// 处理浮动薪资档案
handleVariableArchiveData(salaryAcctCalculateBO, resultMap);
// 处理往期累计情况
@ -238,7 +244,8 @@ public class CalculateFormulaVarBO {
* @param salaryAcctCalculateBO 薪资核算参数
* @param resultMap 返回结果集
*/
private void handleSalaryArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map<String, List<FormulaVarValue>> resultMap) {
private void handleSalaryArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map<String, List<FormulaVarValue>> resultMap, KQGroupService kqGroupService) {
// 调薪计薪规则
Map<Long, SalarySobAdjustRulePO> salarySobAdjustRulePOMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalarySobAdjustRulePOS(),
SalarySobAdjustRulePO::getSalaryItemId);
@ -247,11 +254,12 @@ public class CalculateFormulaVarBO {
String key = salaryArchiveDataDTO.getEmployeeId() + "_" + salaryArchiveTaxAgentDataDTO.getTaxAgentId();
List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList());
// 将薪资档案的值转换成公式中的变量填充到返回结果集中
formulaVarValues.addAll(handleSalaryArchiveItemVal(salaryAcctCalculateBO, salaryArchiveTaxAgentDataDTO.getSalaryItemValues(), salarySobAdjustRulePOMap));
formulaVarValues.addAll(handleSalaryArchiveItemVal(salaryAcctCalculateBO, salaryArchiveTaxAgentDataDTO.getSalaryItemValues(), salarySobAdjustRulePOMap, kqGroupService, salaryArchiveDataDTO.getEmployeeId()));
}
}
}
private void handleVariableArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map<String, List<FormulaVarValue>> resultMap) {
Map<String, Map<String, Object>> variableArchiveMap = SalaryEntityUtil.convert2Map(variableArchiveList, map -> map.getOrDefault("taxAgentIds", "").toString() + "-" + map.getOrDefault("employeeId", "").toString());
// 填充到返回结果集中
@ -283,7 +291,9 @@ public class CalculateFormulaVarBO {
*/
private List<FormulaVarValue> handleSalaryArchiveItemVal(SalaryAcctCalculateBO salaryAcctCalculateBO,
List<SalaryArchiveItemDataDTO> salaryArchiveItemDataList,
Map<Long, SalarySobAdjustRulePO> salarySobAdjustRulePOMap) {
Map<Long, SalarySobAdjustRulePO> salarySobAdjustRulePOMap,
KQGroupService kqGroupService,
Long employeeId) {
// 薪资周期
LocalDateRange salaryCycle = salaryAcctCalculateBO.getSalarySobCycleDTO().getSalaryCycle();
// key:薪资项目的idvalue:薪资项目的code
@ -302,18 +312,18 @@ public class CalculateFormulaVarBO {
SalarySobAdjustRulePO salaryAdjustmentRulePO = salarySobAdjustRulePOMap.get(entry.getKey());
if (entry.getValue().size() > 2) {
// 如果薪资项目在薪资周期内经历了多次调薪则默认分段计薪
value = calculateBySalarySobAdjustRule(salaryCycle, SalarySobAdjustRuleTypeEnum.PARTITION, entry.getValue());
value = calculateBySalarySobAdjustRule(salaryCycle, SalarySobAdjustRuleTypeEnum.PARTITION, entry.getValue(), kqGroupService, employeeId);
} else if (salaryAdjustmentRulePO == null || entry.getValue().size() < 2) {
// 如果薪资项目没有设置调薪计薪规则默认取薪资周期内薪资档案中最新的值
// 如果薪资项目在薪资周期内没有调薪默认取薪资周期内薪资档案中最新的值
value = calculateBySalarySobAdjustRule(salaryCycle, SalarySobAdjustRuleTypeEnum.USE_AFTER_ADJUSTMENT, entry.getValue());
value = calculateBySalarySobAdjustRule(salaryCycle, SalarySobAdjustRuleTypeEnum.USE_AFTER_ADJUSTMENT, entry.getValue(), kqGroupService, employeeId);
} else {
// 如果薪资项目在薪资周期内只有一次调薪则根据调薪计薪规则处理
SalarySobAdjustRuleTypeEnum adjustRuleTypeEnum = salaryAdjustmentRulePO.getDayOfMonth() < SalaryDateUtil.dateToLocalDate(entry.getValue().get(0).getEffectiveDateRange().getEndDate()).getDayOfMonth()
? SalarySobAdjustRuleTypeEnum.parseByValue(salaryAdjustmentRulePO.getAfterAdjustmentType())
: SalarySobAdjustRuleTypeEnum.parseByValue(salaryAdjustmentRulePO.getBeforeAdjustmentType());
// 根据调薪计薪规则处理薪资档案的调薪
value = calculateBySalarySobAdjustRule(salaryCycle, adjustRuleTypeEnum, entry.getValue());
value = calculateBySalarySobAdjustRule(salaryCycle, adjustRuleTypeEnum, entry.getValue(), kqGroupService, employeeId);
}
String fieldId = SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getValue()
+ SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR
@ -332,7 +342,9 @@ public class CalculateFormulaVarBO {
*/
private String calculateBySalarySobAdjustRule(LocalDateRange salaryCycle,
SalarySobAdjustRuleTypeEnum adjustRuleTypeEnum,
List<SalaryArchiveItemDataDTO> salaryArchiveItemDataDTOS) {
List<SalaryArchiveItemDataDTO> salaryArchiveItemDataDTOS,
KQGroupService kqGroupService,
Long employeeId) {
if (Objects.isNull(adjustRuleTypeEnum)) {
return StringUtils.EMPTY;
}
@ -348,17 +360,46 @@ public class CalculateFormulaVarBO {
case PARTITION:
// 可能存在多次调薪
// = (第一段的值*第一段的自然日+第二段的值*第二段的自然日+)/薪资所属月自然日
BigDecimal valueSum = BigDecimal.ZERO;
for (int i = 0; i < salaryArchiveItemDataDTOS.size(); i++) {
SalaryArchiveItemDataDTO dataDTO = salaryArchiveItemDataDTOS.get(i);
BigDecimal dayDiff = new BigDecimal(SalaryDateUtil.dateToLocalDate(dataDTO.getEffectiveDateRange().getFromDate()).until(SalaryDateUtil.dateToLocalDate(dataDTO.getEffectiveDateRange().getEndDate()), ChronoUnit.DAYS));
// 最后一段日期范围需要加一
if (Objects.equals(i, salaryArchiveItemDataDTOS.size() - 1)) {
dayDiff = dayDiff.add(BigDecimal.ONE);
}
valueSum = valueSum.add(SalaryEntityUtil.empty2Zero(dataDTO.getValue()).multiply(dayDiff));
// BigDecimal valueSum = BigDecimal.ZERO;
BigDecimal firstValue = BigDecimal.ZERO;
BigDecimal baseValue = new BigDecimal("21.75");
// 调薪补差金额
BigDecimal needAddValue = new BigDecimal(0);
if (CollectionUtils.isNotEmpty(salaryArchiveItemDataDTOS)) {
firstValue = SalaryEntityUtil.empty2Zero(salaryArchiveItemDataDTOS.get(0).getValue());
}
value = valueSum.divide(new BigDecimal(SalaryDateUtil.dateToLocalDate(salaryCycle.getFromDate()).until(SalaryDateUtil.dateToLocalDate(salaryCycle.getEndDate()), ChronoUnit.DAYS)).add(BigDecimal.ONE), 2, RoundingMode.HALF_UP).toPlainString();
BaseBean baseBean = new BaseBean();
baseBean.writeLog("klbsize"+salaryArchiveItemDataDTOS.size());
for (int i = 1; i < salaryArchiveItemDataDTOS.size(); i++) {
// 科蓝柏二开调薪前工资+调薪后工资-调薪前工资/21.75*调薪后的应出勤天数+调薪后的法定节假日天数
SalaryArchiveItemDataDTO dataDTO = salaryArchiveItemDataDTOS.get(i);
// 获取应出勤日期+法定节假日
Double ycq = new Double(0);
String fdjjr = "0";
if (Objects.equals(i, salaryArchiveItemDataDTOS.size() - 1)) {
ycq = getKQYcq(dataDTO.getEffectiveDateRange().getFromDate(), dataDTO.getEffectiveDateRange().getEndDate(), employeeId);
fdjjr = getFdjjr(SalaryDateUtil.getFormatDate(dataDTO.getEffectiveDateRange().getFromDate()), SalaryDateUtil.getFormatDate(dataDTO.getEffectiveDateRange().getEndDate()), employeeId.toString(), kqGroupService);
} else {
// 不是最后一个需要往前挪1天
Date endDate = SalaryDateUtil.localDateToDate(SalaryDateUtil.dateToLocalDate(dataDTO.getEffectiveDateRange().getEndDate()).minusDays(1));
ycq = getKQYcq(dataDTO.getEffectiveDateRange().getFromDate(), endDate, employeeId);
fdjjr = getFdjjr(SalaryDateUtil.getFormatDate(dataDTO.getEffectiveDateRange().getFromDate()), SalaryDateUtil.getFormatDate(endDate), employeeId.toString(), kqGroupService);
}
baseBean.writeLog("klb-ycq" +ycq);
double days = ycq + (NumberUtils.isCreatable(fdjjr) ? Double.valueOf(fdjjr) : 0);
needAddValue = needAddValue.add(SalaryEntityUtil.empty2Zero(dataDTO.getValue()).subtract(firstValue).divide(baseValue, 15, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(days)));
//
// BigDecimal dayDiff = new BigDecimal(SalaryDateUtil.dateToLocalDate(dataDTO.getEffectiveDateRange().getFromDate()).until(SalaryDateUtil.dateToLocalDate(dataDTO.getEffectiveDateRange().getEndDate()), ChronoUnit.DAYS));
// // 最后一段日期范围需要加一
// if (Objects.equals(i, salaryArchiveItemDataDTOS.size() - 1)) {
// dayDiff = dayDiff.add(BigDecimal.ONE);
// }
// valueSum = valueSum.add(SalaryEntityUtil.empty2Zero(dataDTO.getValue()).multiply(dayDiff));
}
// value = valueSum.divide(new BigDecimal(SalaryDateUtil.dateToLocalDate(salaryCycle.getFromDate()).until(SalaryDateUtil.dateToLocalDate(salaryCycle.getEndDate()), ChronoUnit.DAYS)).add(BigDecimal.ONE), 2, RoundingMode.HALF_UP).toPlainString();
baseBean.writeLog("klb-ycq" +needAddValue);
value = firstValue.add(needAddValue).toPlainString();
break;
case USE_BEFORE_ADJUSTMENT:
// = 调薪前工资
@ -375,6 +416,88 @@ public class CalculateFormulaVarBO {
return value;
}
private SQLMapper getSQLMapper() {
return MapperProxyFactory.getProxy(SQLMapper.class);
}
/**
* 获取应出勤时数
* @param fromDate
* @param endDate
* @param userId
*/
private Double getKQYcq(Date fromDate, Date endDate, Long userId) {
BaseBean baseBean = new BaseBean();
double ycq = 0.00;
String sql = "SELECT sum(workdays) as a,sum(attendancemins) FROM kq_format_total WHERE workdays is not null and resourceid = "+userId+" and kqdate >= '" +SalaryDateUtil.getFormatDate(fromDate)+"' and kqdate <= '"+ SalaryDateUtil.getFormatDate(endDate)+"'";
baseBean.writeLog("klb-1" + sql);
List<Map> list = getSQLMapper().runSQL(sql);
baseBean.writeLog("klb-list" +list);
if (CollectionUtils.isNotEmpty(list)) {
Object value = list.get(0).get("a");
if (value != null) {
baseBean.writeLog("klb-value" +value);
ycq = NumberUtils.isCreatable(value.toString()) ? Double.valueOf(value.toString()) : Double.valueOf("0");
}
}
return ycq;
}
/**
* 获取法定节假日天数
*/
public String getFdjjr(String fromDate, String toDate, String userId, KQGroupService kqGroupService) {
BaseBean baseBean = new BaseBean();
if (StringUtils.isEmpty(userId) || StringUtils.isEmpty(fromDate) || StringUtils.isEmpty(toDate)) {
baseBean.writeLog("userId or fromDate or toDate is null!" + fromDate + toDate + userId);
return "0";
}
Map<String, Object> params = new HashMap<>();
params.put("viewScope", 3);
params.put("resourceId", userId);
params.put("groupType", 0);
params.put("pageSize", 10);
params.put("pageIndex", 1);
User tmpUser = new User();
tmpUser.setUid(1);
tmpUser.setLoginid("sysadmin");
//获取当前人员的生效考勤组
String activeGroupId = null;
List<Map<String, Object>> dataSource = null;
Map<String, Object> groupInfo = kqGroupService.getGroupMemberList(params, tmpUser);
if (groupInfo != null && groupInfo.size() > 0) {
if (groupInfo.get("dataSource") != null) {
dataSource = (List<Map<String, Object>>) groupInfo.get("dataSource");
if (dataSource != null && dataSource.size() > 0) {
Map<String, Object> dataMap = dataSource.get(0);
activeGroupId = dataMap.get("activeGroupId") + "";
}
}
}
if (activeGroupId == null && activeGroupId.length() > 0) {
baseBean.writeLog("activeGroupId is null:" + params + dataSource);
return "0";
}
// 计算公共假期
RecordSet rs = new RecordSet();
String sql ="select count(1) from kq_HolidaySet where changeType =1 and holidayDate>= '"+ fromDate + "' and holidayDate<= '"+toDate+"' and groupId = "+ activeGroupId;
rs.execute(sql);
int jq =0;
if(rs.next()){
jq = rs.getInt(1);
}
if(jq == -1) {
jq = 0;
}
return String.valueOf(jq);
}
/**
* 处理累计情况工资薪金
*

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.salaryacct.bo;
import cn.hutool.core.util.StrUtil;
import com.engine.salary.constant.TaxDeclarationDataIndexConstant;
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
@ -73,6 +74,9 @@ public class SalaryAcctConsolidatedTaxBO {
.filter(e -> Objects.equals(e.getSalaryItemId(), optional.get()))
.map(e -> SalaryEntityUtil.empty2Zero(e.getResultValue()))
.reduce(BigDecimal.ZERO, BigDecimal::add);
if (StrUtil.isBlank(resultValue)) {
resultValue = "0.00";
}
return new BigDecimal(resultValue).add(income).toPlainString();
}
// 个税调差为0
@ -98,6 +102,9 @@ public class SalaryAcctConsolidatedTaxBO {
.map(e -> SalaryEntityUtil.empty2Zero(e.getResultValue()))
.reduce(BigDecimal.ZERO, BigDecimal::add);
}
if (StrUtil.isBlank(resultValue)) {
resultValue = "0.00";
}
return new BigDecimal(resultValue).add(refundedOrSupplementedTax).subtract(taxAdjustment).toPlainString();
}
return resultValue;

View File

@ -20,7 +20,7 @@ import java.util.Collection;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryAcctCalculateParam {
public class SalaryAcctCalculateParam {
//核算人员的id,不是employeeId而是salaryAcctEmpId
private Collection<Long> ids;

View File

@ -144,7 +144,7 @@ public class SalarySobItemAggregateBO {
.canEdit(openFormulaForcedEditing || Objects.equals(salaryItemPO.getCanEdit(), 1))
.canDelete(openFormulaForcedEditing || salaryItemPO.getCanDelete() == null || Objects.equals(salaryItemPO.getCanDelete(), 1))
.width(salaryItemPO.getWidth())
.defaultValue(salaryItemPO.getDefaultValue())
.defaultValue(salarySobItemPO.getDefaultValue())
.build());
}
}

View File

@ -37,6 +37,10 @@ public class TaxDeclarationListDTO {
@TableTitle(title = "薪资类型", dataIndex = "incomeCategory", key = "incomeCategory")
private String incomeCategory;
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
@TableTitle(title = "税款所属期", dataIndex = "taxCycle", key = "taxCycle")
private Date taxCycle;
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
@TableTitle(title = "薪资所属月", dataIndex = "salaryMonth", key = "salaryMonth")
private Date salaryMonth;
@ -47,10 +51,6 @@ public class TaxDeclarationListDTO {
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
private String taxAgentName;
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
@TableTitle(title = "税款所属期", dataIndex = "taxCycle", key = "taxCycle")
private Date taxCycle;
//@TableTitle(title = "操作人id", dataIndex = "operateEmployeeId", key = "operateEmployeeId")
private Long operateEmployeeId;

View File

@ -1,9 +1,14 @@
package com.engine.salary.entity.taxdeclaration.param;
import com.engine.salary.common.BaseQueryParam;
import lombok.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.YearMonth;
import java.util.Date;
/**
* 个税申报记录查询条件
@ -20,12 +25,13 @@ import java.time.YearMonth;
public class TaxDeclarationListQueryParam extends BaseQueryParam {
//薪资所属月范围起点
private YearMonth fromSalaryMonth;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date fromSalaryMonth;
//薪资所属月范围终点
private YearMonth endSalaryMonth;
//薪资所属月范围终点
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date endSalaryMonth;
private String fromSalaryMonthStr;
private String endSalaryMonthStr;
//个税扣缴义务人菜单")
private String taxAgentName;
}

View File

@ -86,6 +86,13 @@ public class TaxDeclarationPO {
LocalDateRange salaryMonths;
//"开始日期
private Date taxCycleFromDate;
//结束日期
private Date taxCycleEndDate;
private Collection<Long> taxAgentIds;
}

View File

@ -11,6 +11,7 @@
e.workcode,
e.certificatenum as idNo,
e.accounttype as accountType,
e.sex as sex,
'false' as extEmp
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
@ -21,6 +22,7 @@
<select id="getEmployeeByIds" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
select e.id as employeeId,
e.lastname as username,
e.sex as sex,
e.certificatenum as idNo,
e.status as status,
e.workcode as workcode,
@ -41,6 +43,7 @@
<select id="getEmployeeByIdsIncludeAccountType" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
select e.id as employeeId,
e.lastname as username,
e.sex as sex,
e.certificatenum as idNo,
e.status as status,
e.workcode as workcode,
@ -122,6 +125,7 @@
select e.id as employeeId,
e.lastname as username,
e.status as status,
e.sex as sex,
e.certificatenum as idNo,
e.workcode as workcode,
d.departmentname as departmentName,
@ -228,6 +232,7 @@
select e.id as employeeId,
e.lastname as username,
e.status as status,
e.sex as sex,
e.certificatenum as idNo,
e.workcode as workcode,
d.departmentname as departmentName,
@ -282,6 +287,7 @@
e.lastname as username,
e.status as status,
e.workcode as workcode,
e.sex as sex,
e.certificatenum as idNo,
e.companystartdate as companystartdate,
e.mobile as mobile,
@ -303,6 +309,7 @@
e.status as status,
e.workcode as workcode,
e.certificatenum as idNo,
e.sex as sex,
e.companystartdate as companystartdate,
e.mobile as mobile,
e.accounttype as accountType,
@ -323,6 +330,7 @@
e.status as status,
e.workcode as workcode,
e.certificatenum as idNo,
e.sex as sex,
e.companystartdate as companystartdate,
e.mobile as mobile,
e.departmentid as departmentId,
@ -486,6 +494,7 @@
e.lastname as username,
e.status as status,
e.certificatenum as idNo,
e.sex as sex,
e.workcode as workcode,
e.companystartdate as companystartdate,
e.mobile as mobile,
@ -561,6 +570,7 @@
e.lastname as username,
e.status as status,
e.certificatenum as idNo,
e.sex as sex,
e.workcode as workcode,
d.departmentname as departmentName,
d.id as departmentId,

View File

@ -61,6 +61,12 @@
<if test="salaryMonths != null and salaryMonths.endDate != null">
AND salary_month <![CDATA[ <= ]]> #{salaryMonths.endDate}
</if>
<if test="taxCycleFromDate != null">
AND tax_cycle <![CDATA[ >= ]]> #{taxCycleFromDate}
</if>
<if test="taxCycleEndDate != null">
AND tax_cycle <![CDATA[ <= ]]> #{taxCycleEndDate}
</if>
<if test="taxAgentIds != null and taxAgentIds.size()>0">
AND tax_agent_id IN
<foreach collection="taxAgentIds" open="(" item="id" separator="," close=")">

View File

@ -45,6 +45,9 @@ public class SalaryStatisticsDataPerspectiveQueryParam extends BaseQueryParam {
//个税扣缴义务人配置
private List<Long> taxAgent;
@JsonIgnore
private List<Long> salarySob;
@JsonIgnore
//收入所得项目配置
private List<Integer> incomeCategory;

View File

@ -469,12 +469,21 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
if (reportPO.getTaxAgentSetting() != null) {
param.setTaxAgent(((List<Map>) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
}
if (reportPO.getSalarySobSetting() != null) {
param.setSalarySob(((List<Map>) JSON.parseArray(reportPO.getSalarySobSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
}
if (reportPO.getSubCompanySetting() != null) {
param.setSubCompany(((List<Map>) JSON.parseArray(reportPO.getSubCompanySetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
}
if (reportPO.getDepartSetting() != null) {
param.setDepart(((List<Map>) JSON.parseArray(reportPO.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
}
if (reportPO.getPositionSetting() != null) {
param.setPosition(((List<Map>) JSON.parseArray(reportPO.getPositionSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
}
if (reportPO.getStatusSetting() != null) {
param.setStatus(((List<Map>) JSON.parseArray(reportPO.getStatusSetting(), Map.class)).stream().map(m -> m.get(key).toString()).collect(Collectors.toList()));
}
if (reportPO.getEmployeeSetting() != null) {
param.setEmployee(((List<Map>) JSON.parseArray(reportPO.getEmployeeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
}

View File

@ -334,7 +334,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
sumRow.add(Util.null2String(countResult.get(weaTableColumnGroup.getColumn())));
}
} else {
sumRow.add(Util.null2String(countResult.get(weaTableColumnGroup.getColumn())));
sumRow.add("");
}
}
rowList.add(sumRow);

View File

@ -1,5 +1,6 @@
package com.engine.salary.service;
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
@ -10,6 +11,7 @@ import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @author Harryxzy
@ -114,4 +116,6 @@ public interface SalaryApprovalRuleService {
void deleteBySalarySobIds(Collection<Long> ids);
List<SalaryApprovalRulePO> listBySalarySobIds(Collection<Long> salarySobIds);
Map<String, Object> sumRow(SalaryAcctResultQueryParam queryParam);
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.engine.core.impl.Service;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
@ -20,7 +21,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.util.StopWatch;
import weaver.conn.RecordSet;
import weaver.conn.RecordSetDataSource;
import weaver.general.BaseBean;
import weaver.general.Util;
@ -43,7 +43,7 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
QlExpress express = new QlExpress();
private SQLMapper getSQLMapper(){
private SQLMapper getSQLMapper() {
return MapperProxyFactory.getProxy(SQLMapper.class);
}
@ -129,17 +129,17 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
}
} else {
// List<Map> list = getSQLMapper().runSQL(sql);
// if(CollectionUtil.isNotEmpty(list)){
// result = Util.null2String(list.get(0).get(sqlReturnKey));
// }
RecordSet rs = new RecordSet();
if (rs.execute(sql)) {
if (rs.next()) {
result = rs.getString(sqlReturnKey);
}
List<Map> list = getSQLMapper().runSQL(sql);
if (CollectionUtil.isNotEmpty(list)) {
result = list.get(0) != null ? Util.null2String(list.get(0).get(sqlReturnKey)) : "";
}
//
// RecordSet rs = new RecordSet();
// if (rs.execute(sql)) {
// if (rs.next()) {
// result = rs.getString(sqlReturnKey);
// }
// }
}
if (OpenEnum.OPEN.getValue().equals(openDecrypt)) {

View File

@ -172,7 +172,8 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar
List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listAll();
List<Long> canAccountIds = baseInfoPOList.stream()
.filter(f->f.getPaymentOrganization().toString().equals(queryParam.getPaymentOrganization())
&& (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())))
&& !f.getRunStatus().equals(EmployeeStatusEnum.STAY_ADD.getValue())
)
.map(InsuranceArchivesBaseInfoPO::getEmployeeId)
.collect(Collectors.toList());
accountExportPOS = accountExportPOS.stream().filter(v -> canAccountIds.contains(v.getEmployeeId())).collect(Collectors.toList());

View File

@ -2881,12 +2881,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (otherPaymentBaseString != null) {
updateOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
if (!welBaseDiffSign) {
otherPaymentBaseString = adaptWelBaseLimit(updateOtherInfo.getOtherSchemeId(), updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (otherPaymentBaseString != null) {
updateOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利个人: " + errorMsg;
}
if ( (!welBaseDiffSign) && (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利公司: " + errorMsg;
}
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
@ -2952,12 +2962,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (otherPaymentBaseString != null) {
insertOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
if (!welBaseDiffSign) {
otherPaymentBaseString = adaptWelBaseLimit(insertOtherInfo.getOtherSchemeId(), insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (otherPaymentBaseString != null) {
insertOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利个人:" + errorMsg;
}
if ( (!welBaseDiffSign) && (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
@ -3092,12 +3112,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (fundPaymentBaseString != null) {
updateFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
if (!welBaseDiffSign) {
fundPaymentBaseString = adaptWelBaseLimit(updateFundInfo.getFundSchemeId(), updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (fundPaymentBaseString != null) {
updateFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金个人" + errorMsg;
}
if ( (!welBaseDiffSign) && (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金公司" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -3168,12 +3198,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (fundPaymentBaseString != null) {
insertFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
if (!welBaseDiffSign) {
fundPaymentBaseString = adaptWelBaseLimit(insertFundInfo.getFundSchemeId(), insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (fundPaymentBaseString != null) {
insertFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金个人:" + errorMsg;
}
if ((!welBaseDiffSign) && (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -3315,12 +3355,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (socialPaymentBaseString != null) {
updateSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
if (!welBaseDiffSign) {
socialPaymentBaseString = adaptWelBaseLimit(updateSocialInfo.getSocialSchemeId(), updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (socialPaymentBaseString != null) {
updateSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保个人:" + errorMsg;
}
if ((!welBaseDiffSign) && (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -3390,12 +3440,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (socialPaymentBaseString != null) {
insertSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
if (!welBaseDiffSign) {
socialPaymentBaseString = adaptWelBaseLimit(insertSocialInfo.getSocialSchemeId(), insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (socialPaymentBaseString != null) {
insertSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保个人:" + errorMsg;
}
if ((!welBaseDiffSign) && (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {

View File

@ -1432,6 +1432,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
Boolean otherCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg);
Boolean socialCheckBase2 = true;
Boolean fundCheckBase2 = true;
Boolean otherCheckBase2 = true;
if (!welBaseDiffSign) {
socialCheckBase2 = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
fundCheckBase2 = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
otherCheckBase2 = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
}
Boolean socialCheckComBase = true;
Boolean fundCheckComBase = true;
Boolean otherCheckComBase = true;
@ -1440,17 +1448,17 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
fundCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
otherCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
}
if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) {
if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckBase2 && fundCheckBase2 && otherCheckBase2 && socialCheckComBase && fundCheckComBase && otherCheckComBase) {
insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO);
} else {
String checkMessage = "该条数据中";
if (!socialCheckBase || !socialCheckComBase) {
if (!socialCheckBase || !socialCheckBase2 || !socialCheckComBase) {
checkMessage = checkMessage + "社保福利基数、";
}
if (!fundCheckBase || !fundCheckComBase) {
if (!fundCheckBase || !fundCheckBase2 || !fundCheckComBase) {
checkMessage = checkMessage + "公积金福利基数、";
}
if (!otherCheckBase || !otherCheckComBase) {
if (!otherCheckBase || !otherCheckBase2 || !otherCheckComBase) {
checkMessage = checkMessage + "其他福利基数、";
}
checkMessage = checkMessage.substring(0, checkMessage.length() - 1);
@ -1470,6 +1478,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString);
insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString);
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString);
if (!welBaseDiffSign) {
newSocialPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
newFundPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
newOtherPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString);
insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString);
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString);
}
if (welBaseDiffSign) {
String newSocialPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());

View File

@ -3,6 +3,8 @@ package com.engine.salary.service.impl;
import cn.hutool.core.util.StrUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.kq.service.KQGroupService;
import com.engine.kq.service.impl.KQGroupServiceImpl;
import com.engine.salary.cache.SalaryCacheKey;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.constant.SalaryFormulaFieldConstant;
@ -113,6 +115,13 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
return ServiceUtil.getService(VariableArchiveServiceImpl.class, user);
}
private KQGroupService getKQGroupService() {
User user = new User();
user.setUid(1);
user.setLoginid("sysadmin");
return (KQGroupService) ServiceUtil.getService(KQGroupServiceImpl.class, user);
}
@Override
public void calculate(SalaryAcctCalculateBO salaryAcctCalculateBO, DataCollectionEmployee simpleEmployee, List<SalarySobBackItemPO> salarySobBackItems) {
log.info("开始核算V3 {}", salaryAcctCalculateBO);
@ -189,7 +198,8 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
// 10转换成公式编辑器中的变量
sw.start("转换成公式编辑器中的变量");
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList);
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
KQGroupService kqGroupService = getKQGroupService();
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO, kqGroupService);
sw.stop();
sw.start("数据结构准备");
// 本次薪资核算所用的薪资账套下的薪资项目

View File

@ -405,11 +405,13 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
if (openSum != null && StringUtils.isNotBlank(openSum.getConfValue()) && OpenEnum.parseByValue(openSum.getConfValue()) == OpenEnum.OPEN) {
total = true;
Map<String, Object> sumRow = getSalaryAcctResultService(user).sumRow(queryParam);
sumRow.forEach((k, v) -> {
if (NumberUtils.isCreatable(v.toString())) {
sumRow.put(k, new BigDecimal(v.toString()));
}
});
if (sumRow != null) {
sumRow.forEach((k, v) -> {
if (NumberUtils.isCreatable(v.toString())) {
sumRow.put(k, new BigDecimal(v.toString()));
}
});
}
if (sumRow != null) {
sumRow.put("taxAgentName", "总计");
resultMapList.add(sumRow);

View File

@ -2,7 +2,11 @@ package com.engine.salary.service.impl;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.salaryacct.bo.SalaryAcctFormulaBO;
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.salarysob.bo.SalaryApprovalBO;
@ -11,8 +15,11 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
import com.engine.salary.entity.salarysob.param.ApprovalRequestSaveParam;
import com.engine.salary.entity.salarysob.param.SalaryApprovalQueryParam;
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobPO;
import com.engine.salary.enums.common.FilterEnum;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
import com.engine.salary.mapper.salarysob.SalaryApprovalRuleMapper;
@ -22,18 +29,19 @@ import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.JsonUtil;
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.valid.ValidUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.hrm.User;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -68,6 +76,18 @@ public class SalaryApprovalRuleServiceImpl extends Service implements SalaryAppr
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
}
private SalaryAcctResultService getSalaryAcctResultService(User user) {
return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
}
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
}
private SalarySobBackItemService getSalarySobBackItemService(User user) {
return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
@ -245,4 +265,66 @@ public class SalaryApprovalRuleServiceImpl extends Service implements SalaryAppr
}
return getSalaryApprovalRuleMapper().listSome(SalaryApprovalRulePO.builder().salarySobIds(salarySobIds).build());
}
@Override
public Map<String, Object> sumRow(SalaryAcctResultQueryParam queryParam) {
// 审批信息
SalaryApprovalDTO approvalInfoByRecordId = getApprovalInfoByRecordId(queryParam.getSalaryAcctRecordId());
List<Long> salaryItemIds = new ArrayList<>();
for (SalaryApprovalDTO.approvalItemGroup groupDTO : approvalInfoByRecordId.getApprovalItemGroup()) {
salaryItemIds.addAll(groupDTO.getApprovalItems().stream().map(SalaryApprovalDTO.approvalItem::getSalaryItemId).collect(Collectors.toList()));
}
//其他条件
List<SalaryAcctResultQueryParam.OtherCondition> otherConditions = queryParam.getOtherConditions();
List<SalaryAcctEmployeePO> salaryAcctEmployeePOList = new ArrayList<>();
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(otherConditions)) {
List<Long> items = SalaryEntityUtil.properties(otherConditions, SalaryAcctResultQueryParam.OtherCondition::getItemId, Collectors.toList());
List<SalaryAcctResultPO> list = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(queryParam.getSalaryAcctRecordId()), items);
for (int i = 0; i < otherConditions.size(); i++) {
SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i);
Long itemId = otherCondition.getItemId();
FilterEnum filter = otherCondition.getFilter();
List<String> params = otherCondition.getParams();
list = list.stream().filter(a -> Objects.equals(a.getSalaryItemId(), itemId)).filter(a -> filter.filter(params).test(a.getResultValue())).collect(Collectors.toList());
}
List<Long> salaryAcctEmpId = SalaryEntityUtil.properties(list, SalaryAcctResultPO::getSalaryAcctEmpId, Collectors.toList());
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(salaryAcctEmpId)) {
queryParam.setIds(salaryAcctEmpId);
}
}
// 查询薪资核算人员分页
salaryAcctEmployeePOList = getSalaryAcctEmployeeService(user).listByResultQueryParam(queryParam);
if (org.apache.commons.collections4.CollectionUtils.isEmpty(salaryAcctEmployeePOList)) {
return null;
}
// 查询薪资核算记录
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId());
if (Objects.isNull(salaryAcctRecordPO)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
}
// 查询薪资核算所用薪资账套的薪资项目
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
salarySobItemPOS = salarySobItemPOS.stream().filter(sobItem -> salaryItemIds.contains(sobItem.getSalaryItemId())).collect(Collectors.toList());
Map<Long, SalarySobItemPO> salaryItemIdKeySalarySobItemPOMap = SalaryEntityUtil.convert2Map(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
if (Objects.equals(salaryAcctRecordPO.getBackCalcStatus(), NumberUtils.INTEGER_ONE)) {
// 是回算获取回算项
List<SalarySobBackItemPO> salarySobBackItemPOS = getSalarySobBackItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
salaryItemIds.addAll(salarySobBackItemPOS.stream().map(SalarySobBackItemPO::getSalaryItemId).collect(Collectors.toList()));
}
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds);
// 查询薪资核算结果
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOList, SalaryAcctEmployeePO::getId, Collectors.toList());
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
Map<String, Object> map = new HashMap<>();
Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryItemId);
salaryItemPOS.stream().filter(item -> SalaryDataTypeEnum.NUMBER.getValue().equals(item.getDataType())).forEach(item -> {
BigDecimal sum = Optional.ofNullable(acctResultMap.get(item.getId())).orElse(new ArrayList<>()).stream().map(SalaryAcctResultPO::getResultValue).filter(NumberUtils::isCreatable).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
map.put(item.getId().toString(), SalaryAcctFormulaBO.roundResultValue(sum.toString(), item, Collections.emptyList(), Collections.emptyMap(), salaryItemIdKeySalarySobItemPOMap));
});
return map;
}
}

View File

@ -485,6 +485,11 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
if (salarySendInfo == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在"));
}
if (!Objects.equals(salarySendInfo.getSendStatus(), 1)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在"));
}
Long employeeId = salarySendInfo.getEmployeeId();
if (currentEmployeeId.compareTo(employeeId) != 0) {
@ -1343,7 +1348,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
}
@Override
public Map<String, Object> withdraw(SalarySendWithdrawParam param) {
if (param.getSalarySendId() == null) {

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.util.StrUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrmelog.entity.dto.LoggerContext;
@ -9,6 +10,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobPO;
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
@ -114,15 +116,12 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
// 分页参数
TaxDeclarationPO po = TaxDeclarationPO.builder().build();
LocalDateRange localDateRange = new LocalDateRange();
if (Objects.nonNull(queryParam.getFromSalaryMonth())) {
localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getFromSalaryMonth().atDay(1)));
po.setTaxCycleFromDate(queryParam.getFromSalaryMonth());
}
if (Objects.nonNull(queryParam.getEndSalaryMonth())) {
localDateRange.setEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atEndOfMonth()));
po.setTaxCycleEndDate(queryParam.getEndSalaryMonth());
}
po.setSalaryMonths(localDateRange);
// 分权
Boolean openDevolution = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
@ -138,6 +137,15 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
// 查询个税申报表
List<TaxDeclarationPO> taxDeclarationPOS = getTaxDeclarationMapper().listSome(po);
if (StrUtil.isNotBlank(queryParam.getTaxAgentName())) {
List<TaxAgentPO> taxAgentPOs = getTaxAgentService(user).list(TaxAgentQueryParam.builder().name(queryParam.getTaxAgentName()).build());
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOs, TaxAgentPO::getId);
taxDeclarationPOS = taxDeclarationPOS.stream().filter(tax -> taxAgentIds.contains(tax.getTaxAgentId())).collect(Collectors.toList());
}
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
taxDeclarationPOS, TaxDeclarationPO.class);

View File

@ -1,5 +1,6 @@
package com.engine.salary.util.excel;
import cn.hutool.core.util.StrUtil;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryI18nUtil;
@ -139,8 +140,10 @@ public class ExcelUtil {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
@ -235,8 +238,10 @@ public class ExcelUtil {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
@ -311,8 +316,10 @@ public class ExcelUtil {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
@ -377,8 +384,10 @@ public class ExcelUtil {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof Boolean) {
cell.setCellType(CellType.BOOLEAN);
cell.setCellValue(String.valueOf(o));
@ -458,8 +467,10 @@ public class ExcelUtil {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof Boolean) {
cell.setCellType(CellType.BOOLEAN);
cell.setCellValue(String.valueOf(o));

View File

@ -1,11 +1,13 @@
package com.engine.salary.util.excel;
import cn.hutool.core.util.StrUtil;
import com.engine.salary.component.WeaTableColumnGroup;
import com.engine.salary.util.SalaryDateUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import weaver.wechat.util.Utils;
import java.awt.Color;
import java.math.BigDecimal;
@ -131,10 +133,10 @@ public class ExcelUtilPlus {
for (int i = 0; i < header.size(); i++) {
WeaTableColumnGroup columnGroupItem = (WeaTableColumnGroup) header.get(i);
XSSFCell rowZeroCell = row0.createCell(i, CellType.STRING);
rowZeroCell.setCellValue(columnGroupItem.getText().toString());
rowZeroCell.setCellValue(columnGroupItem.getText());
rowZeroCell.setCellStyle(titleCellStyle);
//设置列宽
sheet.setColumnWidth(i, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
sheet.setColumnWidth(i, Math.min(255, Math.max(12, Utils.null2String(columnGroupItem.getText()).length() * 4)) * 256);
patternList.add(columnGroupItem.getPattern());
}
@ -190,8 +192,10 @@ public class ExcelUtilPlus {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
if (lastRowRed && rowIndex == rowList.size() - 1) {
cell.setCellStyle(numberRedCellStyleMap.get(patternList.get(cellIndex)));
@ -199,8 +203,7 @@ public class ExcelUtilPlus {
cell.setCellStyle(numberCellStyleMap.get(patternList.get(cellIndex)));
}
cell.setCellType(CellType.NUMERIC);
double value = o == null ? 0 : ((BigDecimal) o).doubleValue();
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
cell.setCellValue(((BigDecimal) o).doubleValue());
} else if (o instanceof Boolean) {
cell.setCellType(CellType.BOOLEAN);
cell.setCellValue(String.valueOf(o));
@ -220,6 +223,7 @@ public class ExcelUtilPlus {
}
return workbook;
}
public static XSSFWorkbook genWorkbookV2(List<List<Object>> rowList, String sheetName) {
XSSFWorkbook workbook = new XSSFWorkbook();
@ -280,11 +284,13 @@ public class ExcelUtilPlus {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
cell.setCellValue(((BigDecimal) o).doubleValue());
} else if (o instanceof Boolean) {
cell.setCellType(CellType.BOOLEAN);
cell.setCellValue(String.valueOf(o));
@ -367,8 +373,10 @@ public class ExcelUtilPlus {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof Boolean) {
cell.setCellType(CellType.BOOLEAN);
cell.setCellValue(String.valueOf(o));
@ -476,11 +484,13 @@ public class ExcelUtilPlus {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());
cell.setCellValue(((BigDecimal) o).doubleValue());
} else if (o instanceof Boolean) {
cell.setCellType(CellType.BOOLEAN);
cell.setCellValue(String.valueOf(o));
@ -674,8 +684,10 @@ public class ExcelUtilPlus {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
if (lastRowRed && rowIndex == rowList.size() - 1) {
cell.setCellStyle(numberRedCellStyleMap.get(patternList.get(cellIndex)));
@ -839,8 +851,10 @@ public class ExcelUtilPlus {
}
Object o = infoList.get(cellIndex);
if (o instanceof String) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
if (StrUtil.isNotBlank(String.valueOf(o))) {
cell.setCellType(CellType.STRING);
cell.setCellValue(String.valueOf(o));
}
} else if (o instanceof BigDecimal) {
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(o == null ? 0 : ((BigDecimal) o).doubleValue());

View File

@ -250,7 +250,9 @@ public class ValidUtil {
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION");
.replace("", "UNION")
.replace("", "substr")
.replace("", "SUBSTR");
}
setValue(t, field.getName(), result);
} else if (valueTypeEnum == ValueTypeEnum.OBJECT) {

View File

@ -652,6 +652,21 @@ public class SalarySobController {
return new ResponseResult<SalaryAcctResultQueryParam, Map<String, Object>>(user).run(getSalaryApprovalWrapper(user)::listSalaryApprovalAcctResult, param);
}
/**
* 获取审批时薪资核算结果合计行
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/salaryApproval/acctresult/sum")
@Produces(MediaType.APPLICATION_JSON)
public String sumSalaryApprovalAcctResult(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultQueryParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryAcctResultQueryParam, Map<String, Object>>(user).run(getSalaryApprovalWrapper(user)::sumSalaryApprovalAcctResult, param);
}
/**
* 保存审批流程id
* @param request

View File

@ -31,7 +31,6 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.time.LocalDate;
@ -58,10 +57,8 @@ public class TaxDeclarationController {
@POST
@Path("/list")
@Produces(MediaType.APPLICATION_JSON)
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException {
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationListQueryParam queryParam){
User user = HrmUserVarify.getUser(request, response);
queryParam.setFromSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getFromSalaryMonthStr() == null ? "" : queryParam.getFromSalaryMonthStr()));
queryParam.setEndSalaryMonth(SalaryDateUtil.String2YearMonth(queryParam.getEndSalaryMonthStr() == null ? "" : queryParam.getEndSalaryMonthStr()));
return new ResponseResult<TaxDeclarationListQueryParam, PageInfo<TaxDeclarationListDTO>>(user).run(getTaxDeclarationWrapper(user)::listPage, queryParam);
}

View File

@ -80,6 +80,10 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
}
private SalaryAcctSobConfigService getSalaryAcctSobConfigService(User user) {
return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user);
}
@ -89,9 +93,6 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
}
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);

View File

@ -165,4 +165,13 @@ public class SalaryApprovalWrapper extends Service {
public void saveApprovalRequestId(ApprovalRequestSaveParam saveParam) {
getSalaryApprovalRuleService(user).saveApprovalRequestId(saveParam);
}
public Map<String, Object> sumSalaryApprovalAcctResult(SalaryAcctResultQueryParam queryParam) {
ValidUtil.doValidator(queryParam);
Map<String, Object> datas = new HashMap<>();
Map<String, Object> sumRow = getSalaryApprovalRuleService(user).sumRow(queryParam);
datas.put("sumRow", sumRow);
return datas;
}
}

View File

@ -97,7 +97,10 @@ public class SalarySobRangeWrapper extends Service {
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION"));
.replace("", "UNION")
.replace("", "substr")
.replace("", "SUBSTR")
);
}
});
@ -127,7 +130,10 @@ public class SalarySobRangeWrapper extends Service {
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION"));
.replace("", "UNION")
.replace("", "substr")
.replace("", "SUBSTR")
);
}
});

View File

@ -365,7 +365,10 @@ public class TaxAgentWrapper extends Service {
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION"));
.replace("", "UNION")
.replace("", "substr")
.replace("", "SUBSTR")
);
}
});
@ -399,7 +402,10 @@ public class TaxAgentWrapper extends Service {
.replace("", "between")
.replace("", "BETWEEN")
.replace("", "union")
.replace("", "UNION"));
.replace("", "UNION")
.replace("", "substr")
.replace("", "SUBSTR")
);
}
});