Merge remote-tracking branch 'origin/feature/操作日志组件' into feature/操作日志组件
This commit is contained in:
commit
4ea2499d85
|
|
@ -67,7 +67,7 @@ public class AttendQuoteDataValueBiz {
|
|||
}
|
||||
}
|
||||
|
||||
public void deleteByAttendQuoteIds(ArrayList<Long> quoteIds) {
|
||||
public void deleteByAttendQuoteIds(List<Long> quoteIds) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class);
|
||||
|
|
|
|||
|
|
@ -179,6 +179,9 @@ public class SpecialAddDeductionBiz extends BaseBean {
|
|||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
if(updateList.size() == 1) {
|
||||
loggerContext.setTargetId(updateList.get(0).getId().toString());
|
||||
}
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel( 0, "专项附加扣除 "));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入"));
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
package com.engine.salary.entity.datacollection.po;
|
||||
|
||||
import com.engine.salary.annotation.Encrypt;
|
||||
import com.engine.salary.elog.annotation.ElogTransform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据采集-专项附加扣除表
|
||||
|
|
@ -18,85 +19,103 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ElogTransform( name = "专项附加扣除" )
|
||||
public class SpecialAddDeductionPO {
|
||||
@ElogTransform( name="主键" )
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 人员信息表的主键id
|
||||
*/
|
||||
@ElogTransform( name="人员id" )
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人的主键id
|
||||
*/
|
||||
@ElogTransform( name="个税扣缴义务人id" )
|
||||
private Long taxAgentId;
|
||||
|
||||
/**
|
||||
* 子女教育
|
||||
*/
|
||||
@ElogTransform( name="子女教育" )
|
||||
@Encrypt
|
||||
private String childrenEducation;
|
||||
|
||||
/**
|
||||
* 继续教育
|
||||
*/
|
||||
@ElogTransform( name="继续教育" )
|
||||
@Encrypt
|
||||
private String continuingEducation;
|
||||
|
||||
/**
|
||||
* 住房贷款利息
|
||||
*/
|
||||
@ElogTransform( name="住房贷款利息" )
|
||||
@Encrypt
|
||||
private String housingLoanInterest;
|
||||
|
||||
/**
|
||||
* 住房租金
|
||||
*/
|
||||
@ElogTransform( name="住房租金" )
|
||||
@Encrypt
|
||||
private String housingRent;
|
||||
|
||||
/**
|
||||
* 赡养老人
|
||||
*/
|
||||
@ElogTransform( name="赡养老人" )
|
||||
@Encrypt
|
||||
private String supportingElder;
|
||||
|
||||
/**
|
||||
* 大病医疗
|
||||
*/
|
||||
@ElogTransform( name="大病医疗" )
|
||||
@Encrypt
|
||||
private String seriousIllnessTreatment;
|
||||
|
||||
/**
|
||||
* 婴幼儿照护
|
||||
*/
|
||||
@ElogTransform( name="婴幼儿照护" )
|
||||
@Encrypt
|
||||
private String infantCare;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform( name="创建时间" )
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform( name="更新时间" )
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ElogTransform( name="创建人" )
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
@ElogTransform( name="是否已删除" )
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@ElogTransform( name="租户" )
|
||||
private String tenantKey;
|
||||
|
||||
private List<Long> employeeIds;
|
||||
private Collection<Long> employeeIds;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.elog.annotation.ElogTransform;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -25,43 +26,51 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@ElogTransform( name = "薪资核算记录" )
|
||||
//hrsa_salary_acct_record
|
||||
public class SalaryAcctRecordPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ElogTransform( name = "主键id" )
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
@ElogTransform( name = "薪资所属月" )
|
||||
private Date salaryMonth;
|
||||
|
||||
/**
|
||||
* 税款所属期
|
||||
*/
|
||||
@ElogTransform( name = "税款所属期" )
|
||||
private Date taxCycle;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
@ElogTransform( name = "薪资账套id" )
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 核算状态
|
||||
* @see SalaryAcctRecordStatusEnum
|
||||
*/
|
||||
@ElogTransform( name = "核算状态" )
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 本次核算是账套(salarySobId)在本月(salaryMonth)的第几次核算
|
||||
*/
|
||||
@ElogTransform( name = "核算次数" )
|
||||
private Integer acctTimes;
|
||||
|
||||
/**
|
||||
* 是否是回算 0:不是回算、1:是回算
|
||||
*/
|
||||
@ElogTransform( name = "是否是回算" )
|
||||
private Integer backCalcStatus;
|
||||
|
||||
/**
|
||||
|
|
@ -81,31 +90,37 @@ public class SalaryAcctRecordPO {
|
|||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ElogTransform( name = "备注" )
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@ElogTransform( name = "租户key" )
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ElogTransform( name = "创建人id" )
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@ElogTransform( name = "是否删除" )
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform( name = "创建时间" )
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform( name = "更新时间" )
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -464,6 +464,13 @@
|
|||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="update_time =case" suffix="end,">
|
||||
<foreach collection="collection" item="item" index="index">
|
||||
<if test="item.updateTime!=null">
|
||||
when id=#{item.id} then #{item.updateTime}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where
|
||||
id in
|
||||
|
|
|
|||
|
|
@ -694,7 +694,7 @@
|
|||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM hrsa_special_add_deduction t
|
||||
FROM hrsa_special_add_deduction t1
|
||||
WHERE delete_type = 0
|
||||
<if test="childrenEducation != null">
|
||||
AND children_education = #{childrenEducation}
|
||||
|
|
@ -744,7 +744,7 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="employeeIds != null employeeIds ids.size()>0">
|
||||
<if test="employeeIds != null and employeeIds.size()>0">
|
||||
AND employee_id IN
|
||||
<foreach collection="employeeIds" open="(" item="empId" separator="," close=")">
|
||||
#{empId}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.cache.SalaryCacheKey;
|
||||
import com.engine.salary.component.WeaFormOption;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.elog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.report.common.constant.SalaryConstant;
|
||||
import com.engine.salary.report.entity.bo.SalaryStatisticsReportBO;
|
||||
|
|
@ -429,6 +432,17 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
map.put("workbook", book);
|
||||
map.put("fileName", sheetName);
|
||||
|
||||
// 记录操作日志
|
||||
String name = SalaryI18nUtil.getI18nLabel(0, "导出");
|
||||
LoggerContext loggerContext = new LoggerContext<>();
|
||||
loggerContext.setTargetId(po.getId().toString());
|
||||
loggerContext.setTargetName(po.getReportName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.EXCEL_EXPORT.getValue());
|
||||
loggerContext.setOperateTypeName(name);
|
||||
loggerContext.setOperatedesc(name + SalaryI18nUtil.getI18nLabel(0, "薪酬统计报表") + "-" + po.getReportName());
|
||||
loggerContext.setUser(user);
|
||||
SalaryElogConfig.salaryStatReportLoggerTemplate.write(loggerContext);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -896,6 +896,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
if (updateList.size() == 1) {
|
||||
loggerContext.setTargetId(updateList.get(0).getId().toString());
|
||||
}
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(0, "往期累计情况"));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "导入"));
|
||||
|
|
|
|||
|
|
@ -7,9 +7,7 @@ import com.engine.salary.biz.AttendQuoteDataBiz;
|
|||
import com.engine.salary.biz.AttendQuoteDataValueBiz;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteListDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam;
|
||||
import com.engine.salary.entity.datacollection.po.AttendQuoteDataPO;
|
||||
import com.engine.salary.entity.datacollection.po.AttendQuotePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
|
|
@ -124,15 +122,16 @@ public class AttendQuoteServiceImpl extends Service implements AttendQuoteServic
|
|||
// 1.删除未核算的考勤引用
|
||||
biz.deleteByIds(unAccountingIds);
|
||||
|
||||
List<AttendQuoteDataPO> attendQuoteDatas = dataBiz.listSome(AttendQuoteDataQueryParam.builder().unAccountingIds(unAccountingIds).build());
|
||||
// List<AttendQuoteDataPO> attendQuoteDatas = dataBiz.listSome(AttendQuoteDataQueryParam.builder().unAccountingIds(unAccountingIds).build());
|
||||
// 2.删除考核引用对应的考核数据
|
||||
dataBiz.deleteByAttendQuoteIds(unAccountingIds);
|
||||
|
||||
// 3.删除考核数据对应的考核值
|
||||
List<Long> attendQuoteDataIds = attendQuoteDatas.stream().map(AttendQuoteDataPO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(attendQuoteDataIds)) {
|
||||
dataValueBiz.deleteByAttendQuoteDataIds(attendQuoteDataIds);
|
||||
}
|
||||
dataValueBiz.deleteByAttendQuoteIds(unAccountingIds);
|
||||
// List<Long> attendQuoteDataIds = attendQuoteDatas.stream().map(AttendQuoteDataPO::getId).collect(Collectors.toList());
|
||||
// if (CollectionUtils.isNotEmpty(attendQuoteDataIds)) {
|
||||
// dataValueBiz.deleteByAttendQuoteDataIds(attendQuoteDataIds);
|
||||
// }
|
||||
|
||||
// 记录日志
|
||||
attendQuotes.forEach(e -> {
|
||||
|
|
|
|||
|
|
@ -434,6 +434,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||
LoggerContext loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
if (updateList.size() ==1) {
|
||||
loggerContext.setTargetId(updateList.get(0).getId().toString());
|
||||
}
|
||||
loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel( 0, "其他免税扣除"));
|
||||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "新增"));
|
||||
|
|
@ -672,6 +675,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
.otherDeduction(otherDeductionParam.getOtherDeduction())
|
||||
.deductionAllowedDonation(otherDeductionParam.getDeductionAllowedDonation())
|
||||
.privatePension(otherDeductionParam.getPrivatePension())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
updateList.add(build);
|
||||
OtherDeductionBiz.batchUpdate(updateList);
|
||||
|
|
|
|||
|
|
@ -732,6 +732,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
}
|
||||
salaryArchive.setPayEndDate(saveParam.getPayEndDate());
|
||||
}
|
||||
salaryArchive.setUpdateTime(new Date());
|
||||
getSalaryArchiveMapper().update(salaryArchive);
|
||||
|
||||
// List<SalarySobPO> salarySobList = getSalarySobList(currentEmployeeId, currentTenantKey);
|
||||
|
|
@ -771,13 +772,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
LoggerContext loggerContext = new LoggerContext();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(e.getId()));
|
||||
loggerContext.setTargetName(Optional.ofNullable(empMap.get(e.getEmployeeId())).orElse(StringUtils.EMPTY) + bar + Optional.ofNullable(taxAgentMap.get(e.getTaxAgentId())).orElse(StringUtils.EMPTY));
|
||||
loggerContext.setTargetName( Optional.ofNullable(taxAgentMap.get(e.getTaxAgentId())).orElse(StringUtils.EMPTY) + bar + Optional.ofNullable(empMap.get(e.getEmployeeId())).orElse(StringUtils.EMPTY) );
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(operatedesc);
|
||||
loggerContext.setOperatedesc(operatedesc);
|
||||
loggerContext.setOldValues(e);
|
||||
Optional<SalaryArchivePO> optionalNew = newSalaryArchiveList.stream().filter(n -> n.getId().equals(e.getId())).findFirst();
|
||||
loggerContext.setNewValues(optionalNew.orElse(null));
|
||||
loggerContext.setNewValues(optionalNew.isPresent() ? optionalNew.get() : null);
|
||||
SalaryElogConfig.salaryArchiveLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -535,16 +535,17 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
.setUpdateTime(new Date());
|
||||
salarySobMapper.updateById(newSalarySobPO);
|
||||
// 记录日志
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(newSalarySobPO.getId()));
|
||||
loggerContext.setTargetName(newSalarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套基础设置"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套基础设置"));
|
||||
loggerContext.setOldValues(salarySobPO);
|
||||
loggerContext.setNewValues(newSalarySobPO);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
SalarySobPO salarySobPO4log = getSalarySobMapper().getById(newSalarySobPO.getId());
|
||||
LoggerContext<SalarySobPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(newSalarySobPO.getId()));
|
||||
loggerContext.setTargetName(newSalarySobPO.getName());
|
||||
loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套基础设置"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(0, "编辑薪资账套基础设置"));
|
||||
loggerContext.setOldValues(salarySobPO);
|
||||
loggerContext.setNewValues(salarySobPO4log);
|
||||
SalaryElogConfig.salarySobLoggerTemplate.write(loggerContext);
|
||||
// 返回薪资账套的主键id
|
||||
return salarySobPO.getId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
// 记录操作日志
|
||||
String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTaxAgentId();
|
||||
SalaryLoggerUtil.recordAddSingleLog(SalaryElogConfig.taxAgentLoggerTemplate,
|
||||
range.getId(),
|
||||
range.getTaxAgentId(),
|
||||
name,
|
||||
SalaryI18nUtil.getI18nLabel(0, "新增人员范围"),
|
||||
SalaryI18nUtil.getI18nLabel(0, "新增人员范围") + name,
|
||||
|
|
@ -362,7 +362,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
TaxAgentManageRangePO oldPO = oldMap.getOrDefault(range.getId(), TaxAgentManageRangePO.builder().build());
|
||||
String name = taxAgent.getName() + "_" + TargetTypeEnum.parseByValue(range.getTargetType()).getDefaultLabel() + "_" + range.getTaxAgentId();
|
||||
SalaryLoggerUtil.recordUpdateSingleLog(SalaryElogConfig.taxAgentLoggerTemplate,
|
||||
range.getId(),
|
||||
range.getTaxAgentId(),
|
||||
name,
|
||||
SalaryI18nUtil.getI18nLabel(0, "更新人员范围"),
|
||||
SalaryI18nUtil.getI18nLabel(0, "更新人员范围") + name,
|
||||
|
|
|
|||
|
|
@ -275,6 +275,7 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel( 0, "生成个税申报表"));
|
||||
loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel( 0, "生成个税申报表"));
|
||||
loggerContext.setNewValues(declare);
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue