From d06ef3f44d6dc19dae223ab420165369ea13cc16 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 20 五月 2026 16:29:35 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro
---
src/main/java/com/ruoyi/staff/service/impl/SchemeApplicableStaffServiceImpl.java | 58 ++++++++++++++++++++++------------------------------------
1 files changed, 22 insertions(+), 36 deletions(-)
diff --git a/src/main/java/com/ruoyi/staff/service/impl/SchemeApplicableStaffServiceImpl.java b/src/main/java/com/ruoyi/staff/service/impl/SchemeApplicableStaffServiceImpl.java
index 0dac4b9..d57a25e 100644
--- a/src/main/java/com/ruoyi/staff/service/impl/SchemeApplicableStaffServiceImpl.java
+++ b/src/main/java/com/ruoyi/staff/service/impl/SchemeApplicableStaffServiceImpl.java
@@ -4,14 +4,13 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.domain.R;
import com.ruoyi.production.bean.dto.UserAccountDto;
import com.ruoyi.production.bean.dto.UserProductionAccountingDto;
import com.ruoyi.production.service.SalesLedgerProductionAccountingService;
import com.ruoyi.project.system.domain.SysDept;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.mapper.SysDeptMapper;
-import com.ruoyi.project.system.mapper.SysUserDeptMapper;
import com.ruoyi.project.system.mapper.SysUserMapper;
import com.ruoyi.staff.controller.TaxCalculator;
import com.ruoyi.staff.mapper.SchemeApplicableStaffMapper;
@@ -21,7 +20,7 @@
import com.ruoyi.staff.pojo.SchemeInsuranceDetail;
import com.ruoyi.staff.pojo.StaffOnJob;
import com.ruoyi.staff.service.SchemeApplicableStaffService;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -41,32 +40,19 @@
* @since 2026-03-05 11:50:17
*/
@Service
+@RequiredArgsConstructor
public class SchemeApplicableStaffServiceImpl extends ServiceImpl<SchemeApplicableStaffMapper, SchemeApplicableStaff> implements SchemeApplicableStaffService {
- @Autowired
- private SchemeApplicableStaffMapper schemeApplicableStaffMapper;
-
- @Autowired
- private SchemeInsuranceDetailMapper schemeInsuranceDetailMapper;
-
- @Autowired
- private SysUserDeptMapper sysUserDeptMapper;
-
- @Autowired
- private SysUserMapper sysUserMapper;
-
- @Autowired
- private SysDeptMapper sysDeptMapper;
-
- @Autowired
- private StaffOnJobMapper staffOnJobMapper;
-
- @Autowired
- private SalesLedgerProductionAccountingService salesLedgerProductionAccountingService;
+ private final SchemeApplicableStaffMapper schemeApplicableStaffMapper;
+ private final SchemeInsuranceDetailMapper schemeInsuranceDetailMapper;
+ private final SysUserMapper sysUserMapper;
+ private final SysDeptMapper sysDeptMapper;
+ private final StaffOnJobMapper staffOnJobMapper;
+ private final SalesLedgerProductionAccountingService salesLedgerProductionAccountingService;
@Override
- public AjaxResult listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) {
+ public R<?> listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) {
LambdaQueryWrapper<SchemeApplicableStaff> schemeApplicableStaffLambdaQueryWrapper = new LambdaQueryWrapper<>();
if(schemeApplicableStaff != null){
if(StringUtils.isNotEmpty(schemeApplicableStaff.getTitle())){
@@ -76,7 +62,7 @@
Page<SchemeApplicableStaff> page1 = schemeApplicableStaffMapper.selectPage(page, schemeApplicableStaffLambdaQueryWrapper);
List<Long> collect = page1.getRecords().stream().map(SchemeApplicableStaff::getId).collect(Collectors.toList());
if(CollectionUtils.isEmpty(collect)){
- return AjaxResult.success(page1);
+ return R.ok(page1);
}
List<SchemeInsuranceDetail> schemeInsuranceDetails = schemeInsuranceDetailMapper
.selectList(new LambdaQueryWrapper<SchemeInsuranceDetail>()
@@ -96,7 +82,7 @@
item.setDeptNames(sysDepts.stream().map(SysDept::getDeptName).collect(Collectors.joining(",")));
}
});
- return AjaxResult.success(page1);
+ return R.ok(page1);
}
public void setSchemeApplicableStaffUserInfo(SchemeApplicableStaff schemeApplicableStaff) {
@@ -117,12 +103,12 @@
}
@Override
- public AjaxResult add(SchemeApplicableStaff schemeApplicableStaff) {
+ public R<?> add(SchemeApplicableStaff schemeApplicableStaff) {
if(schemeApplicableStaff == null){
- return AjaxResult.error("鍙傛暟閿欒");
+ return R.fail("鍙傛暟閿欒");
}
if(CollectionUtils.isEmpty(schemeApplicableStaff.getSchemeInsuranceDetailList())){
- return AjaxResult.error("璇烽�夋嫨鏂规鏄庣粏");
+ return R.fail("璇烽�夋嫨鏂规鏄庣粏");
}
setSchemeApplicableStaffUserInfo(schemeApplicableStaff); //鏍规嵁閮ㄩ棬璁剧疆鐢ㄦ埛淇℃伅
int insert = schemeApplicableStaffMapper.insert(schemeApplicableStaff);
@@ -130,13 +116,13 @@
item.setSchemeId(schemeApplicableStaff.getId());
schemeInsuranceDetailMapper.insert(item);
});
- return AjaxResult.success(insert);
+ return R.ok(insert);
}
@Override
- public AjaxResult updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff) {
+ public R<?> updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff) {
if(schemeApplicableStaff == null){
- return AjaxResult.error("鍙傛暟閿欒");
+ return R.fail("鍙傛暟閿欒");
}
setSchemeApplicableStaffUserInfo(schemeApplicableStaff); //鏍规嵁閮ㄩ棬璁剧疆鐢ㄦ埛淇℃伅
int update = schemeApplicableStaffMapper.updateById(schemeApplicableStaff);
@@ -147,18 +133,18 @@
item.setSchemeId(schemeApplicableStaff.getId());
schemeInsuranceDetailMapper.insert(item);
});
- return AjaxResult.success(update);
+ return R.ok(update);
}
@Override
- public AjaxResult delete(List<Long> ids) {
+ public R<?> delete(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
- return AjaxResult.error("鍙傛暟閿欒");
+ return R.fail("鍙傛暟閿欒");
}
int delete = schemeApplicableStaffMapper.deleteBatchIds(ids);
schemeInsuranceDetailMapper.delete(new LambdaQueryWrapper<SchemeInsuranceDetail>()
.in(SchemeInsuranceDetail::getSchemeId, ids));
- return AjaxResult.success(delete);
+ return R.ok(delete);
}
/**
--
Gitblit v1.9.3