diff --git a/jinbooks-ui/src/views/hr/salary-voucher-rules/template.vue b/jinbooks-ui/src/views/hr/salary-voucher-rules/template.vue index ddea5f3..799903c 100644 --- a/jinbooks-ui/src/views/hr/salary-voucher-rules/template.vue +++ b/jinbooks-ui/src/views/hr/salary-voucher-rules/template.vue @@ -37,7 +37,7 @@ @@ -121,7 +121,7 @@ const props: any = defineProps({ const defaultProps: any = ref({ expandTrigger: 'hover', label: 'name', - value: 'id', + value: 'code', children: 'children', checkStrictly: false, emitPath: false, @@ -145,7 +145,7 @@ interface VoucherItem { id: null; summary: string; direction: string; - subjectId: number | null; + subjectCode: string | null; selectedValue: string; // 其他可能的字段... [key: string]: any; // 这允许添加其他可能从后端返回的字段 @@ -193,7 +193,7 @@ function reset(): any { id: null, summary: summaryTemplate, direction: "1", - subjectId: props.deptOptions?.[0]?.id || null, + subjectCode: props.deptOptions?.[0]?.code || null, selectedValue: salary_values.value[0].value, }] @@ -209,7 +209,7 @@ function addRecord() { id: null, summary: summaryTemplate, direction: "1", - subjectId: props.deptOptions?.[0]?.id || null, + subjectCode: props.deptOptions?.[0]?.code || null, selectedValue: salary_values.value[0].value, }); } diff --git a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/EmployeeSalaryVoucherRule.java b/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/EmployeeSalaryVoucherRule.java index 3a0d90b..659a49d 100644 --- a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/EmployeeSalaryVoucherRule.java +++ b/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/EmployeeSalaryVoucherRule.java @@ -1,12 +1,12 @@ /* * Copyright [2025] [JinBooks of copyright http://www.jinbooks.com] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,7 @@ * limitations under the License. * */ - + package com.jinbooks.entity.hr; @@ -46,8 +46,6 @@ public class EmployeeSalaryVoucherRule extends BaseEntity { private String direction; - private String subjectId; - private String templateId; private String selectedValue; @@ -55,6 +53,5 @@ public class EmployeeSalaryVoucherRule extends BaseEntity { @TableField(exist = false) private String subjectName; - @TableField(exist = false) private String subjectCode; } diff --git a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/dto/SalaryTemplateDetailDto.java b/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/dto/SalaryTemplateDetailDto.java index 9739bda..45e9015 100644 --- a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/dto/SalaryTemplateDetailDto.java +++ b/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/hr/dto/SalaryTemplateDetailDto.java @@ -1,12 +1,12 @@ /* * Copyright [2025] [JinBooks of copyright http://www.jinbooks.com] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,7 @@ * limitations under the License. * */ - + package com.jinbooks.entity.hr.dto; @@ -39,8 +39,8 @@ public class SalaryTemplateDetailDto { @NotEmpty(message = "借贷方向不能为空", groups = {AddGroup.class, EditGroup.class}) private String direction; - @NotEmpty(message = "科目不能为空", groups = {AddGroup.class, EditGroup.class}) - private String subjectId; + @NotEmpty(message = "科目编码不能为空", groups = {AddGroup.class, EditGroup.class}) + private String subjectCode; @NotEmpty(message = "取值不能为空", groups = {AddGroup.class, EditGroup.class}) private String selectedValue; diff --git a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalarySummaryServiceImpl.java b/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalarySummaryServiceImpl.java index 6ef2eb3..f4c8cf8 100644 --- a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalarySummaryServiceImpl.java +++ b/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalarySummaryServiceImpl.java @@ -1,12 +1,12 @@ /* * Copyright [2025] [JinBooks of copyright http://www.jinbooks.com] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,7 @@ * limitations under the License. * */ - + package com.jinbooks.persistence.service.impl; @@ -80,7 +80,7 @@ public class EmployeeSalarySummaryServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(BookSubject::getBookId, bookId); + wrapper.eq(BookSubject::getCode, rule.getSubjectCode()); + BookSubject bookSubject = bookSubjectMapper.selectOne(wrapper); VoucherItemChangeDto itemDto = new VoucherItemChangeDto(); itemDto.setSummary(rule.getSummary()); - itemDto.setSubjectId(rule.getSubjectId()); + itemDto.setSubjectId(bookSubject.getId()); if (isDebit) { itemDto.setDebitAmount(amount); } else { diff --git a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalaryVoucherRuleServiceImpl.java b/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalaryVoucherRuleServiceImpl.java index 96642be..13334e2 100644 --- a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalaryVoucherRuleServiceImpl.java +++ b/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/EmployeeSalaryVoucherRuleServiceImpl.java @@ -1,12 +1,12 @@ /* * Copyright [2025] [JinBooks of copyright http://www.jinbooks.com] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,7 @@ * limitations under the License. * */ - + package com.jinbooks.persistence.service.impl; @@ -266,7 +266,7 @@ public class EmployeeSalaryVoucherRuleServiceImpl extends ServiceImpl