From 1c46bd28f70b35ba10c40837973d6ee543873545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 11 Mar 2022 16:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=AF=E8=AE=A1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OtherDeductionGetDetailListCmd.java | 16 +- .../datacollection/OtherDeductionListCmd.java | 16 +- .../DataCollectionEmployee.java | 8 +- .../param/AttendModuleSettingFieldParam.java | 27 ++ .../AttendQuoteDataExportTemplateParam.java | 29 ++ .../param/AttendQuoteDataQueryParam.java | 40 ++ .../param/AttendQuoteDataSaveParam.java | 28 ++ .../param/AttendQuoteDataSyncParam.java | 43 +++ .../param/AttendQuoteFieldQueryParam.java | 28 ++ .../param/AttendQuoteFieldSaveParam.java | 51 +++ .../AttendQuoteFieldSettingQueryParam.java | 29 ++ .../AttendQuoteFieldSettingRecoverParam.java | 23 ++ .../AttendQuoteFieldSettingSaveParam.java | 28 ++ .../taxrate/param/TaxRateSaveParam.java | 4 +- .../entity/taxrate/vo/TaxRateFormVo.java | 8 +- .../datacollection/AttendQuoteMapper.java | 79 ++++ .../datacollection/AttendQuoteMapper.xml | 300 +++++++++++++++ .../service/AttendQuoteFieldService.java | 83 ++++ .../impl/AttendQuoteFieldServiceImpl.java | 357 ++++++++++++++++++ 19 files changed, 1171 insertions(+), 26 deletions(-) create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendModuleSettingFieldParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteDataExportTemplateParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteDataQueryParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSaveParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSyncParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSaveParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingQueryParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingRecoverParam.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingSaveParam.java create mode 100644 src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.java create mode 100644 src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.xml create mode 100644 src/com/engine/salary/service/AttendQuoteFieldService.java create mode 100644 src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java diff --git a/src/com/engine/salary/cmd/datacollection/OtherDeductionGetDetailListCmd.java b/src/com/engine/salary/cmd/datacollection/OtherDeductionGetDetailListCmd.java index 5c8c0fb2a..f361b2b75 100644 --- a/src/com/engine/salary/cmd/datacollection/OtherDeductionGetDetailListCmd.java +++ b/src/com/engine/salary/cmd/datacollection/OtherDeductionGetDetailListCmd.java @@ -60,18 +60,18 @@ public class OtherDeductionGetDetailListCmd extends AbstractCommonCommand execute(CommandContext commandContext) { String fields = " t1.id," + - " t1.declare_month," + - " t1.employee_id," + - " t2.name AS tax_agent_name," + + " t1.declare_month as declareMonth," + + " t1.employee_id as employeeId," + + " t2.name AS taxAgentName," + " e.lastname as username," + " d.departmentname AS departmentName," + " e.mobile," + - " e.workcode as job_num," + + " e.workcode as jobNum," + " e.companystartdate as hiredate," + - " t1.business_healthy_insurance," + - " t1.tax_delay_endowment_insurance," + - " t1.other_deduction," + - " t1.deduction_allowed_donation"; + " t1.business_healthy_insurance as businessHealthyInsurance," + + " t1.tax_delay_endowment_insurance as taxDelayEndowmentInsurance," + + " t1.other_deduction as otherDeduction," + + " t1.deduction_allowed_donation as deductionAllowedDonation"; String fromSql = " FROM" + " hrsa_other_deduction t1" + diff --git a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java index 0e36ee248..26a85ae63 100644 --- a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java +++ b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java @@ -14,15 +14,15 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor -//@ApiModel("员工基本信息") +////员工基本信息") public class DataCollectionEmployee { -// @ApiModelProperty("员工id") +// //员工id") private Long employeeId; -// @ApiModelProperty("姓名") +// //姓名") private String username; -// @ApiModelProperty("部门") +// //部门") private String deparmentName; } diff --git a/src/com/engine/salary/entity/datacollection/param/AttendModuleSettingFieldParam.java b/src/com/engine/salary/entity/datacollection/param/AttendModuleSettingFieldParam.java new file mode 100644 index 000000000..aec0763d8 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendModuleSettingFieldParam.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 数据采集-考勤模块字段参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AttendModuleSettingFieldParam { + + //字段id + private Long id; + + //是否选中 + private Boolean checked; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataExportTemplateParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataExportTemplateParam.java new file mode 100644 index 000000000..7fa7c9c0d --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataExportTemplateParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; +import java.util.Collection; + +/** + * @Description: 数据采集-考勤引用数据导出模板参数 + * @Author: wangxiangzhong + * @Date: 2021-11-17 14:37 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AttendQuoteDataExportTemplateParam { + //薪资所属月 + private YearMonth salaryYearMonth; + + //薪资账套id + private Long salarySobId; + + //主键id + private Collection ids; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataQueryParam.java new file mode 100644 index 000000000..260d47f6f --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataQueryParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.datacollection.param; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +/** + * @Description: 数据采集-考勤引用数据 + * @Author: wangxiangzhong + * @Date: 2021-11-17 14:37 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用数据查询参数") +public class AttendQuoteDataQueryParam { + + //主键id") + private Collection ids; + + @JsonIgnore + private Long id; + + //关键字(姓名/部门名称/手机号/工号)") + private String keyword; + + //是否仅查看异动人员") + private Boolean isViewChangeEmployee; + + //考勤引用表的主键id(获取明细)") + private Long attendQuoteId; +// +// //人员信息表的主键id") +// private Long employeeId; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSaveParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSaveParam.java new file mode 100644 index 000000000..8be6dad96 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSaveParam.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description: 数据采集-考勤引用数据 + * @Author: wangxiangzhong + * @Date: 2021-11-17 14:37 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用数据保存参数") +public class AttendQuoteDataSaveParam { + + //主键") + private Long id; + + //人员信息表的主键id") + private Long employeeId; + + //考勤引用表的主键id") + private Long attendQuoteId; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSyncParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSyncParam.java new file mode 100644 index 000000000..019b0a8ea --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteDataSyncParam.java @@ -0,0 +1,43 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +/** + * @Description: 数据采集-考勤引用数据 + * @Author: wangxiangzhong + * @Date: 2021-11-17 14:37 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用数据同步参数") +public class AttendQuoteDataSyncParam { + + //薪资所属月") + private String salaryYearMonth; + + //关联账套id") + private Long salarySobId; + + //账套外人员主键id") + private Collection employeeIds; + + //备注") + private String description; + +// public static WeaResult checkParam(AttendQuoteDataSyncParam saveParam, Long employeeId, String tenantKey) { +// if (StringUtils.isEmpty(saveParam.getSalaryYearMonth())) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100294, "薪资所属月必传")); +// } +// if (saveParam.getSalarySobId() == null) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100295, "薪资账套必传")); +// } +// return WeaResult.success(StringUtils.EMPTY); +// } +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java new file mode 100644 index 000000000..826b4d64c --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldQueryParam.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +/** + * @Description: 数据采集-考勤引用字段 + * @Author: wangxiangzhong + * @Date: 2021-11-17 14:37 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用字段查询参数") +public class AttendQuoteFieldQueryParam { + + private Collection ids; + + private Long id; + + //字段名称") + private String fieldName; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSaveParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSaveParam.java new file mode 100644 index 000000000..940a75244 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSaveParam.java @@ -0,0 +1,51 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.datacollection.AttendQuoteFieldTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description: 数据采集-考勤引用字段 + * @Author: wangxiangzhong + * @Date: 2021-11-17 14:37 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用字段保存参数") +public class AttendQuoteFieldSaveParam { + + //主键") + private Long id; + + //字段名称") + private String fieldName; + + //字段类型。1:数值、2:文本") + private AttendQuoteFieldTypeEnum fieldType; + + //是否启用。false:否、true:是") + private Boolean enableStatus; + + //备注") + private String description; + +// public static WeaResult checkParam(AttendQuoteFieldSaveParam saveParam, Long employeeId, String tenantKey) { +// if (StringUtils.isEmpty(saveParam.getFieldName())) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100296, "字段名称必填")); +// } +// if (saveParam.getFieldType() == null) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100297, "字段类型必传")); +// } +// if (saveParam.getEnableStatus() == null) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100298, "是否启用必传")); +// } +// if (saveParam.getEnableStatus().equals(0) && saveParam.getEnableStatus().equals(1)) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100299, "是否启用参数有误")); +// } +// return WeaResult.success(StringUtils.EMPTY); +// } +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingQueryParam.java new file mode 100644 index 000000000..dd4ac69a8 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingQueryParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description: 数据采集-考勤引用字段设置 + * @Author: wangxiangzhong + * @Date: 2021-12-01 13:43 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用字段设置查询参数") +public class AttendQuoteFieldSettingQueryParam { + + //考勤字段来源类型:QUOTE:引用,IMPORT:导入") + private AttendQuoteSourceTypeEnum sourceType; + + //关键字") + private String keyword; + + //是否只显示已选中字段") + private Boolean isViewChecked; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingRecoverParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingRecoverParam.java new file mode 100644 index 000000000..0f5dcf5ab --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingRecoverParam.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description: 数据采集-考勤引用字段设置 + * @Author: wangxiangzhong + * @Date: 2021-12-01 13:43 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用字段设置恢复默认设置参数") +public class AttendQuoteFieldSettingRecoverParam { + + //考勤字段来源类型:QUOTE:引用,IMPORT:导入") + private AttendQuoteSourceTypeEnum sourceType; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingSaveParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingSaveParam.java new file mode 100644 index 000000000..876a54bc6 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteFieldSettingSaveParam.java @@ -0,0 +1,28 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @Description: 数据采集-考勤引用字段设置 + * @Author: wangxiangzhong + * @Date: 2021-12-01 13:43 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//数据采集-考勤引用字段设置保存参数") +public class AttendQuoteFieldSettingSaveParam { + + //考勤字段来源类型:QUOTE:引用,IMPORT:导入") + private AttendQuoteSourceTypeEnum sourceType; + + //当前设置内容") + private List currentSettingFields; +} diff --git a/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java b/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java index e9e9d8800..a9107beee 100644 --- a/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java +++ b/src/com/engine/salary/entity/taxrate/param/TaxRateSaveParam.java @@ -21,12 +21,12 @@ public class TaxRateSaveParam { /** * 基本信息不允许为空 */ -// @ApiModelProperty("基本信息") +// //基本信息") private TaxRateBaseSaveParam taxRateBatch; /** * 详细设置不允许为空 */ -// @ApiModelProperty("详细设置") +// //详细设置") private List taxRateRecords; } diff --git a/src/com/engine/salary/entity/taxrate/vo/TaxRateFormVo.java b/src/com/engine/salary/entity/taxrate/vo/TaxRateFormVo.java index d59ec3854..8549dc55a 100644 --- a/src/com/engine/salary/entity/taxrate/vo/TaxRateFormVo.java +++ b/src/com/engine/salary/entity/taxrate/vo/TaxRateFormVo.java @@ -16,16 +16,16 @@ import java.util.List; @Accessors(chain = true) @NoArgsConstructor @AllArgsConstructor -//@ApiModel("税率表税表") +////税率表税表") public class TaxRateFormVo { -// @ApiModelProperty("是否是系统默认。CUSTOM:自定义、SYSTEM:系统") +// //是否是系统默认。CUSTOM:自定义、SYSTEM:系统") private SalarySystemTypeEnum systemType; -// @ApiModelProperty("基本信息") +// //基本信息") private TaxRateBase taxRateBatch; -// @ApiModelProperty("详细设置") +// //详细设置") private List taxRateRecords; } diff --git a/src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.java b/src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.java new file mode 100644 index 000000000..e2b4c1e3b --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.java @@ -0,0 +1,79 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.dto.AttendQuoteListDTO; +import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam; +import com.engine.salary.entity.datacollection.po.AttendQuotePO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +@Mapper +public interface AttendQuoteMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + AttendQuotePO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param AttendQuotePO 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(AttendQuotePO AttendQuotePO); + + /** + * 修改,修改所有字段 + * + * @param AttendQuotePO 修改的记录 + * @return 返回影响行数 + */ + int update(AttendQuotePO AttendQuotePO); + + /** + * 修改,忽略null字段 + * + * @param AttendQuotePO 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(AttendQuotePO AttendQuotePO); + + /** + * 删除记录 + * + * @param AttendQuotePO 待删除的记录 + * @return 返回影响行数 + */ + int delete(AttendQuotePO AttendQuotePO); + + + + /** + * 查询数据采集-考勤引用列表 + * @param param + * @return + */ + List list(@Param("param") AttendQuoteQueryParam param); + + + /** + * 批量删除数据采集-考勤引用 + * @param ids + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.xml b/src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.xml new file mode 100644 index 000000000..98c07b45b --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/AttendQuoteMapper.xml @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.salary_year_month + , t.year + , t.month + , t.salary_sob_id + , t.source_type + , t.salary_accounting_status + , t.attend_cycle + , t.salary_cycle + , t.description + , t.create_time + , t.update_time + , t.creator + , t.delete_type + , t.tenant_key + + + + + + + + + + + INSERT INTO hrsa_attend_quote + + + + id, + + + salary_year_month, + + + year, + + + month, + + + salary_sob_id, + + + source_type, + + + salary_accounting_status, + + + attend_cycle, + + + salary_cycle, + + + description, + + + create_time, + + + update_time, + + + creator, + + + delete_type, + + + tenant_key, + + + + + #{id}, + + + #{salaryYearMonth}, + + + #{year}, + + + #{month}, + + + #{salarySobId}, + + + #{sourceType}, + + + #{salaryAccountingStatus}, + + + #{attendCycle}, + + + #{salaryCycle}, + + + #{description}, + + + #{createTime}, + + + #{updateTime}, + + + #{creator}, + + + #{deleteType}, + + + #{tenantKey}, + + + + + + + UPDATE hrsa_attend_quote + + salary_year_month=#{salaryYearMonth}, + year=#{year}, + month=#{month}, + salary_sob_id=#{salarySobId}, + source_type=#{sourceType}, + salary_accounting_status=#{salaryAccountingStatus}, + attend_cycle=#{attendCycle}, + salary_cycle=#{salaryCycle}, + description=#{description}, + create_time=#{createTime}, + update_time=#{updateTime}, + creator=#{creator}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_attend_quote + + + salary_year_month=#{salaryYearMonth}, + + + year=#{year}, + + + month=#{month}, + + + salary_sob_id=#{salarySobId}, + + + source_type=#{sourceType}, + + + salary_accounting_status=#{salaryAccountingStatus}, + + + attend_cycle=#{attendCycle}, + + + salary_cycle=#{salaryCycle}, + + + description=#{description}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_attend_quote + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + + + t1.id, + t1.salary_year_month, + t1.salary_sob_id, + t2.name AS salary_sob_name, + t1.source_type, + t1.attend_cycle, + t1.salary_cycle, + t1.description, + e.lastname AS creator, + t1.salary_accounting_status + + + + + AND t1.id IN + + #{id} + + + + + + AND t1.salary_year_month = #{param.salaryYearMonth[0]} + + + AND (t1.salary_year_month BETWEEN #{param.salaryYearMonth[0]} AND #{param.salaryYearMonth[1]}) + + + + + + + + UPDATE hrsa_attend_quote + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/AttendQuoteFieldService.java b/src/com/engine/salary/service/AttendQuoteFieldService.java new file mode 100644 index 000000000..034fb2ebd --- /dev/null +++ b/src/com/engine/salary/service/AttendQuoteFieldService.java @@ -0,0 +1,83 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.datacollection.param.AttendQuoteFieldQueryParam; + +import java.util.Map; + +/** + * 数据采集-考勤引用字段 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface AttendQuoteFieldService { + + /** + * 数据采集-考勤引用字段列表 + * @param queryParam + * @return + */ + Map list(AttendQuoteFieldQueryParam queryParam); + +// /** +// * 获取数据采集-考勤引用字段表单 +// * @param id +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// WeaForm getFrom(Long id, Long employeeId, String tenantKey); +// +// /** +// * 新建数据采集-考勤引用字段 +// * @param saveParam +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// WeaResult save(AttendQuoteFieldSaveParam saveParam, Long employeeId, String tenantKey); +// +// /** +// * 编辑数据采集-考勤引用字段 +// * @param saveParam +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// WeaResult update(AttendQuoteFieldSaveParam saveParam, Long employeeId, String tenantKey); +// +// /** +// * 删除数据采集-考勤引用字段 +// * @param ids +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// WeaResult delete(Collection ids, Long employeeId, String tenantKey); +// +// /** +// * 启用/停用自定义字段 +// * @param id +// * @param enableStatus +// * @return +// */ +// WeaResult updateEnableStatus(Long id, Boolean enableStatus, Long currentEmployeeId, String currentTenantKey); +// +// /** +// * 同步考勤模块字段 +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// WeaResult syncAttendFields(Long currentEmployeeId, String currentTenantKey); +// +// /** +// * 获取当前租户下所有的考勤引用字段 +// * +// * @param tenantKey +// * @return +// */ +// List listAll(String tenantKey); +} diff --git a/src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java new file mode 100644 index 000000000..2679236f0 --- /dev/null +++ b/src/com/engine/salary/service/impl/AttendQuoteFieldServiceImpl.java @@ -0,0 +1,357 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.param.AttendQuoteFieldQueryParam; +import com.engine.salary.service.AttendQuoteFieldService; + +import java.util.Map; + +/** + * 数据采集-考勤引用字段 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class AttendQuoteFieldServiceImpl extends Service implements AttendQuoteFieldService { +// +// @Resource +// private AttendQuoteFieldMapper mapper; +// @RpcReference +// private RemoteAttendInitVacationService remoteAttendInitVacationService; +// @Autowired +// private LoggerTemplate attendQuoteFieldLoggerTemplate; + + @Override + public Map list(AttendQuoteFieldQueryParam queryParam) { + int uid = user.getUID(); + + // todo 同步字段 +// syncAttendFields(employeeId, tenantKey); + +// Page page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true); +// mapper.list(page, queryParam, tenantKey); +// +// List list = page.getRecords(); +// list.forEach(m->{ +// Integer sourceType = Integer.valueOf(m.getSourceType()); +// m.setSourceType(AttendQuoteFieldSourceTypeEnum.getDefaultLabelByValue(sourceType, employeeId, tenantKey)); +// m.setSourceTypeValue(AttendQuoteFieldSourceTypeEnum.getNameByValue(sourceType)); +// m.setFieldType(AttendQuoteFieldTypeEnum.getDefaultLabelByValue(Integer.valueOf(m.getFieldType()), employeeId, tenantKey)); +// }); +// +// WeaTable weaTable = FormatManager.getInstance() +// .genTable(AttendQuoteFieldListDTO.class, page); +// +// EditableTable> editableTable = new EditableTable<>(weaTable); +// editableTable.setColumns(AttendQuoteFieldBO.buildRecordTableColumns(employeeId, tenantKey)); +// editableTable.setComProps(AttendQuoteFieldBO.buildEditableTableItemMap()); +// editableTable.setPageSize(page.getSize()); +// editableTable.setModule("hrmsalary"); +// return editableTable; + return null; + } + +// @Override +// public WeaForm getFrom(Long id, Long employeeId, String tenantKey) { +// AttendQuoteFieldFormDTO formDTO = new AttendQuoteFieldFormDTO(); +// if (id != null) { +// AttendQuoteFieldPO po = mapper.getById(id, tenantKey); +// if (po == null) { +// throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100370, "字段不存在")+"[id:%s]", id)); +// } +// BeanUtils.copyProperties(po, formDTO); +// } else { +// formDTO.setEnableStatus(0); +// } +// WeaForm weaForm = FormatManager.getInstance().genForm(AttendQuoteFieldFormDTO.class, formDTO); +// weaForm.setData(JsonUtil.parseMap(formDTO, Object.class)); +// return weaForm; +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public WeaResult save(AttendQuoteFieldSaveParam saveParam, Long employeeId, String tenantKey) { +// WeaResult checkResult = AttendQuoteFieldSaveParam.checkParam(saveParam, employeeId, tenantKey); +// if (checkResult.getCode() == WeaResultCodeEnum.ERROR.getCode()) { +// return checkResult; +// } +// List attendQuoteFields = new LambdaQueryChainWrapper<>(mapper) +// .eq(AttendQuoteFieldPO::getDeleteType, 0) +// .eq(AttendQuoteFieldPO::getTenantKey, tenantKey) +// .eq(AttendQuoteFieldPO::getFieldName, saveParam.getFieldName()).list(); +// if (CollectionUtils.isNotEmpty(attendQuoteFields)) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100371, "字段名称不允许重复")); +// } +// +// AttendQuoteFieldPO attendQuoteField = AttendQuoteFieldPO.builder() +// .id(IdGenerator.generate()) +// .fieldName(saveParam.getFieldName()) +// .sourceType(AttendQuoteFieldSourceTypeEnum.DEFAULT.getValue()) +// .fieldType(saveParam.getFieldType().getValue()) +// .enableStatus(saveParam.getEnableStatus()?1:0) +// .description(saveParam.getDescription()) +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(employeeId) +// .tenantKey(tenantKey) +// .build(); +// // 保存 +// mapper.insert(attendQuoteField); +// // 记录日志 +// SalaryLoggerUtil.recordAddSingleLog(attendQuoteFieldLoggerTemplate, +// attendQuoteField.getId(), +// attendQuoteField.getFieldName(), +// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100374, "新增字段"), +// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100374, "新增字段"), +// attendQuoteField); +// +// return WeaResult.success(StringUtils.EMPTY); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public WeaResult update(AttendQuoteFieldSaveParam saveParam, Long employeeId, String tenantKey) { +// WeaResult checkResult = AttendQuoteFieldSaveParam.checkParam(saveParam, employeeId, tenantKey); +// if (checkResult.getCode() == WeaResultCodeEnum.ERROR.getCode()) { +// return checkResult; +// } +// // 校验是否可以编辑 +// if (saveParam.getId() == null) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误")); +// } +// AttendQuoteFieldPO attendQuoteField = mapper.getById(saveParam.getId(), tenantKey); +// if (attendQuoteField == null) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100375, "该字段不存在")); +// } +// if (!attendQuoteField.getSourceType().equals(AttendQuoteFieldSourceTypeEnum.DEFAULT.getValue())) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100376, "来源只能为自定义")); +// } +// List attendQuoteFields = new LambdaQueryChainWrapper<>(mapper) +// .eq(AttendQuoteFieldPO::getDeleteType, 0) +// .eq(AttendQuoteFieldPO::getTenantKey, tenantKey) +// .eq(AttendQuoteFieldPO::getFieldName, saveParam.getFieldName()).list(); +// boolean fieldNameExist = CollectionUtils.emptyIfNull(attendQuoteFields).stream().anyMatch(e -> !Objects.equals(e.getId(), saveParam.getId())); +// if (fieldNameExist) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100371, "字段名称不允许重复")); +// } +// +// AttendQuoteFieldPO newAttendQuoteField = new AttendQuoteFieldPO(); +// BeanUtils.copyProperties(attendQuoteField, newAttendQuoteField); +// newAttendQuoteField.setFieldName(saveParam.getFieldName()); +// newAttendQuoteField.setFieldType(saveParam.getFieldType().getValue()); +// newAttendQuoteField.setEnableStatus(saveParam.getEnableStatus()?1:0); +// newAttendQuoteField.setDescription(saveParam.getDescription()); +// newAttendQuoteField.setUpdateTime(LocalDateTime.now()); +// // 更新 +// mapper.updateById(newAttendQuoteField); +// +// // 记录日志 +// SalaryLoggerUtil.recordUpdateSingleLog(attendQuoteFieldLoggerTemplate, +// attendQuoteField.getId(), +// newAttendQuoteField.getFieldName(), +// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100378, "修改字段"), +// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100378, "修改字段"), +// attendQuoteField, +// newAttendQuoteField); +// +// return WeaResult.success(StringUtils.EMPTY); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public WeaResult delete(Collection ids, Long employeeId, String tenantKey) { +// if (CollectionUtils.isEmpty(ids)) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误")); +// } +// List attendQuoteFields = mapper.list(AttendQuoteFieldQueryParam.builder().ids(ids).build(), tenantKey); +// if (CollectionUtils.isEmpty(attendQuoteFields)) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 87637, "要删除的数据在不存在或已删除")); +// } +// +// List attendQuoteAttendFields = attendQuoteFields.stream().filter(e-> e.getSourceType().equals(String.valueOf(AttendQuoteFieldSourceTypeEnum.ATTEND.getValue()))).collect(Collectors.toList()); +// if (CollectionUtils.isNotEmpty(attendQuoteAttendFields)) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 87652, "考勤模块的字段不能删除")); +// } +// +// // TODO 正在使用的记录不允许删除 +// mapper.deleteByIds(ids, tenantKey); +// +// // 记录日志 +// attendQuoteFields.forEach(e -> { +// SalaryLoggerUtil.recordDeleteSingleLog(attendQuoteFieldLoggerTemplate, +// e.getId(), +// e.getFieldName(), +// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100380, "删除字段"), +// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100380, "删除字段"), +// e); +// }); +// return WeaResult.success(StringUtils.EMPTY); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public WeaResult updateEnableStatus(Long id, Boolean enableStatus, Long currentEmployeeId, String currentTenantKey) { +// // 校验是否可以编辑 +// if (id == null || enableStatus == null) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 84026, "参数错误")); +// } +// AttendQuoteFieldPO attendQuoteField = mapper.getById(id, currentTenantKey); +// if (attendQuoteField == null) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100375, "该字段不存在")); +// } +// if (!attendQuoteField.getSourceType().equals(AttendQuoteFieldSourceTypeEnum.DEFAULT.getValue())) { +// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100376, "来源只能为自定义")); +// } +// +// AttendQuoteFieldPO newAttendQuoteField = new AttendQuoteFieldPO(); +// BeanUtils.copyProperties(attendQuoteField, newAttendQuoteField); +// newAttendQuoteField.setEnableStatus(enableStatus?1:0); +// newAttendQuoteField.setUpdateTime(LocalDateTime.now()); +// // 更新 +// mapper.updateById(newAttendQuoteField); +// String action = enableStatus?SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 87070, "启用"):SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100386, "停用"); +// // 记录日志 +// SalaryLoggerUtil.recordUpdateSingleLog(attendQuoteFieldLoggerTemplate, +// attendQuoteField.getId(), +// newAttendQuoteField.getFieldName(), +// action+SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100387, "字段"), +// action+SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100387, "字段"), +// attendQuoteField, +// newAttendQuoteField); +// +// return WeaResult.success(StringUtils.EMPTY); +// } +// +// @Override +// @Transactional(rollbackFor = Exception.class) +// public WeaResult syncAttendFields(Long currentEmployeeId, String currentTenantKey) { +// // 所有字段管理的考勤模块引用字段 +// List attendQuoteFields = new LambdaQueryChainWrapper<>(mapper) +// .eq(AttendQuoteFieldPO::getTenantKey, currentTenantKey) +// .eq(AttendQuoteFieldPO::getDeleteType, 0) +// .eq(AttendQuoteFieldPO::getSourceType, AttendQuoteFieldSourceTypeEnum.ATTEND.getValue()) +// .orderByDesc(AttendQuoteFieldPO::getId).list(); +// // 1.本地字段 +// List localFieldCodes = CollectionUtils.emptyIfNull(attendQuoteFields).stream().map(AttendQuoteFieldPO::getCode).collect(Collectors.toList()); +// +// // 2.考勤模块字段 +// // 请假类型 +// List attendVacationTypes; +// try { +// attendVacationTypes = remoteAttendInitVacationService.queryVacationTypes(Boolean.TRUE, currentTenantKey); +// } catch (Exception e) { +// log.error("同步考勤字段失败,请检查接口服务remoteAttendInitVacationService.queryVacationTypes:{}", e.getMessage()); +// return WeaResult.success(StringUtils.EMPTY); +// } +// // 请假类型:按小时 +// List attendLeaveHourFieldCodes = CollectionUtils.emptyIfNull(attendVacationTypes).stream().map(m->m.getId()+"_leave_hour").collect(Collectors.toList()); +// // 请假类型:按天 +// List attendLeaveDayFieldCodes = CollectionUtils.emptyIfNull(attendVacationTypes).stream().map(m->m.getId()+"_leave_day").collect(Collectors.toList()); +// List attendLeaveFieldCodes = Lists.newArrayList(); +// attendLeaveFieldCodes.addAll(attendLeaveHourFieldCodes); +// attendLeaveFieldCodes.addAll(attendLeaveDayFieldCodes); +// // 所有考勤模块字段编码 +// List attendFieldCodes = Lists.newArrayList(); +// attendFieldCodes.addAll(attendLeaveFieldCodes); +// // 考勤模块固定字段 +// List> attendFixedFieldCodes = AttendQuoteFieldBO.buildAttendFixedFields(); +// attendFieldCodes.addAll(attendFixedFieldCodes.stream().map(m->m.get("code")).collect(Collectors.toList())); +// +// // 本地已存在则更新【交集】 +// List updateCodes = localFieldCodes.stream().filter(item -> attendFieldCodes.contains(item)).collect(Collectors.toList()); +// // 本地比attend多,则删除【差集(local - attend)】 +// List deleteCodes = localFieldCodes.stream().filter(item -> !attendFieldCodes.contains(item)).collect(Collectors.toList()); +// // attend比本地多,则新增【差集(attend - local)】 +// List saveCodes = attendFieldCodes.stream().filter(item -> !localFieldCodes.contains(item)).collect(Collectors.toList()); +// String hourI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100743, "小时"); +// String dayI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100744, "天"); +// // 1.更新 == 目前除了请假类型其余都是固定,故只需更新请假类型部分 +// List updates = Lists.newArrayList(); +// CollectionUtils.emptyIfNull(updateCodes).forEach(e -> { +// Optional optionalHour = CollectionUtils.emptyIfNull(attendVacationTypes).stream().filter(m->(m.getId()+"_leave_hour").equals(e)).findFirst(); +// if (optionalHour.isPresent()) { +// AttendVacationType hour = optionalHour.get(); +// updates.add(AttendQuoteFieldPO.builder() +// .code(e) +// .fieldName(hour.getName()+"("+hourI18n+")") +// .updateTime(LocalDateTime.now()) +// .build()); +// } +// Optional optionalDay = CollectionUtils.emptyIfNull(attendVacationTypes).stream().filter(m->(m.getId()+"_leave_day").equals(e)).findFirst(); +// if (optionalDay.isPresent()) { +// AttendVacationType day = optionalDay.get(); +// updates.add(AttendQuoteFieldPO.builder() +// .code(e) +// .fieldName(day.getName()+"("+dayI18n+")") +// .updateTime(LocalDateTime.now()) +// .build()); +// } +// }); +// if (CollectionUtils.isNotEmpty(updates)) { +// mapper.updateNameByCode(updates); +// } +// // 2.删除 +// if (CollectionUtils.isNotEmpty(deleteCodes)) { +// new LambdaUpdateChainWrapper<>(mapper) +// .eq(AttendQuoteFieldPO::getDeleteType, 0) +// .eq(AttendQuoteFieldPO::getTenantKey, currentTenantKey) +// .eq(AttendQuoteFieldPO::getSourceType, AttendQuoteFieldSourceTypeEnum.ATTEND.getValue()) +// .in(AttendQuoteFieldPO::getCode, deleteCodes) +// .set(AttendQuoteFieldPO::getDeleteType, 1).update(); +// } +// // 3.新增 +// List saves = new ArrayList<>(); +// saves.addAll(CollectionUtils.emptyIfNull(attendFixedFieldCodes).stream().filter(e -> saveCodes.contains(e.get("code"))).map(m -> +// buildAttendQuoteField(m.get("code"), m.get("name"), currentEmployeeId, currentTenantKey) +// ).collect(Collectors.toList())); +// CollectionUtils.emptyIfNull(saveCodes).forEach(e -> { +// Optional optionalHour = CollectionUtils.emptyIfNull(attendVacationTypes).stream().filter(m->(m.getId()+"_leave_hour").equals(e)).findFirst(); +// if (optionalHour.isPresent()) { +// AttendVacationType hour = optionalHour.get(); +// saves.add(buildAttendQuoteField(e, hour.getName()+"("+hourI18n+")", currentEmployeeId, currentTenantKey)); +// } +// Optional optionalDay = CollectionUtils.emptyIfNull(attendVacationTypes).stream().filter(m->(m.getId()+"_leave_day").equals(e)).findFirst(); +// if (optionalDay.isPresent()) { +// AttendVacationType day = optionalDay.get(); +// saves.add(buildAttendQuoteField(e, day.getName()+"("+dayI18n+")", currentEmployeeId, currentTenantKey)); +// } +// }); +// +// if (CollectionUtils.isNotEmpty(saves)) { +// mapper.saveBatch(saves); +// } +// +// return WeaResult.success(StringUtils.EMPTY); +// } +// +// /** +// * 构建考勤字段 +// * @param code +// * @param name +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// private AttendQuoteFieldPO buildAttendQuoteField(String code, String name, Long currentEmployeeId, String currentTenantKey) { +// return AttendQuoteFieldPO.builder() +// .id(IdGenerator.generate()) +// .code(code) +// .fieldName(name) +// .sourceType(AttendQuoteFieldSourceTypeEnum.ATTEND.getValue()) +// .fieldType(AttendQuoteFieldTypeEnum.NUMBER.getValue()) +// .enableStatus(1) +// .description("") +// .createTime(LocalDateTime.now()) +// .updateTime(LocalDateTime.now()) +// .creator(currentEmployeeId) +// .tenantKey(currentTenantKey) +// .build(); +// } +// +// @Override +// public List listAll(String tenantKey) { +// return mapper.list(AttendQuoteFieldQueryParam.builder().build(), tenantKey); +// } +}