操作日志
This commit is contained in:
parent
3a0646df9c
commit
a8bfe83030
|
|
@ -12,8 +12,8 @@ import org.apache.ibatis.session.SqlSession;
|
|||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AddUpDeductionBiz extends BaseBean {
|
||||
|
||||
|
|
@ -145,67 +145,7 @@ public class AddUpDeductionBiz extends BaseBean {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理导入数据
|
||||
*
|
||||
* @param pos
|
||||
*/
|
||||
public void handleImportData(List<AddUpDeduction> pos) {
|
||||
if (CollectionUtils.isEmpty(pos)) {
|
||||
return;
|
||||
}
|
||||
AddUpDeduction po = pos.get(0);
|
||||
// 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos);
|
||||
// 去重(通过记录的唯一条件(申报月份,人员id,个税扣缴义务人id)拼接)
|
||||
List<AddUpDeduction> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new));
|
||||
// 查询已有数据
|
||||
List<AddUpDeduction> list = listSome(AddUpDeduction.builder().declareMonth(po.getDeclareMonth()).build());
|
||||
// 待修改的 本地已存在则更新【交集】
|
||||
List<AddUpDeduction> updateList = list.stream().map(m -> {
|
||||
Optional<AddUpDeduction> optional = finalPos.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
AddUpDeduction temp = null;
|
||||
if (optional.isPresent()) {
|
||||
temp = optional.get();
|
||||
// 换成本地库的id
|
||||
temp.setId(m.getId());
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
// 待新增的 导入比本地多,则新增【差集(导入 - local)】
|
||||
List<AddUpDeduction> saveList = finalPos.stream().map(m -> {
|
||||
Optional<AddUpDeduction> optional = list.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
AddUpDeduction temp = null;
|
||||
if (!optional.isPresent()) {
|
||||
temp = m;
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
|
||||
// 修改
|
||||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
batchUpdate(updateList);
|
||||
}
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
batchSave(saveList);
|
||||
}
|
||||
// 记录操作日志
|
||||
// saveList.addAll(updateList);
|
||||
//
|
||||
// if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
// LoggerContext loggerContext = new LoggerContext();
|
||||
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setNewValueList(saveList);
|
||||
// loggerContext.setTenant_key(message.getTenantKey());
|
||||
// loggerContext.setOperator(message.getUserId().toString());
|
||||
// loggerContext.setOperatorName(message.getOpreator());
|
||||
// loggerContext.setClientIp(message.getClientIp());
|
||||
// addUpDeductionLoggerTemplate.write(loggerContext);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public void batchDeleteByIDS(List<Long> ids) {
|
||||
|
|
|
|||
|
|
@ -185,22 +185,6 @@ public class AddUpSituationBiz extends BaseBean {
|
|||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
batchSave(saveList);
|
||||
}
|
||||
// 记录操作日志
|
||||
// saveList.addAll(updateList);
|
||||
//
|
||||
// if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
// LoggerContext loggerContext = new LoggerContext();
|
||||
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setNewValueList(saveList);
|
||||
// loggerContext.setTenant_key(message.getTenantKey());
|
||||
// loggerContext.setOperator(message.getUserId().toString());
|
||||
// loggerContext.setOperatorName(message.getOpreator());
|
||||
// loggerContext.setClientIp(message.getClientIp());
|
||||
// AddUpSituationLoggerTemplate.write(loggerContext);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -169,22 +169,6 @@ public class OtherDeductionBiz extends BaseBean {
|
|||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
batchSave(saveList);
|
||||
}
|
||||
// 记录操作日志
|
||||
// saveList.addAll(updateList);
|
||||
//
|
||||
// if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
// LoggerContext loggerContext = new LoggerContext();
|
||||
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(message.getTenantKey(), message.getUserId(), 100351, "导入累计专项附加扣除"));
|
||||
// loggerContext.setNewValueList(saveList);
|
||||
// loggerContext.setTenant_key(message.getTenantKey());
|
||||
// loggerContext.setOperator(message.getUserId().toString());
|
||||
// loggerContext.setOperatorName(message.getOpreator());
|
||||
// loggerContext.setClientIp(message.getClientIp());
|
||||
// addUpDeductionLoggerTemplate.write(loggerContext);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,289 +18,219 @@ public class SalaryElogConfig {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate taxRateLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "taxrate");
|
||||
}
|
||||
public final static LoggerTemplate taxRateLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxrate");
|
||||
|
||||
/**
|
||||
* 薪资项目
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salaryItemLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salaryitem");
|
||||
}
|
||||
public static LoggerTemplate salaryItemLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salaryitem");
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate taxAgentLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "taxagent");
|
||||
}
|
||||
public static LoggerTemplate taxAgentLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxagent");
|
||||
|
||||
public static LoggerTemplate siCategoryLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "siCategory");
|
||||
}
|
||||
public static LoggerTemplate siCategoryLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siCategory");
|
||||
|
||||
public static LoggerTemplate siSchemeLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "siScheme");
|
||||
}
|
||||
public static LoggerTemplate siSchemeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siScheme");
|
||||
|
||||
public static LoggerTemplate totalSchemeLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "totalScheme");
|
||||
}
|
||||
public static LoggerTemplate totalSchemeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "totalScheme");
|
||||
|
||||
/**
|
||||
* 累计情况
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate addUpSituationLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "addupsituation");
|
||||
}
|
||||
public static LoggerTemplate addUpSituationLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "addupsituation");
|
||||
|
||||
/**
|
||||
* 累计专项附加扣除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate addUpDeductionLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "addupdeduction");
|
||||
}
|
||||
public static LoggerTemplate addUpDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "addupdeduction");
|
||||
|
||||
/**
|
||||
* 其他免税扣除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate otherDeductionLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "otherdeduction");
|
||||
}
|
||||
public static LoggerTemplate otherDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "otherdeduction");
|
||||
|
||||
/**
|
||||
* 减税
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate derateDeductionLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "deratededuction");
|
||||
}
|
||||
public static LoggerTemplate derateDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "deratededuction");
|
||||
|
||||
/**
|
||||
* 税延养老保险
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate endowmentInsuranceLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "endowmentinsurance");
|
||||
}
|
||||
public static LoggerTemplate endowmentInsuranceLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "endowmentinsurance");
|
||||
|
||||
/**
|
||||
* 税延养老保险
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate freeIncomeLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "freeincome");
|
||||
}
|
||||
public static LoggerTemplate freeIncomeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "freeincome");
|
||||
|
||||
/**
|
||||
* 捐赠免税
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate grantDonationLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "grantdonation");
|
||||
}
|
||||
public static LoggerTemplate grantDonationLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "grantdonation");
|
||||
|
||||
/**
|
||||
* 捐赠免税
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate healthInsuranceLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "healthinsurance");
|
||||
}
|
||||
public static LoggerTemplate healthInsuranceLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "healthinsurance");
|
||||
|
||||
/**
|
||||
* 其他免税扣除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate otherDerateDeductionLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "otherderatededuction");
|
||||
}
|
||||
public static LoggerTemplate otherDerateDeductionLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "otherderatededuction");
|
||||
|
||||
/**
|
||||
* 考勤引用
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate attendQuoteLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "attendquote");
|
||||
}
|
||||
public static LoggerTemplate attendQuoteLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "attendquote");
|
||||
|
||||
/**
|
||||
* 考勤引用字段管理
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate attendQuoteFieldLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "attendfield");
|
||||
}
|
||||
public static LoggerTemplate attendQuoteFieldLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "attendfield");
|
||||
|
||||
/**
|
||||
* 考勤引用字段设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate attendQuoteFieldSettingLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "attendfieldset");
|
||||
}
|
||||
public static LoggerTemplate attendQuoteFieldSettingLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "attendfieldset");
|
||||
|
||||
/**
|
||||
* 薪资账套
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salarySobLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salarysob");
|
||||
}
|
||||
public static LoggerTemplate salarySobLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarysob");
|
||||
|
||||
/**
|
||||
* 薪资核算
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salaryAcctRecordLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "acctrecord");
|
||||
}
|
||||
|
||||
public static LoggerTemplate salaryAcctRecordLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "acctrecord");
|
||||
/**
|
||||
* 个税申报表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate taxDeclarationLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "taxdecla");
|
||||
}
|
||||
public static LoggerTemplate taxDeclarationLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxdecla");
|
||||
|
||||
/**
|
||||
* 福利档案
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate siArchivesLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "siarchives");
|
||||
}
|
||||
public static LoggerTemplate siArchivesLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siarchives");
|
||||
|
||||
/**
|
||||
* 社保规则
|
||||
*/
|
||||
public static LoggerTemplate archiveRuleLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "archiverule");
|
||||
}
|
||||
public static LoggerTemplate archiveRuleLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "archiverule");
|
||||
|
||||
/**
|
||||
* 代缴机构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate paymentAgencyLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "paymentagency");
|
||||
}
|
||||
public static LoggerTemplate paymentAgencyLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "paymentagency");
|
||||
|
||||
/**
|
||||
* 福利核算
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate siAccountLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "siaccount");
|
||||
}
|
||||
public static LoggerTemplate siAccountLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "siaccount");
|
||||
|
||||
/**
|
||||
* 工资单模板
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salaryTemplateLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salarytemplate");
|
||||
}
|
||||
public static LoggerTemplate salaryTemplateLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarytemplate");
|
||||
|
||||
/**
|
||||
* 工资单发放
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salarySendLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salarysend");
|
||||
}
|
||||
public static LoggerTemplate salarySendLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarysend");
|
||||
|
||||
/**
|
||||
* 外部人员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate extEmployeeLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "extemployee");
|
||||
}
|
||||
public static LoggerTemplate extEmployeeLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "extemployee");
|
||||
|
||||
/**
|
||||
* 薪资档案
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salaryArchiveLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salaryarchive");
|
||||
}
|
||||
public static LoggerTemplate salaryArchiveLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salaryarchive");
|
||||
|
||||
/**
|
||||
* 薪资档案-字段
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salaryArchiveFieldLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salarcfield");
|
||||
}
|
||||
|
||||
public static LoggerTemplate salaryArchiveFieldLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarcfield");
|
||||
/**
|
||||
* 薪资档案-薪资项目调整
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salaryArchiveItemAdjustLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salarcitemadj");
|
||||
}
|
||||
public static LoggerTemplate salaryArchiveItemAdjustLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarcitemadj");
|
||||
|
||||
/**
|
||||
* 薪资档案-批量调薪
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate salaryArchiveBatchAdjustLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "salarcbatadj");
|
||||
}
|
||||
public static LoggerTemplate salaryArchiveBatchAdjustLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "salarcbatadj");
|
||||
|
||||
/**
|
||||
* 自定义业务数据设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate customDataSetLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "customdataset");
|
||||
}
|
||||
public static LoggerTemplate customDataSetLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "customdataset");
|
||||
|
||||
/**
|
||||
* 自定义业务数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate customDataLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "customdata");
|
||||
}
|
||||
public static LoggerTemplate customDataLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "customdata");
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -308,63 +238,49 @@ public class SalaryElogConfig {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate employeeDeclareLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "empdeclare");
|
||||
}
|
||||
public static LoggerTemplate employeeDeclareLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "empdeclare");
|
||||
|
||||
/**
|
||||
* 单位扣款账号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate withholdAccountLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "whaccount");
|
||||
}
|
||||
public static LoggerTemplate withholdAccountLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "whaccount");
|
||||
|
||||
/**
|
||||
* 银行报盘
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate bankOfferLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "bankoffer");
|
||||
}
|
||||
public static LoggerTemplate bankOfferLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "bankoffer");
|
||||
|
||||
/**
|
||||
* 银行报盘模板
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate bankOfferTemplateLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "botemplate");
|
||||
}
|
||||
public static LoggerTemplate bankOfferTemplateLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "botemplate");
|
||||
|
||||
/**
|
||||
* 薪酬体系标准(岗薪制)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate postSalaryLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "postsalary");
|
||||
}
|
||||
public static LoggerTemplate postSalaryLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "postsalary");
|
||||
|
||||
/**
|
||||
* 银行报盘模板
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate taxFreeDetailLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "taxfreedetail");
|
||||
}
|
||||
public static LoggerTemplate taxFreeDetailLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "taxfreedetail");
|
||||
|
||||
/**
|
||||
* 最优年终奖计税方案
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate annualBonusPlanLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "annualplan");
|
||||
}
|
||||
public static LoggerTemplate annualBonusPlanLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "annualplan");
|
||||
|
||||
/**
|
||||
* 最优年终奖计税方案-累计情况
|
||||
|
|
@ -372,7 +288,5 @@ public class SalaryElogConfig {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public static LoggerTemplate annualBonusLoggerTemplate() {
|
||||
return LoggerTemplateBuilder.build("hrsa", "annualbonus");
|
||||
}
|
||||
public static LoggerTemplate annualBonusLoggerTemplate = LoggerTemplateBuilder.build("hrsa", "annualbonus");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.AddUpDeductionBiz;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
|
|
@ -27,6 +29,7 @@ import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
|||
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -385,7 +388,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
}
|
||||
}
|
||||
//入库
|
||||
addUpDeductionBiz.handleImportData(eligibleData);
|
||||
handleImportData(eligibleData);
|
||||
apidatas.put("successCount", successCount);
|
||||
apidatas.put("errorCount", errorCount);
|
||||
apidatas.put("errorData", errorData);
|
||||
|
|
@ -396,6 +399,60 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return apidatas;
|
||||
}
|
||||
|
||||
public void handleImportData(List<AddUpDeduction> pos) {
|
||||
if (CollectionUtils.isEmpty(pos)) {
|
||||
return;
|
||||
}
|
||||
AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz();
|
||||
AddUpDeduction po = pos.get(0);
|
||||
// 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos);
|
||||
// 去重(通过记录的唯一条件(申报月份,人员id,个税扣缴义务人id)拼接)
|
||||
List<AddUpDeduction> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new));
|
||||
// 查询已有数据
|
||||
List<AddUpDeduction> list = addUpDeductionBiz.listSome(AddUpDeduction.builder().declareMonth(po.getDeclareMonth()).build());
|
||||
// 待修改的 本地已存在则更新【交集】
|
||||
List<AddUpDeduction> updateList = list.stream().map(m -> {
|
||||
Optional<AddUpDeduction> optional = finalPos.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
AddUpDeduction temp = null;
|
||||
if (optional.isPresent()) {
|
||||
temp = optional.get();
|
||||
// 换成本地库的id
|
||||
temp.setId(m.getId());
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
// 待新增的 导入比本地多,则新增【差集(导入 - local)】
|
||||
List<AddUpDeduction> saveList = finalPos.stream().map(m -> {
|
||||
Optional<AddUpDeduction> optional = list.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
AddUpDeduction temp = null;
|
||||
if (!optional.isPresent()) {
|
||||
temp = m;
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
|
||||
// 修改
|
||||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
addUpDeductionBiz.batchUpdate(updateList);
|
||||
}
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
addUpDeductionBiz.batchSave(saveList);
|
||||
}
|
||||
// 记录操作日志
|
||||
saveList.addAll(updateList);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setNewValueList(saveList);
|
||||
SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editAddUpDeduction(AddUpDeductionRecordParam addUpDeduction) {
|
||||
|
|
@ -529,7 +586,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
addUpDeduction.setAddUpInfantCare(Util.null2String(addUpDeductionRecordParam.getAddUpInfantCare()));
|
||||
insertData.add(addUpDeduction);
|
||||
//入库
|
||||
addUpDeductionBiz.handleImportData(insertData);
|
||||
handleImportData(insertData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.AddUpSituationBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
|
|
@ -20,6 +22,7 @@ import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
|
||||
|
|
@ -274,7 +277,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
// excel标题
|
||||
final List<String> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用",
|
||||
"累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人",
|
||||
"累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护","累计个人养老金");
|
||||
"累计大病医疗", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金");
|
||||
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
|
|
@ -340,7 +343,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
//excel标题
|
||||
List<String> title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", "累计社保个人合计",
|
||||
"累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计企业(职业)年金及其他福利",
|
||||
"累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护","累计个人养老金");
|
||||
"累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", "累计已预扣预缴税额", "累计婴幼儿照护", "累计个人养老金");
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
||||
//查询详细信息
|
||||
|
|
@ -609,7 +612,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
// 获取已经核算的数据(获取税款所属期下一个月的数据)
|
||||
YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr);
|
||||
String nextTaxYearMonthStr = taxYearMonthStr;
|
||||
if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){
|
||||
if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) {
|
||||
nextTaxYearMonth = nextTaxYearMonth.plusMonths(1);
|
||||
nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER);
|
||||
}
|
||||
|
|
@ -693,7 +696,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工");
|
||||
errorData.add(errorMessageMap);
|
||||
errorSum += 1;
|
||||
}else {
|
||||
} else {
|
||||
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0).getEmployeeId() : null;
|
||||
po.setEmployeeId(employeeId);
|
||||
}
|
||||
|
|
@ -744,7 +747,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
// }
|
||||
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12") ) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId())).findFirst();
|
||||
boolean isExist = list.stream().anyMatch(f -> f.getEmployeeId().equals(po.getEmployeeId()) && f.getTaxAgentId().equals(po.getTaxAgentId()));
|
||||
if (optionalAcctEmp.isPresent() && isExist) {
|
||||
|
|
@ -815,7 +818,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
}
|
||||
|
||||
//入库
|
||||
biz.handleImportData(eligibleData);
|
||||
handleImportData(eligibleData);
|
||||
|
||||
apidatas.put("successCount", successCount);
|
||||
apidatas.put("errorCount", errorCount);
|
||||
|
|
@ -827,6 +830,61 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
return apidatas;
|
||||
}
|
||||
|
||||
public void handleImportData(List<AddUpSituation> pos) {
|
||||
if (CollectionUtils.isEmpty(pos)) {
|
||||
return;
|
||||
}
|
||||
AddUpSituationBiz biz = new AddUpSituationBiz();
|
||||
AddUpSituation po = pos.get(0);
|
||||
// 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos);
|
||||
// 去重(通过记录的唯一条件(申报月份,人员id,个税扣缴义务人id)拼接)
|
||||
List<AddUpSituation> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new));
|
||||
// 查询已有数据
|
||||
List<AddUpSituation> list = biz.listSome(AddUpSituation.builder().taxYearMonth(po.getTaxYearMonth()).build());
|
||||
// 待修改的 本地已存在则更新【交集】
|
||||
List<AddUpSituation> updateList = list.stream().map(m -> {
|
||||
Optional<AddUpSituation> optional = finalPos.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
AddUpSituation temp = null;
|
||||
if (optional.isPresent()) {
|
||||
temp = optional.get();
|
||||
// 换成本地库的id
|
||||
temp.setId(m.getId());
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
// 待新增的 导入比本地多,则新增【差集(导入 - local)】
|
||||
List<AddUpSituation> saveList = finalPos.stream().map(m -> {
|
||||
Optional<AddUpSituation> optional = list.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
AddUpSituation temp = null;
|
||||
if (!optional.isPresent()) {
|
||||
temp = m;
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
|
||||
// 修改
|
||||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
biz.batchUpdate(updateList);
|
||||
}
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
batchSave(saveList);
|
||||
}
|
||||
// 记录操作日志
|
||||
saveList.addAll(updateList);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setNewValueList(saveList);
|
||||
SalaryElogConfig.addUpSituationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void checkImportParam(AddUpSituationImportParam importParam) {
|
||||
|
||||
|
|
@ -846,8 +904,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
}
|
||||
|
||||
/**
|
||||
* @description 编辑数据
|
||||
* @return void
|
||||
* @description 编辑数据
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/27 21:32
|
||||
*/
|
||||
|
|
@ -860,12 +918,12 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
// 获取所有个税扣缴义务人
|
||||
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
|
||||
AddUpSituation byId = biz.getById(addUpSituationParam.getId());
|
||||
if(byId == null){
|
||||
if (byId == null) {
|
||||
throw new SalaryRunTimeException("该数据不存在!");
|
||||
}
|
||||
Long taxAgentId = byId.getTaxAgentId();
|
||||
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId() , taxAgentId));
|
||||
if(!canEdit){
|
||||
boolean canEdit = taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), taxAgentId));
|
||||
if (!canEdit) {
|
||||
//没有编辑权限
|
||||
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");
|
||||
}
|
||||
|
|
@ -873,14 +931,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
// 获取已经核算的数据(获取税款所属期下一个月的数据)
|
||||
YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr);
|
||||
String nextTaxYearMonthStr = taxYearMonthStr;
|
||||
if( !Objects.equals(nextTaxYearMonth.getMonthValue(),12) ){
|
||||
if (!Objects.equals(nextTaxYearMonth.getMonthValue(), 12)) {
|
||||
nextTaxYearMonth = nextTaxYearMonth.plusMonths(1);
|
||||
nextTaxYearMonthStr = nextTaxYearMonth.format(SalaryDateUtil.MONTH_FORMATTER);
|
||||
}
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeDataByTaxYearMonth(nextTaxYearMonthStr);
|
||||
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees) && !Objects.equals(taxYearMonthStr.split("-")[1], "12")) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpSituationParam.getEmployeeId()) && f.getTaxAgentId().equals(addUpSituationParam.getTaxAgentId())).findFirst();
|
||||
if (optionalAcctEmp.isPresent()) {
|
||||
throw new SalaryRunTimeException("该年月这条数据已经核算过,不可进行编辑!");
|
||||
|
|
@ -903,8 +961,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
}
|
||||
|
||||
/**
|
||||
* @description 新建数据
|
||||
* @return void
|
||||
* @description 新建数据
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/27 22:04
|
||||
*/
|
||||
|
|
@ -947,8 +1005,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
|
||||
|
||||
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
|
||||
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId() , addUpSituationParam.getEmployeeId()));
|
||||
if(!employeeSameId){
|
||||
boolean employeeSameId = employees.stream().anyMatch(e -> Objects.equals(e.getEmployeeId(), addUpSituationParam.getEmployeeId()));
|
||||
if (!employeeSameId) {
|
||||
throw new SalaryRunTimeException("员工信息不存在");
|
||||
}
|
||||
po.setEmployeeId(addUpSituationParam.getEmployeeId());
|
||||
|
|
@ -967,7 +1025,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
}
|
||||
}
|
||||
|
||||
// fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常
|
||||
// fixme 分权判断,若员工离职后,不在扣缴义务人范围内,会有异常
|
||||
// if (openDevolution) {
|
||||
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(po.getEmployeeId())).findFirst();
|
||||
// if (!optionalTaxAgentEmp.isPresent()) {
|
||||
|
|
@ -1036,7 +1094,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
insertList.add(po);
|
||||
|
||||
//入库
|
||||
biz.handleImportData(insertList);
|
||||
handleImportData(insertList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1055,15 +1113,15 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||
// 判断是否有核算过
|
||||
List<Long> deleteList = new ArrayList<>();
|
||||
for(int i=0; i<deleteIds.size(); i++){
|
||||
for (int i = 0; i < deleteIds.size(); i++) {
|
||||
Long id = deleteIds.get(i);
|
||||
AddUpSituation byId = biz.getById(id);
|
||||
if(byId == null){
|
||||
if (byId == null) {
|
||||
throw new SalaryRunTimeException("数据不存在或已被删除!");
|
||||
}
|
||||
// 判断是否在个税扣缴义务人范围内
|
||||
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId() , byId.getTaxAgentId())).findFirst();
|
||||
if(!first.isPresent()){
|
||||
Optional<TaxAgentManageRangeEmployeeDTO> first = taxAgentList.stream().filter(m -> Objects.equals(m.getTaxAgentId(), byId.getTaxAgentId())).findFirst();
|
||||
if (!first.isPresent()) {
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
||||
}
|
||||
// 判断用户是否存在
|
||||
|
|
@ -1089,23 +1147,23 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
AddUpSituationBiz biz = new AddUpSituationBiz();
|
||||
Date declareMonthDate = new Date();
|
||||
try {
|
||||
declareMonthDate = (sdf.parse(declareMonthStr+"-01"));
|
||||
}catch (Exception e){
|
||||
declareMonthDate = (sdf.parse(declareMonthStr + "-01"));
|
||||
} catch (Exception e) {
|
||||
throw new SalaryRunTimeException("日期异常");
|
||||
}
|
||||
AddUpSituation queryParam = null;
|
||||
|
||||
if(deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()){
|
||||
if (deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()) {
|
||||
// 设置了个税扣缴义务人
|
||||
Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId());
|
||||
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId));
|
||||
if(!canDelete){
|
||||
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t, taxAgentId));
|
||||
if (!canDelete) {
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内!");
|
||||
}
|
||||
ArrayList<Long> tai = new ArrayList<>();
|
||||
tai.add(taxAgentId);
|
||||
queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build();
|
||||
}else {
|
||||
queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(tai).build();
|
||||
} else {
|
||||
queryParam = AddUpSituation.builder().taxYearMonth(declareMonthDate).taxAgentIds(taxAgentIds).build();
|
||||
}
|
||||
|
||||
|
|
@ -1115,7 +1173,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> employees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||
for(AddUpSituation item : list){
|
||||
for (AddUpSituation item : list) {
|
||||
if (CollectionUtils.isNotEmpty(employees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
||||
if (optionalAcctEmp.isPresent()) {
|
||||
|
|
@ -1137,11 +1195,11 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
ids.add(addUpSituationParam.getId());
|
||||
AddUpSituationQueryParam build = AddUpSituationQueryParam.builder().ids(ids).build();
|
||||
List<AddUpSituationRecordDTO> list = biz.recordList(build);
|
||||
if(list == null || list.size()==0){
|
||||
if (list == null || list.size() == 0) {
|
||||
throw new SalaryRunTimeException("该数据不存在!");
|
||||
}
|
||||
String taxAgentName = list.get(0).getTaxAgentName();
|
||||
if(!taxAgentNames.contains(taxAgentName)){
|
||||
if (!taxAgentNames.contains(taxAgentName)) {
|
||||
throw new SalaryRunTimeException("您无权查看该数据!");
|
||||
}
|
||||
return list.get(0);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ import com.api.formmode.mybatis.util.SqlProxyHandle;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.OtherDeductionBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO;
|
||||
|
|
@ -15,6 +17,7 @@ import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
|
||||
|
|
@ -370,6 +373,66 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
return apidatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理导入数据
|
||||
*
|
||||
* @param pos
|
||||
*/
|
||||
public void handleImportData(List<OtherDeductionPO> pos) {
|
||||
if (CollectionUtils.isEmpty(pos)) {
|
||||
return;
|
||||
}
|
||||
OtherDeductionBiz otherDeductionBiz = new OtherDeductionBiz();
|
||||
OtherDeductionPO po = pos.get(0);
|
||||
// 多条相同人的则以第一条为准,如果逆序排列(用于重复的则以最后一条为准)Collections.reverse(pos);
|
||||
// 去重(通过记录的唯一条件(申报月份,人员id,个税扣缴义务人id)拼接)
|
||||
List<OtherDeductionPO> finalPos = pos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getEmployeeId() + "-" + f.getTaxAgentId()))), ArrayList::new));
|
||||
// 查询已有数据
|
||||
List<OtherDeductionPO> list = otherDeductionBiz.listSome(OtherDeductionPO.builder().declareMonth(po.getDeclareMonth()).build());
|
||||
// 待修改的 本地已存在则更新【交集】
|
||||
List<OtherDeductionPO> updateList = list.stream().map(m -> {
|
||||
Optional<OtherDeductionPO> optional = finalPos.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
OtherDeductionPO temp = null;
|
||||
if (optional.isPresent()) {
|
||||
temp = optional.get();
|
||||
// 换成本地库的id
|
||||
temp.setId(m.getId());
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
// 待新增的 导入比本地多,则新增【差集(导入 - local)】
|
||||
List<OtherDeductionPO> saveList = finalPos.stream().map(m -> {
|
||||
Optional<OtherDeductionPO> optional = list.stream().filter(p -> (p.getEmployeeId() + "-" + p.getTaxAgentId()).equals(m.getEmployeeId() + "-" + m.getTaxAgentId())).findFirst();
|
||||
OtherDeductionPO temp = null;
|
||||
if (!optional.isPresent()) {
|
||||
temp = m;
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
|
||||
// 修改
|
||||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
otherDeductionBiz.batchUpdate(updateList);
|
||||
}
|
||||
// 保存
|
||||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
otherDeductionBiz.batchSave(saveList);
|
||||
}
|
||||
// 记录操作日志
|
||||
saveList.addAll(updateList);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(saveList)) {
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel( 100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 100351, "新增计专项附加扣除"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 100351, "新增累计专项附加扣除"));
|
||||
loggerContext.setNewValueList(saveList);
|
||||
SalaryElogConfig.addUpDeductionLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkImportParam(OtherDeductionImportParam importParam) {
|
||||
//excel文件id
|
||||
String imageId = Util.null2String(importParam.getImageId());
|
||||
|
|
@ -513,7 +576,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
*/
|
||||
private List<List<String>> getExcelRowDetailList(OtherDeductionQueryParam param) {
|
||||
//excel标题
|
||||
List<String> title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额","个人养老金");
|
||||
List<String> title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金");
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
|
||||
//查询详细信息
|
||||
|
|
@ -676,7 +739,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
}
|
||||
insertData.add(po);
|
||||
//入库
|
||||
OtherDeductionBiz.handleImportData(insertData);
|
||||
handleImportData(insertData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.util.LoggerTemplate;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO;
|
||||
|
|
@ -55,7 +54,6 @@ import java.util.stream.Collectors;
|
|||
**/
|
||||
@Slf4j
|
||||
public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcctEmployeeService {
|
||||
private final LoggerTemplate salaryAcctRecordLoggerTemplate = SalaryElogConfig.salaryAcctRecordLoggerTemplate();
|
||||
|
||||
private SalaryAcctEmployeeMapper getSalaryAcctEmployeeMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryAcctEmployeeMapper.class);
|
||||
|
|
@ -403,7 +401,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98837, "添加薪资核算人员"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98837, "添加薪资核算人员") + ":" + targetName);
|
||||
loggerContext.setNewValueList(salaryAcctEmployeePOS);
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -470,7 +468,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98835, "删除薪资核算人员"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98835, "删除薪资核算人员") + ":" + targetName);
|
||||
loggerContext.setOldValueList(salaryAcctEmployeePOS);
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import com.engine.salary.config.SalaryElogConfig;
|
|||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.constant.SalaryItemConstant;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.util.LoggerTemplate;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO;
|
||||
|
|
@ -46,6 +45,7 @@ import com.engine.salary.util.JsonUtil;
|
|||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
|
|
@ -55,7 +55,6 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.wbi.util.Util;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
|
|
@ -87,7 +86,6 @@ import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
|||
**/
|
||||
@Slf4j
|
||||
public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExcelService {
|
||||
private final LoggerTemplate salaryAcctRecordLoggerTemplate = SalaryElogConfig.salaryAcctRecordLoggerTemplate();
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
|
|
@ -259,7 +257,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98837, "导出环比增加人员"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98837, "导出环比增加人员") + ":" + targetName);
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
|
||||
return ExcelUtilPlus.genWorkbookV2(rows, sheetName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.util.LoggerTemplate;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||
|
|
@ -52,7 +51,6 @@ import java.util.stream.Collectors;
|
|||
* @version 1.0
|
||||
**/
|
||||
public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRecordService {
|
||||
private final LoggerTemplate salaryAcctRecordLoggerTemplate = SalaryElogConfig.salaryAcctRecordLoggerTemplate();
|
||||
|
||||
private SalaryAcctRecordMapper getSalaryAcctRecordMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryAcctRecordMapper.class);
|
||||
|
|
@ -309,7 +307,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98768, "新建薪资核算"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98768, "新建薪资核算") + ": " + targetName);
|
||||
loggerContext.setNewValues(salaryAcctRecordPO);
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
// 返回薪资核算记录id
|
||||
return salaryAcctRecordPO.getId();
|
||||
}
|
||||
|
|
@ -543,7 +541,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98821, "删除薪资核算"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98821, "删除薪资核算") + ":" + targetName);
|
||||
loggerContext.setNewValues(salaryAcctRecordPO);
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -585,7 +583,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98817, "薪资核算归档"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98817, "薪资核算归档") + ": " + targetName);
|
||||
loggerContext.setNewValues(salaryAcctRecordPO);
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -635,7 +633,7 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98820, "重新核算"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98820, "重新核算") + ": " + targetName);
|
||||
loggerContext.setNewValues(salaryAcctRecordPO);
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ import java.util.stream.Collectors;
|
|||
**/
|
||||
@Slf4j
|
||||
public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctResultService {
|
||||
private final LoggerTemplate salaryAcctRecordLoggerTemplate = SalaryElogConfig.salaryAcctRecordLoggerTemplate();
|
||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||
|
||||
private SalaryAcctResultMapper getSalaryAcctResultMapper() {
|
||||
|
|
@ -665,7 +664,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(95783, "编辑薪资核算结果") + ": " + operateDesc);
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(95783, "编辑薪资核算结果") + ": " + operateDesc);
|
||||
loggerContext.setNewValueList(Lists.newArrayList(salaryAcctResultPOS));
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -869,7 +868,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(95783, "薪资核算"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(95783, "薪资核算"));
|
||||
salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
} catch (Exception e) {
|
||||
log.info("薪资核算出错:{}", e.getMessage(), e);
|
||||
// throw new SalaryRunTimeException(e);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.engine.salary.biz.SalaryItemBiz;
|
|||
import com.engine.salary.biz.SysSalaryItemBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.util.LoggerTemplate;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaPO;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.entity.salaryitem.bo.SalaryItemBO;
|
||||
|
|
@ -80,9 +79,6 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private LoggerTemplate salaryItemLoggerTemplate = SalaryElogConfig.salaryItemLoggerTemplate();
|
||||
|
||||
|
||||
private SysSalaryItemBiz sysSalaryItemBiz = new SysSalaryItemBiz();
|
||||
// @Autowired
|
||||
// private LoggerTemplate salaryItemLoggerTemplate;
|
||||
|
|
@ -217,7 +213,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98329, "新建薪资项目"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98329, "新建薪资项目") + ": " + salaryItemPO.getName());
|
||||
loggerContext.setNewValues(salaryItemPO);
|
||||
salaryItemLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -301,7 +297,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93892, "编辑薪资项目") + ": " + newSalaryItemPO.getName());
|
||||
loggerContext.setOldValues(salaryItemPO);
|
||||
loggerContext.setNewValues(newSalaryItemPO);
|
||||
salaryItemLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
private void changeName(SalaryItemPO salaryItemPO, String oldName, String newName, String itemPrefix, String fieldNamePrefix) {
|
||||
|
|
@ -365,7 +361,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98323, "删除薪资项目"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98323, "删除薪资项目") + ": " + salaryItemPO.getName());
|
||||
loggerContext.setOldValues(salaryItemPO);
|
||||
salaryItemLoggerTemplate.write(loggerContext);
|
||||
SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@ package com.engine.salary.service.impl;
|
|||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobAdjustRuleBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobAdjustRuleBO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobAdjustRuleSaveParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobAdjustRuleMapper;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobMapper;
|
||||
|
|
@ -40,7 +43,6 @@ public class SalarySobAdjustRuleServiceImpl extends Service implements SalarySob
|
|||
return MapperProxyFactory.getProxy(SalarySobAdjustRuleMapper.class);
|
||||
}
|
||||
|
||||
// private LoggerTemplate salarySobLoggerTemplate;
|
||||
|
||||
@Override
|
||||
public List<SalarySobAdjustRulePO> listBySalarySobId(Long salarySobId) {
|
||||
|
|
@ -76,20 +78,13 @@ public class SalarySobAdjustRuleServiceImpl extends Service implements SalarySob
|
|||
salarySobAdjustRuleMapper.batchInsert(salarySobAdjustRulePOS);
|
||||
}
|
||||
// 记录日志
|
||||
// LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(salarySobPO.getId()));
|
||||
// loggerContext.setTargetName(salarySobPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98614, "保存调薪计薪规则"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98614, "保存调薪计薪规则"));
|
||||
// salarySobLoggerTemplate.write(loggerContext);
|
||||
// } catch (Exception e) {
|
||||
// sqlSession.rollback();
|
||||
// throw new SalaryRunTimeException(e);
|
||||
// }finally {
|
||||
// sqlSession.commit();
|
||||
// sqlSession.close();
|
||||
// }
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(String.valueOf(salarySobPO.getId()));
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98614, "保存调薪计薪规则"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98614, "保存调薪计薪规则"));
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3,12 +3,15 @@ package com.engine.salary.service.impl;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobCheckRuleBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobCheckRuleBO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleQueryParam;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleSaveParam;
|
||||
import com.engine.salary.entity.salarysob.param.UpdateCheckRuleFormulaParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalarySobCheckRuleService;
|
||||
import com.engine.salary.service.SalarySobService;
|
||||
|
|
@ -37,7 +40,6 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC
|
|||
private SalarySobService getSalarySobService(User user) {
|
||||
return (SalarySobService) ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
// private LoggerTemplate salarySobLoggerTemplate;
|
||||
|
||||
@Override
|
||||
public SalarySobCheckRulePO getById(Long id) {
|
||||
|
|
@ -84,15 +86,15 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC
|
|||
SalarySobCheckRulePO salarySobCheckRulePO = SalarySobCheckRuleBO.convert2PO(saveParam, (long) user.getUID());
|
||||
// 保存
|
||||
salarySobCheckRuleMapper.insert(salarySobCheckRulePO);
|
||||
//todo 记录日志
|
||||
// LoggerContext<SalarySobCheckRulePO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
// loggerContext.setTargetName(salarySobPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(93872, "添加校验规则"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93872, "添加校验规则") + ": " + salarySobCheckRulePO.getName());
|
||||
// loggerContext.setNewValues(salarySobCheckRulePO);
|
||||
// salarySobLoggerTemplate.write(loggerContext);
|
||||
//记录日志
|
||||
LoggerContext<SalarySobCheckRulePO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(93872, "添加校验规则"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93872, "添加校验规则") + ": " + salarySobCheckRulePO.getName());
|
||||
loggerContext.setNewValues(salarySobCheckRulePO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -129,15 +131,16 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC
|
|||
newSalarySobCheckRulePO.setUpdateTime(new Date());
|
||||
salarySobCheckRuleMapper.updateById(newSalarySobCheckRulePO);
|
||||
//todo 记录日志
|
||||
// LoggerContext<SalarySobCheckRulePO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
// loggerContext.setTargetName(salarySobPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(93870, "编辑校验规则"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93870, "编辑校验规则") + ": " + newSalarySobCheckRulePO.getName());
|
||||
// loggerContext.setOldValues(salarySobCheckRulePO);
|
||||
// loggerContext.setNewValues(newSalarySobCheckRulePO);
|
||||
// salarySobLoggerTemplate.write(loggerContext);
|
||||
LoggerContext<SalarySobCheckRulePO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(93870, "编辑校验规则"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93870, "编辑校验规则") + ": " + newSalarySobCheckRulePO.getName());
|
||||
loggerContext.setOldValues(salarySobCheckRulePO);
|
||||
loggerContext.setNewValues(newSalarySobCheckRulePO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -175,17 +178,18 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC
|
|||
// 将薪资账套list转换成map
|
||||
Map<Long, SalarySobPO> salarySobPOMap = SalaryEntityUtil.convert2Map(salarySobPOS, SalarySobPO::getId);
|
||||
//todo 记录日志
|
||||
// salarySobCheckRulePOS.forEach(salarySobCheckRulePO -> {
|
||||
// SalarySobPO salarySobPO = salarySobPOMap.get(salarySobCheckRulePO.getSalarySobId());
|
||||
// LoggerContext<SalarySobCheckRulePO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
// loggerContext.setTargetName(salarySobPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98646, "删除校验规则"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98646, "删除校验规则") + ": " + salarySobCheckRulePO.getName());
|
||||
// loggerContext.setOldValues(salarySobCheckRulePO);
|
||||
// salarySobLoggerTemplate.write(loggerContext);
|
||||
// });
|
||||
salarySobCheckRulePOS.forEach(salarySobCheckRulePO -> {
|
||||
SalarySobPO salarySobPO = salarySobPOMap.get(salarySobCheckRulePO.getSalarySobId());
|
||||
LoggerContext<SalarySobCheckRulePO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98646, "删除校验规则"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98646, "删除校验规则") + ": " + salarySobCheckRulePO.getName());
|
||||
loggerContext.setOldValues(salarySobCheckRulePO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -59,8 +59,6 @@ public class SalarySobExtRangeServiceImpl extends Service implements SalarySobEx
|
|||
return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class);
|
||||
}
|
||||
|
||||
// private ComInfoCache comInfoCache;
|
||||
// private LoggerTemplate salarySobLoggerTemplate;
|
||||
|
||||
@Override
|
||||
public List<SalarySobExtRangePO> listByIds(Collection<Long> ids) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ import com.engine.salary.biz.SalarySobBiz;
|
|||
import com.engine.salary.biz.SalarySobItemBiz;
|
||||
import com.engine.salary.biz.SalarySobItemGroupBiz;
|
||||
import com.engine.salary.biz.SalarySobItemHideBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
|
|
@ -15,6 +17,7 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO;
|
|||
import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper;
|
||||
|
|
@ -23,9 +26,9 @@ import com.engine.salary.mapper.salarysob.SalarySobItemMapper;
|
|||
import com.engine.salary.service.*;
|
||||
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 com.engine.salary.util.db.IdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -93,7 +96,6 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
private SalarySobDefaultItemMapper getSalarySobDefaultItemMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobDefaultItemMapper.class);
|
||||
}
|
||||
// private LoggerTemplate salarySobLoggerTemplate;
|
||||
|
||||
@Override
|
||||
public List<SalarySobItemPO> list() {
|
||||
|
|
@ -260,14 +262,17 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
//保存
|
||||
saveSobItem(saveParam);
|
||||
|
||||
//todo 记录日志
|
||||
// LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
// loggerContext.setTargetName(salarySobPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98613, "编辑薪资账套薪资项目"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98613, "编辑薪资账套薪资项目"));
|
||||
// salarySobLoggerTemplate.write(loggerContext);
|
||||
SalarySobPO salarySob = salarySobBiz.getById(salarySobId);
|
||||
|
||||
// 记录日志
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySob.getId());
|
||||
loggerContext.setTargetName(salarySob.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98613, "编辑薪资账套薪资项目"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98613, "编辑薪资账套薪资项目"));
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.hrm.biz.OrganizationShowSetBiz;
|
||||
import com.engine.salary.biz.SalarySobRangeBiz;
|
||||
import com.engine.salary.biz.SpecialAddDeductionBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.hrm.DeptInfo;
|
||||
import com.engine.salary.entity.hrm.PositionInfo;
|
||||
|
|
@ -20,6 +22,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeSaveParam;
|
|||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobRangePO;
|
||||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||
|
|
@ -87,10 +90,6 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
private SalarySobExtRangeMapper getSalarySobExtRangeMapper() {
|
||||
return SqlProxyHandle.getProxy(SalarySobExtRangeMapper.class);
|
||||
}
|
||||
|
||||
// private ComInfoCache comInfoCache;
|
||||
// private LoggerTemplate salarySobLoggerTemplate;
|
||||
|
||||
@Override
|
||||
public List<SalarySobRangePO> listByIds(Collection<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
|
|
@ -185,17 +184,18 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange
|
|||
if (CollectionUtils.isNotEmpty(result.getNeedUpdateSalarySobRanges())) {
|
||||
result.getNeedUpdateSalarySobRanges().forEach(e -> salarySobRangeBiz.updateById(e));
|
||||
}
|
||||
// todo 记录日志
|
||||
// String operateTypeName = Objects.equals(saveParam.getIncludeType(), NumberUtils.INTEGER_ONE) ?
|
||||
// SalaryI18nUtil.getI18nLabel(98601, "关联人员范围新增对象") : SalaryI18nUtil.getI18nLabel(98602, "从范围中排除新增对象");
|
||||
// LoggerContext<SalarySobRangeSaveParam> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
// loggerContext.setTargetName(salarySobPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
// loggerContext.setOperateTypeName(operateTypeName);
|
||||
// loggerContext.setOperatedesc(operateTypeName);
|
||||
// loggerContext.setNewValues(saveParam);
|
||||
// salarySobLoggerTemplate.write(loggerContext);
|
||||
//记录日志
|
||||
String operateTypeName = Objects.equals(saveParam.getIncludeType(), 1) ?
|
||||
SalaryI18nUtil.getI18nLabel(98601, "关联人员范围新增对象") : SalaryI18nUtil.getI18nLabel(98602, "从范围中排除新增对象");
|
||||
LoggerContext<SalarySobRangeSaveParam> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId("" + salarySobPO.getId());
|
||||
loggerContext.setTargetName(salarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(operateTypeName);
|
||||
loggerContext.setOperatedesc(operateTypeName);
|
||||
loggerContext.setNewValues(saveParam);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@ package com.engine.salary.service.impl;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalaryItemBiz;
|
||||
import com.engine.salary.biz.SysSalaryItemBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryitem.bo.SysSalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salaryitem.SysSalaryItemMapper;
|
||||
|
|
@ -30,7 +33,6 @@ import java.util.Set;
|
|||
* @version 1.0
|
||||
**/
|
||||
public class SysSalaryItemServiceImpl extends Service implements SysSalaryItemService {
|
||||
|
||||
private SysSalaryItemBiz sysSalaryItemMapper = new SysSalaryItemBiz();
|
||||
private SalaryItemBiz salaryItemService = new SalaryItemBiz();
|
||||
|
||||
|
|
@ -87,19 +89,20 @@ public class SysSalaryItemServiceImpl extends Service implements SysSalaryItemSe
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98350, "已经添加过的系统薪资项目不能重复添加"));
|
||||
}
|
||||
// 保存
|
||||
List<SalaryItemPO> salaryItems = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItemPOS,(long)user.getUID());
|
||||
List<SalaryItemPO> salaryItems = SysSalaryItemBO.convert2SalaryItemPO(sysSalaryItemPOS, (long) user.getUID());
|
||||
salaryItemService.batchSave(salaryItems);
|
||||
//todo 记录日志
|
||||
// sysSalaryItemPOS.forEach(sysSalaryItemPO -> {
|
||||
// LoggerContext<SalaryItemPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(sysSalaryItemPO.getId()));
|
||||
// loggerContext.setTargetName(sysSalaryItemPO.getName());
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(93891, "添加系统薪资项目"));
|
||||
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93891, "添加系统薪资项目") + ": " + sysSalaryItemPO.getName());
|
||||
// loggerContext.setNewValues(sysSalaryItemPO);
|
||||
// salaryItemLoggerTemplate.write(loggerContext);
|
||||
// });
|
||||
// 记录日志
|
||||
sysSalaryItemPOS.forEach(sysSalaryItemPO -> {
|
||||
LoggerContext<SalaryItemPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(sysSalaryItemPO.getId()));
|
||||
loggerContext.setTargetName(sysSalaryItemPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(93891, "添加系统薪资项目"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(93891, "添加系统薪资项目") + ": " + sysSalaryItemPO.getName());
|
||||
loggerContext.setNewValues(sysSalaryItemPO);
|
||||
SalaryElogConfig.salaryItemLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,73 +1,80 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.elog.util.LoggerTemplate;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
|
||||
/**
|
||||
* @Description: 操作日志工具类
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/11/1 11:31
|
||||
*/
|
||||
* 操作日志工具类
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryLoggerUtil {
|
||||
|
||||
// /**
|
||||
// * 记录单个对象新增操作日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param newValues
|
||||
// */
|
||||
// public static void recordAddSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object newValues) {
|
||||
// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.ADD.getValue(), operateTypeName, operatedesc, null, newValues);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 记录单个对象修改操作日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param oldValues
|
||||
// * @param newValues
|
||||
// */
|
||||
// public static void recordUpdateSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues, Object newValues) {
|
||||
// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.UPDATE.getValue(), operateTypeName, operatedesc, oldValues, newValues);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 记录单个对象删除操作日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param oldValues
|
||||
// */
|
||||
// public static void recordDeleteSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues) {
|
||||
// recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.DELETE.getValue(), operateTypeName, operatedesc, oldValues, null);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 记录单个对象日志
|
||||
// * @param loggerTemplate
|
||||
// * @param targetId
|
||||
// * @param targetName
|
||||
// * @param operateType
|
||||
// * @param operateTypeName
|
||||
// * @param operatedesc
|
||||
// * @param oldValues
|
||||
// * @param newValues
|
||||
// */
|
||||
// private static void recoreSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateType, String operateTypeName, String operatedesc, Object oldValues, Object newValues) {
|
||||
// LoggerContext loggerContext = new LoggerContext();
|
||||
// loggerContext.setTargetId(String.valueOf(targetId));
|
||||
// loggerContext.setTargetName(targetName);
|
||||
// loggerContext.setOperateType(operateType);
|
||||
// loggerContext.setOperateTypeName(operateTypeName);
|
||||
// loggerContext.setOperatedesc(operatedesc);
|
||||
// loggerContext.setOldValues(oldValues);
|
||||
// loggerContext.setNewValues(newValues);
|
||||
// loggerTemplate.write(loggerContext);
|
||||
// }
|
||||
/**
|
||||
* 记录单个对象新增操作日志
|
||||
* @param loggerTemplate
|
||||
* @param targetId
|
||||
* @param targetName
|
||||
* @param operateTypeName
|
||||
* @param operatedesc
|
||||
* @param newValues
|
||||
*/
|
||||
public static void recordAddSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object newValues) {
|
||||
recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.ADD.getValue(), operateTypeName, operatedesc, null, newValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录单个对象修改操作日志
|
||||
* @param loggerTemplate
|
||||
* @param targetId
|
||||
* @param targetName
|
||||
* @param operateTypeName
|
||||
* @param operatedesc
|
||||
* @param oldValues
|
||||
* @param newValues
|
||||
*/
|
||||
public static void recordUpdateSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues, Object newValues) {
|
||||
recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.UPDATE.getValue(), operateTypeName, operatedesc, oldValues, newValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录单个对象删除操作日志
|
||||
* @param loggerTemplate
|
||||
* @param targetId
|
||||
* @param targetName
|
||||
* @param operateTypeName
|
||||
* @param operatedesc
|
||||
* @param oldValues
|
||||
*/
|
||||
public static void recordDeleteSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateTypeName, String operatedesc, Object oldValues) {
|
||||
recoreSingleLog(loggerTemplate, targetId, targetName, OperateTypeEnum.DELETE.getValue(), operateTypeName, operatedesc, oldValues, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录单个对象日志
|
||||
* @param loggerTemplate
|
||||
* @param targetId
|
||||
* @param targetName
|
||||
* @param operateType
|
||||
* @param operateTypeName
|
||||
* @param operatedesc
|
||||
* @param oldValues
|
||||
* @param newValues
|
||||
*/
|
||||
private static void recoreSingleLog(LoggerTemplate loggerTemplate, Long targetId, String targetName, String operateType, String operateTypeName, String operatedesc, Object oldValues, Object newValues) {
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setTargetId(String.valueOf(targetId));
|
||||
loggerContext.setTargetName(targetName);
|
||||
loggerContext.setOperateType(operateType);
|
||||
loggerContext.setOperateTypeName(operateTypeName);
|
||||
loggerContext.setOperatedesc(operatedesc);
|
||||
loggerContext.setOldValues(oldValues);
|
||||
loggerContext.setNewValues(newValues);
|
||||
loggerTemplate.write(loggerContext);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue