Browse Source

台账管理-不参加绩效考核人员名单表

chenshudong 1 month ago
parent
commit
8b401b8100

+ 6 - 0
airport-admin/pom.xml

@@ -91,6 +91,12 @@
91 91
             <artifactId>airport-equipment</artifactId>
92 92
         </dependency>
93 93
 
94
+        <!-- 台账管理模块-->
95
+        <dependency>
96
+            <groupId>com.sundot.airport</groupId>
97
+            <artifactId>airport-ledger</artifactId>
98
+        </dependency>
99
+
94 100
         <dependency>
95 101
             <groupId>org.projectlombok</groupId>
96 102
             <artifactId>lombok</artifactId>

+ 123 - 0
airport-admin/src/main/java/com/sundot/airport/web/controller/ledger/LedgerExcludedAssessmentStaffController.java

@@ -0,0 +1,123 @@
1
+package com.sundot.airport.web.controller.ledger;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+
6
+import org.springframework.security.access.prepost.PreAuthorize;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.web.bind.annotation.GetMapping;
9
+import org.springframework.web.bind.annotation.PostMapping;
10
+import org.springframework.web.bind.annotation.PutMapping;
11
+import org.springframework.web.bind.annotation.DeleteMapping;
12
+import org.springframework.web.bind.annotation.PathVariable;
13
+import org.springframework.web.bind.annotation.RequestBody;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RestController;
16
+import com.sundot.airport.common.annotation.Log;
17
+import com.sundot.airport.common.core.controller.BaseController;
18
+import com.sundot.airport.common.core.domain.AjaxResult;
19
+import com.sundot.airport.common.enums.BusinessType;
20
+import com.sundot.airport.ledger.domain.LedgerExcludedAssessmentStaff;
21
+import com.sundot.airport.ledger.service.ILedgerExcludedAssessmentStaffService;
22
+import com.sundot.airport.common.utils.poi.ExcelUtil;
23
+import com.sundot.airport.common.core.page.TableDataInfo;
24
+import org.springframework.web.multipart.MultipartFile;
25
+
26
+/**
27
+ * 不参加绩效考核人员名单Controller
28
+ *
29
+ * @author ruoyi
30
+ * @date 2026-06-29
31
+ */
32
+@RestController
33
+@RequestMapping("/ledger/excluded")
34
+public class LedgerExcludedAssessmentStaffController extends BaseController {
35
+    @Autowired
36
+    private ILedgerExcludedAssessmentStaffService ledgerExcludedAssessmentStaffService;
37
+
38
+    /**
39
+     * 查询不参加绩效考核人员名单列表
40
+     */
41
+    @PreAuthorize("@ss.hasPermi('ledger:excluded:list')")
42
+    @GetMapping("/list")
43
+    public TableDataInfo list(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff) {
44
+        startPage();
45
+        List<LedgerExcludedAssessmentStaff> list = ledgerExcludedAssessmentStaffService.selectLedgerExcludedAssessmentStaffList(ledgerExcludedAssessmentStaff);
46
+        return getDataTable(list);
47
+    }
48
+
49
+    /**
50
+     * 导出不参加绩效考核人员名单列表
51
+     */
52
+    @PreAuthorize("@ss.hasPermi('ledger:excluded:export')")
53
+    @Log(title = "不参加绩效考核人员名单", businessType = BusinessType.EXPORT)
54
+    @PostMapping("/export")
55
+    public void export(HttpServletResponse response, LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff) {
56
+        List<LedgerExcludedAssessmentStaff> list = ledgerExcludedAssessmentStaffService.selectLedgerExcludedAssessmentStaffList(ledgerExcludedAssessmentStaff);
57
+        ExcelUtil<LedgerExcludedAssessmentStaff> util = new ExcelUtil<LedgerExcludedAssessmentStaff>(LedgerExcludedAssessmentStaff.class);
58
+        util.exportExcel(response, list, "不参加绩效考核人员名单数据");
59
+    }
60
+
61
+    /**
62
+     * 获取不参加绩效考核人员名单详细信息
63
+     */
64
+    @PreAuthorize("@ss.hasPermi('ledger:excluded:query')")
65
+    @GetMapping(value = "/{id}")
66
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
67
+        return success(ledgerExcludedAssessmentStaffService.selectLedgerExcludedAssessmentStaffById(id));
68
+    }
69
+
70
+    /**
71
+     * 新增不参加绩效考核人员名单
72
+     */
73
+    @PreAuthorize("@ss.hasPermi('ledger:excluded:add')")
74
+    @Log(title = "不参加绩效考核人员名单", businessType = BusinessType.INSERT)
75
+    @PostMapping
76
+    public AjaxResult add(@RequestBody LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff) {
77
+        ledgerExcludedAssessmentStaff.setCreateBy(getUsername());
78
+        return toAjax(ledgerExcludedAssessmentStaffService.insertLedgerExcludedAssessmentStaff(ledgerExcludedAssessmentStaff));
79
+    }
80
+
81
+    /**
82
+     * 修改不参加绩效考核人员名单
83
+     */
84
+    @PreAuthorize("@ss.hasPermi('ledger:excluded:edit')")
85
+    @Log(title = "不参加绩效考核人员名单", businessType = BusinessType.UPDATE)
86
+    @PutMapping
87
+    public AjaxResult edit(@RequestBody LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff) {
88
+        ledgerExcludedAssessmentStaff.setUpdateBy(getUsername());
89
+        return toAjax(ledgerExcludedAssessmentStaffService.updateLedgerExcludedAssessmentStaff(ledgerExcludedAssessmentStaff));
90
+    }
91
+
92
+    /**
93
+     * 删除不参加绩效考核人员名单
94
+     */
95
+    @PreAuthorize("@ss.hasPermi('ledger:excluded:remove')")
96
+    @Log(title = "不参加绩效考核人员名单", businessType = BusinessType.DELETE)
97
+    @DeleteMapping("/{ids}")
98
+    public AjaxResult remove(@PathVariable Long[] ids) {
99
+        return toAjax(ledgerExcludedAssessmentStaffService.deleteLedgerExcludedAssessmentStaffByIds(ids));
100
+    }
101
+
102
+    /**
103
+     * 导入数据列表
104
+     */
105
+    @PreAuthorize("@ss.hasPermi('ledger:excluded:import')")
106
+    @Log(title = "导入数据列表", businessType = BusinessType.IMPORT)
107
+    @PostMapping("/importData")
108
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
109
+        ExcelUtil<LedgerExcludedAssessmentStaff> util = new ExcelUtil<>(LedgerExcludedAssessmentStaff.class);
110
+        List<LedgerExcludedAssessmentStaff> list = util.importExcel(file.getInputStream());
111
+        String message = ledgerExcludedAssessmentStaffService.importData(list, updateSupport);
112
+        return success(message);
113
+    }
114
+
115
+    /**
116
+     * 获取导入模板
117
+     */
118
+    @PostMapping("/importTemplate")
119
+    public void importTemplate(HttpServletResponse response) {
120
+        ExcelUtil<LedgerExcludedAssessmentStaff> util = new ExcelUtil<>(LedgerExcludedAssessmentStaff.class);
121
+        util.importTemplateExcel(response, "不参加绩效考核人员名单数据导入模板");
122
+    }
123
+}

+ 41 - 0
airport-ledger/pom.xml

@@ -0,0 +1,41 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <parent>
6
+        <groupId>com.sundot.airport</groupId>
7
+        <artifactId>airport</artifactId>
8
+        <version>3.9.0</version>
9
+    </parent>
10
+
11
+    <modelVersion>4.0.0</modelVersion>
12
+
13
+    <artifactId>airport-ledger</artifactId>
14
+
15
+    <description>
16
+        ledger台账管理模块
17
+    </description>
18
+
19
+    <dependencies>
20
+
21
+        <!-- 通用工具-->
22
+        <dependency>
23
+            <groupId>com.sundot.airport</groupId>
24
+            <artifactId>airport-common</artifactId>
25
+        </dependency>
26
+
27
+        <!-- 系统模块 -->
28
+        <dependency>
29
+            <groupId>com.sundot.airport</groupId>
30
+            <artifactId>airport-system</artifactId>
31
+        </dependency>
32
+
33
+        <dependency>
34
+            <groupId>org.projectlombok</groupId>
35
+            <artifactId>lombok</artifactId>
36
+            <scope>provided</scope>
37
+        </dependency>
38
+
39
+    </dependencies>
40
+
41
+</project>

+ 176 - 0
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerExcludedAssessmentStaff.java

@@ -0,0 +1,176 @@
1
+package com.sundot.airport.ledger.domain;
2
+
3
+import java.util.Date;
4
+
5
+import com.baomidou.mybatisplus.annotation.IdType;
6
+import com.baomidou.mybatisplus.annotation.TableId;
7
+import com.baomidou.mybatisplus.annotation.TableName;
8
+import com.fasterxml.jackson.annotation.JsonFormat;
9
+import org.apache.commons.lang3.builder.ToStringBuilder;
10
+import org.apache.commons.lang3.builder.ToStringStyle;
11
+import com.sundot.airport.common.annotation.Excel;
12
+import com.sundot.airport.common.core.domain.BaseEntity;
13
+import org.springframework.format.annotation.DateTimeFormat;
14
+
15
+/**
16
+ * 不参加绩效考核人员名单对象 ledger_excluded_assessment_staff
17
+ *
18
+ * @author ruoyi
19
+ * @date 2026-06-29
20
+ */
21
+@TableName("ledger_excluded_assessment_staff")
22
+public class LedgerExcludedAssessmentStaff extends BaseEntity {
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /** 租户号 */
26
+    private String tenantId;
27
+
28
+    /** 乐观锁 */
29
+    private Integer revision;
30
+
31
+    /** 主键 */
32
+    @TableId(type = IdType.AUTO)
33
+    private Long id;
34
+
35
+    /** 大队ID */
36
+    private Long brigadeId;
37
+
38
+    /** 大队名称 */
39
+    @Excel(name = "大队名称")
40
+    private String brigadeName;
41
+
42
+    /** 年度月份 */
43
+    @Excel(name = "年度月份", width = 30, dateFormat = "yyyy-MM")
44
+    @JsonFormat(pattern = "yyyy-MM")
45
+    @DateTimeFormat(pattern = "yyyy-MM")
46
+    private Date yearAndMonth;
47
+
48
+    /** 员工编号/身份证号 */
49
+    @Excel(name = "员工编号/身份证号")
50
+    private String code;
51
+
52
+    /** 用工形式 */
53
+    @Excel(name = "用工形式", readConverterExp = "DISPATCHED_WORKER=派遣工,REGULAR_EMPLOYEE=正式工,INTERN=实习生", combo = "派遣工,正式工,实习生")
54
+    private String employmentType;
55
+
56
+    /** 用户ID */
57
+    private Long userId;
58
+
59
+    /** 用户名称 */
60
+    @Excel(name = "用户名称")
61
+    private String userName;
62
+
63
+    /** 不参加考核原因 */
64
+    @Excel(name = "不参加考核原因")
65
+    private String reason;
66
+
67
+    public void setTenantId(String tenantId) {
68
+        this.tenantId = tenantId;
69
+    }
70
+
71
+    public String getTenantId() {
72
+        return tenantId;
73
+    }
74
+
75
+    public void setRevision(Integer revision) {
76
+        this.revision = revision;
77
+    }
78
+
79
+    public Integer getRevision() {
80
+        return revision;
81
+    }
82
+
83
+    public void setId(Long id) {
84
+        this.id = id;
85
+    }
86
+
87
+    public Long getId() {
88
+        return id;
89
+    }
90
+
91
+    public void setBrigadeId(Long brigadeId) {
92
+        this.brigadeId = brigadeId;
93
+    }
94
+
95
+    public Long getBrigadeId() {
96
+        return brigadeId;
97
+    }
98
+
99
+    public void setBrigadeName(String brigadeName) {
100
+        this.brigadeName = brigadeName;
101
+    }
102
+
103
+    public String getBrigadeName() {
104
+        return brigadeName;
105
+    }
106
+
107
+    public void setYearAndMonth(Date yearAndMonth) {
108
+        this.yearAndMonth = yearAndMonth;
109
+    }
110
+
111
+    public Date getYearAndMonth() {
112
+        return yearAndMonth;
113
+    }
114
+
115
+    public void setCode(String code) {
116
+        this.code = code;
117
+    }
118
+
119
+    public String getCode() {
120
+        return code;
121
+    }
122
+
123
+    public void setEmploymentType(String employmentType) {
124
+        this.employmentType = employmentType;
125
+    }
126
+
127
+    public String getEmploymentType() {
128
+        return employmentType;
129
+    }
130
+
131
+    public void setUserId(Long userId) {
132
+        this.userId = userId;
133
+    }
134
+
135
+    public Long getUserId() {
136
+        return userId;
137
+    }
138
+
139
+    public void setUserName(String userName) {
140
+        this.userName = userName;
141
+    }
142
+
143
+    public String getUserName() {
144
+        return userName;
145
+    }
146
+
147
+    public void setReason(String reason) {
148
+        this.reason = reason;
149
+    }
150
+
151
+    public String getReason() {
152
+        return reason;
153
+    }
154
+
155
+    @Override
156
+    public String toString() {
157
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
158
+                .append("tenantId", getTenantId())
159
+                .append("revision", getRevision())
160
+                .append("createBy", getCreateBy())
161
+                .append("createTime", getCreateTime())
162
+                .append("updateBy", getUpdateBy())
163
+                .append("updateTime", getUpdateTime())
164
+                .append("remark", getRemark())
165
+                .append("id", getId())
166
+                .append("brigadeId", getBrigadeId())
167
+                .append("brigadeName", getBrigadeName())
168
+                .append("yearAndMonth", getYearAndMonth())
169
+                .append("code", getCode())
170
+                .append("employmentType", getEmploymentType())
171
+                .append("userId", getUserId())
172
+                .append("userName", getUserName())
173
+                .append("reason", getReason())
174
+                .toString();
175
+    }
176
+}

+ 62 - 0
airport-ledger/src/main/java/com/sundot/airport/ledger/mapper/LedgerExcludedAssessmentStaffMapper.java

@@ -0,0 +1,62 @@
1
+package com.sundot.airport.ledger.mapper;
2
+
3
+import java.util.List;
4
+
5
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6
+import com.sundot.airport.ledger.domain.LedgerExcludedAssessmentStaff;
7
+
8
+/**
9
+ * 不参加绩效考核人员名单Mapper接口
10
+ *
11
+ * @author ruoyi
12
+ * @date 2026-06-29
13
+ */
14
+public interface LedgerExcludedAssessmentStaffMapper extends BaseMapper<LedgerExcludedAssessmentStaff> {
15
+    /**
16
+     * 查询不参加绩效考核人员名单
17
+     *
18
+     * @param id 不参加绩效考核人员名单主键
19
+     * @return 不参加绩效考核人员名单
20
+     */
21
+    public LedgerExcludedAssessmentStaff selectLedgerExcludedAssessmentStaffById(Long id);
22
+
23
+    /**
24
+     * 查询不参加绩效考核人员名单列表
25
+     *
26
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
27
+     * @return 不参加绩效考核人员名单集合
28
+     */
29
+    public List<LedgerExcludedAssessmentStaff> selectLedgerExcludedAssessmentStaffList(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff);
30
+
31
+    /**
32
+     * 新增不参加绩效考核人员名单
33
+     *
34
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
35
+     * @return 结果
36
+     */
37
+    public int insertLedgerExcludedAssessmentStaff(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff);
38
+
39
+    /**
40
+     * 修改不参加绩效考核人员名单
41
+     *
42
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
43
+     * @return 结果
44
+     */
45
+    public int updateLedgerExcludedAssessmentStaff(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff);
46
+
47
+    /**
48
+     * 删除不参加绩效考核人员名单
49
+     *
50
+     * @param id 不参加绩效考核人员名单主键
51
+     * @return 结果
52
+     */
53
+    public int deleteLedgerExcludedAssessmentStaffById(Long id);
54
+
55
+    /**
56
+     * 批量删除不参加绩效考核人员名单
57
+     *
58
+     * @param ids 需要删除的数据主键集合
59
+     * @return 结果
60
+     */
61
+    public int deleteLedgerExcludedAssessmentStaffByIds(Long[] ids);
62
+}

+ 71 - 0
airport-ledger/src/main/java/com/sundot/airport/ledger/service/ILedgerExcludedAssessmentStaffService.java

@@ -0,0 +1,71 @@
1
+package com.sundot.airport.ledger.service;
2
+
3
+import java.util.List;
4
+
5
+import com.baomidou.mybatisplus.extension.service.IService;
6
+import com.sundot.airport.ledger.domain.LedgerExcludedAssessmentStaff;
7
+
8
+/**
9
+ * 不参加绩效考核人员名单Service接口
10
+ *
11
+ * @author ruoyi
12
+ * @date 2026-06-29
13
+ */
14
+public interface ILedgerExcludedAssessmentStaffService extends IService<LedgerExcludedAssessmentStaff> {
15
+    /**
16
+     * 查询不参加绩效考核人员名单
17
+     *
18
+     * @param id 不参加绩效考核人员名单主键
19
+     * @return 不参加绩效考核人员名单
20
+     */
21
+    public LedgerExcludedAssessmentStaff selectLedgerExcludedAssessmentStaffById(Long id);
22
+
23
+    /**
24
+     * 查询不参加绩效考核人员名单列表
25
+     *
26
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
27
+     * @return 不参加绩效考核人员名单集合
28
+     */
29
+    public List<LedgerExcludedAssessmentStaff> selectLedgerExcludedAssessmentStaffList(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff);
30
+
31
+    /**
32
+     * 新增不参加绩效考核人员名单
33
+     *
34
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
35
+     * @return 结果
36
+     */
37
+    public int insertLedgerExcludedAssessmentStaff(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff);
38
+
39
+    /**
40
+     * 修改不参加绩效考核人员名单
41
+     *
42
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
43
+     * @return 结果
44
+     */
45
+    public int updateLedgerExcludedAssessmentStaff(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff);
46
+
47
+    /**
48
+     * 批量删除不参加绩效考核人员名单
49
+     *
50
+     * @param ids 需要删除的不参加绩效考核人员名单主键集合
51
+     * @return 结果
52
+     */
53
+    public int deleteLedgerExcludedAssessmentStaffByIds(Long[] ids);
54
+
55
+    /**
56
+     * 删除不参加绩效考核人员名单信息
57
+     *
58
+     * @param id 不参加绩效考核人员名单主键
59
+     * @return 结果
60
+     */
61
+    public int deleteLedgerExcludedAssessmentStaffById(Long id);
62
+
63
+    /**
64
+     * 导入数据列表
65
+     *
66
+     * @param list          数据列表
67
+     * @param updateSupport 是否更新支持
68
+     * @return 导入结果信息
69
+     */
70
+    public String importData(List<LedgerExcludedAssessmentStaff> list, boolean updateSupport);
71
+}

+ 253 - 0
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerExcludedAssessmentStaffServiceImpl.java

@@ -0,0 +1,253 @@
1
+package com.sundot.airport.ledger.service.impl;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+import java.util.stream.Collectors;
6
+
7
+import cn.hutool.core.collection.CollUtil;
8
+import cn.hutool.core.util.ObjUtil;
9
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
10
+import com.sundot.airport.common.core.domain.entity.SysDept;
11
+import com.sundot.airport.common.core.domain.entity.SysDictData;
12
+import com.sundot.airport.common.core.domain.entity.SysUser;
13
+import com.sundot.airport.common.enums.DeptTypeEnum;
14
+import com.sundot.airport.common.exception.ServiceException;
15
+import com.sundot.airport.common.utils.DateUtils;
16
+import com.sundot.airport.system.service.ISysDeptService;
17
+import com.sundot.airport.system.service.ISysDictDataService;
18
+import com.sundot.airport.system.service.ISysUserService;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.stereotype.Service;
21
+import com.sundot.airport.ledger.mapper.LedgerExcludedAssessmentStaffMapper;
22
+import com.sundot.airport.ledger.domain.LedgerExcludedAssessmentStaff;
23
+import com.sundot.airport.ledger.service.ILedgerExcludedAssessmentStaffService;
24
+import org.springframework.transaction.annotation.Transactional;
25
+
26
+/**
27
+ * 不参加绩效考核人员名单Service业务层处理
28
+ *
29
+ * @author ruoyi
30
+ * @date 2026-06-29
31
+ */
32
+@Service
33
+public class LedgerExcludedAssessmentStaffServiceImpl extends ServiceImpl<LedgerExcludedAssessmentStaffMapper, LedgerExcludedAssessmentStaff> implements ILedgerExcludedAssessmentStaffService {
34
+    @Autowired
35
+    private LedgerExcludedAssessmentStaffMapper ledgerExcludedAssessmentStaffMapper;
36
+    @Autowired
37
+    private ISysDeptService sysDeptService;
38
+    @Autowired
39
+    private ISysUserService sysUserService;
40
+    @Autowired
41
+    private ISysDictDataService sysDictDataService;
42
+
43
+    /**
44
+     * 查询不参加绩效考核人员名单
45
+     *
46
+     * @param id 不参加绩效考核人员名单主键
47
+     * @return 不参加绩效考核人员名单
48
+     */
49
+    @Override
50
+    public LedgerExcludedAssessmentStaff selectLedgerExcludedAssessmentStaffById(Long id) {
51
+        return ledgerExcludedAssessmentStaffMapper.selectLedgerExcludedAssessmentStaffById(id);
52
+    }
53
+
54
+    /**
55
+     * 查询不参加绩效考核人员名单列表
56
+     *
57
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
58
+     * @return 不参加绩效考核人员名单
59
+     */
60
+    @Override
61
+    public List<LedgerExcludedAssessmentStaff> selectLedgerExcludedAssessmentStaffList(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff) {
62
+        return ledgerExcludedAssessmentStaffMapper.selectLedgerExcludedAssessmentStaffList(ledgerExcludedAssessmentStaff);
63
+    }
64
+
65
+    /**
66
+     * 新增不参加绩效考核人员名单
67
+     *
68
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
69
+     * @return 结果
70
+     */
71
+    @Override
72
+    public int insertLedgerExcludedAssessmentStaff(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff) {
73
+        ledgerExcludedAssessmentStaff.setCreateTime(DateUtils.getNowDate());
74
+        return ledgerExcludedAssessmentStaffMapper.insertLedgerExcludedAssessmentStaff(ledgerExcludedAssessmentStaff);
75
+    }
76
+
77
+    /**
78
+     * 修改不参加绩效考核人员名单
79
+     *
80
+     * @param ledgerExcludedAssessmentStaff 不参加绩效考核人员名单
81
+     * @return 结果
82
+     */
83
+    @Override
84
+    public int updateLedgerExcludedAssessmentStaff(LedgerExcludedAssessmentStaff ledgerExcludedAssessmentStaff) {
85
+        ledgerExcludedAssessmentStaff.setUpdateTime(DateUtils.getNowDate());
86
+        return ledgerExcludedAssessmentStaffMapper.updateLedgerExcludedAssessmentStaff(ledgerExcludedAssessmentStaff);
87
+    }
88
+
89
+    /**
90
+     * 批量删除不参加绩效考核人员名单
91
+     *
92
+     * @param ids 需要删除的不参加绩效考核人员名单主键
93
+     * @return 结果
94
+     */
95
+    @Override
96
+    public int deleteLedgerExcludedAssessmentStaffByIds(Long[] ids) {
97
+        return ledgerExcludedAssessmentStaffMapper.deleteLedgerExcludedAssessmentStaffByIds(ids);
98
+    }
99
+
100
+    /**
101
+     * 删除不参加绩效考核人员名单信息
102
+     *
103
+     * @param id 不参加绩效考核人员名单主键
104
+     * @return 结果
105
+     */
106
+    @Override
107
+    public int deleteLedgerExcludedAssessmentStaffById(Long id) {
108
+        return ledgerExcludedAssessmentStaffMapper.deleteLedgerExcludedAssessmentStaffById(id);
109
+    }
110
+
111
+    /**
112
+     * 导入数据
113
+     *
114
+     * @param list            数据列表
115
+     * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
116
+     * @return 结果
117
+     */
118
+    @Transactional(rollbackFor = Exception.class)
119
+    @Override
120
+    public String importData(List<LedgerExcludedAssessmentStaff> list, boolean isUpdateSupport) {
121
+        if (CollUtil.isEmpty(list)) {
122
+            throw new ServiceException("导入设备台账数据不能为空!");
123
+        }
124
+
125
+        // 用户
126
+        List<SysUser> sysUserListAll = sysUserService.selectUserAll();
127
+        Map<String, Long> sysUserMap = sysUserListAll.stream().collect(Collectors.toMap(SysUser::getNickName, SysUser::getUserId, (oldValue, newValue) -> newValue));
128
+
129
+        // 大队
130
+        SysDept sysDeptQuery = new SysDept();
131
+        sysDeptQuery.setStatus("0");
132
+        sysDeptQuery.setDelFlag("0");
133
+        sysDeptQuery.setDeptType(DeptTypeEnum.BRIGADE.getCode());
134
+        List<SysDept> sysDeptList = sysDeptService.selectDeptInfoAll(sysDeptQuery);
135
+        Map<String, Long> sysDeptMap = sysDeptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldValue, newValue) -> newValue));
136
+
137
+        // 用工形式
138
+        SysDictData employmentTypeQuery = new SysDictData();
139
+        employmentTypeQuery.setDictType("employment_type");
140
+        List<SysDictData> employmentTypeList = sysDictDataService.selectDictDataList(employmentTypeQuery);
141
+        Map<String, String> employmentTypeMap = employmentTypeList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
142
+
143
+        int successNum = 0;
144
+        int failureNum = 0;
145
+        StringBuilder successMsg = new StringBuilder();
146
+        StringBuilder failureMsg = new StringBuilder();
147
+
148
+        for (LedgerExcludedAssessmentStaff data : list) {
149
+            // 根据名称填充ID字段
150
+            fillIdsByName(data, sysUserMap, sysDeptMap, employmentTypeMap);
151
+            try {
152
+                // 必填字段校验
153
+                if (ObjUtil.isNull(data.getYearAndMonth())) {
154
+                    failureNum++;
155
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】年度月份不能为空");
156
+                    continue;
157
+                }
158
+                if (ObjUtil.isNull(data.getUserName())) {
159
+                    failureNum++;
160
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】用户名称不能为空");
161
+                    continue;
162
+                }
163
+                if (ObjUtil.isNull(data.getBrigadeName())) {
164
+                    failureNum++;
165
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】大队名称不能为空");
166
+                    continue;
167
+                }
168
+                if (ObjUtil.isNull(data.getCode())) {
169
+                    failureNum++;
170
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】员工编号/身份证号不能为空");
171
+                    continue;
172
+                }
173
+                if (ObjUtil.isNull(data.getReason())) {
174
+                    failureNum++;
175
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】不参加考核原因不能为空");
176
+                    continue;
177
+                }
178
+
179
+                // 数据准确性校验
180
+                if (ObjUtil.isNull(data.getUserId())) {
181
+                    failureNum++;
182
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】用户数据错误");
183
+                    continue;
184
+                }
185
+                if (ObjUtil.isNull(data.getBrigadeId())) {
186
+                    failureNum++;
187
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】大队数据错误");
188
+                    continue;
189
+                }
190
+                if (ObjUtil.isNull(data.getEmploymentType())) {
191
+                    failureNum++;
192
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】用工形式数据错误");
193
+                    continue;
194
+                }
195
+
196
+                // 查询是否已存在(根据【年度月份+用户ID】唯一)
197
+                LedgerExcludedAssessmentStaff queryParam = new LedgerExcludedAssessmentStaff();
198
+                queryParam.setYearAndMonth(data.getYearAndMonth());
199
+                queryParam.setUserId(data.getUserId());
200
+                List<LedgerExcludedAssessmentStaff> existingList = ledgerExcludedAssessmentStaffMapper.selectLedgerExcludedAssessmentStaffList(queryParam);
201
+
202
+                if (CollUtil.isEmpty(existingList)) {
203
+                    data.setCreateTime(DateUtils.getNowDate());
204
+                    ledgerExcludedAssessmentStaffMapper.insertLedgerExcludedAssessmentStaff(data);
205
+                    successNum++;
206
+                    successMsg.append("<br/>" + successNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】导入成功");
207
+                } else if (isUpdateSupport) {
208
+                    LedgerExcludedAssessmentStaff old = existingList.get(0);
209
+                    data.setId(old.getId());
210
+                    data.setUpdateTime(DateUtils.getNowDate());
211
+                    ledgerExcludedAssessmentStaffMapper.updateLedgerExcludedAssessmentStaff(data);
212
+                    successNum++;
213
+                    successMsg.append("<br/>" + successNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】更新成功");
214
+                } else {
215
+                    failureNum++;
216
+                    failureMsg.append("<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】已存在");
217
+                }
218
+            } catch (Exception e) {
219
+                failureNum++;
220
+                String msg = "<br/>" + failureNum + "、年度月份【" + data.getYearAndMonth() + "】、用户名称【" + data.getUserName() + "】导入失败:";
221
+                failureMsg.append(msg + e.getMessage());
222
+            }
223
+        }
224
+
225
+        if (failureNum > 0) {
226
+            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
227
+            throw new ServiceException(failureMsg.toString());
228
+        } else {
229
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
230
+        }
231
+        return successMsg.toString();
232
+    }
233
+
234
+    /**
235
+     * 根据名称填充ID字段
236
+     *
237
+     * @param data 速率数据
238
+     */
239
+    private void fillIdsByName(LedgerExcludedAssessmentStaff data, Map<String, Long> sysUserMap, Map<String, Long> sysDeptMap, Map<String, String> employmentTypeMap) {
240
+        // 用户ID
241
+        if (ObjUtil.isNotNull(data.getUserName())) {
242
+            data.setUserId(sysUserMap.get(data.getUserName()));
243
+        }
244
+        // 大队ID
245
+        if (ObjUtil.isNotNull(data.getBrigadeName())) {
246
+            data.setBrigadeId(sysDeptMap.get(data.getBrigadeName()));
247
+        }
248
+        // 用工形式
249
+        if (ObjUtil.isNotNull(data.getEmploymentType())) {
250
+            data.setEmploymentType(employmentTypeMap.get(data.getEmploymentType()));
251
+        }
252
+    }
253
+}

+ 145 - 0
airport-ledger/src/main/resources/mapper/ledger/LedgerExcludedAssessmentStaffMapper.xml

@@ -0,0 +1,145 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.sundot.airport.ledger.mapper.LedgerExcludedAssessmentStaffMapper">
6
+
7
+    <resultMap type="LedgerExcludedAssessmentStaff" id="LedgerExcludedAssessmentStaffResult">
8
+        <result property="tenantId" column="tenant_id"/>
9
+        <result property="revision" column="revision"/>
10
+        <result property="createBy" column="create_by"/>
11
+        <result property="createTime" column="create_time"/>
12
+        <result property="updateBy" column="update_by"/>
13
+        <result property="updateTime" column="update_time"/>
14
+        <result property="remark" column="remark"/>
15
+        <result property="id" column="id"/>
16
+        <result property="brigadeId" column="brigade_id"/>
17
+        <result property="brigadeName" column="brigade_name"/>
18
+        <result property="yearAndMonth" column="year_and_month"/>
19
+        <result property="code" column="code"/>
20
+        <result property="employmentType" column="employment_type"/>
21
+        <result property="userId" column="user_id"/>
22
+        <result property="userName" column="user_name"/>
23
+        <result property="reason" column="reason"/>
24
+    </resultMap>
25
+
26
+    <sql id="selectLedgerExcludedAssessmentStaffVo">
27
+        select tenant_id,
28
+               revision,
29
+               create_by,
30
+               create_time,
31
+               update_by,
32
+               update_time,
33
+               remark,
34
+               id,
35
+               brigade_id,
36
+               brigade_name,
37
+               year_and_month,
38
+               code,
39
+               employment_type,
40
+               user_id,
41
+               user_name,
42
+               reason
43
+        from ledger_excluded_assessment_staff
44
+    </sql>
45
+
46
+    <select id="selectLedgerExcludedAssessmentStaffList" parameterType="LedgerExcludedAssessmentStaff"
47
+            resultMap="LedgerExcludedAssessmentStaffResult">
48
+        <include refid="selectLedgerExcludedAssessmentStaffVo"/>
49
+        <where>
50
+            <if test="tenantId != null  and tenantId != ''">and tenant_id = #{tenantId}</if>
51
+            <if test="revision != null ">and revision = #{revision}</if>
52
+            <if test="brigadeId != null ">and brigade_id = #{brigadeId}</if>
53
+            <if test="brigadeName != null  and brigadeName != ''">and brigade_name like concat('%', #{brigadeName},
54
+                '%')
55
+            </if>
56
+            <if test="yearAndMonth != null ">and year_and_month = #{yearAndMonth}</if>
57
+            <if test="code != null  and code != ''">and code = #{code}</if>
58
+            <if test="employmentType != null  and employmentType != ''">and employment_type = #{employmentType}</if>
59
+            <if test="userId != null ">and user_id = #{userId}</if>
60
+            <if test="userName != null  and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
61
+            <if test="reason != null  and reason != ''">and reason = #{reason}</if>
62
+        </where>
63
+        order by create_time desc
64
+    </select>
65
+
66
+    <select id="selectLedgerExcludedAssessmentStaffById" parameterType="Long"
67
+            resultMap="LedgerExcludedAssessmentStaffResult">
68
+        <include refid="selectLedgerExcludedAssessmentStaffVo"/>
69
+        where id = #{id}
70
+    </select>
71
+
72
+    <insert id="insertLedgerExcludedAssessmentStaff" parameterType="LedgerExcludedAssessmentStaff"
73
+            useGeneratedKeys="true" keyProperty="id">
74
+        insert into ledger_excluded_assessment_staff
75
+        <trim prefix="(" suffix=")" suffixOverrides=",">
76
+            <if test="tenantId != null">tenant_id,</if>
77
+            <if test="revision != null">revision,</if>
78
+            <if test="createBy != null">create_by,</if>
79
+            <if test="createTime != null">create_time,</if>
80
+            <if test="updateBy != null">update_by,</if>
81
+            <if test="updateTime != null">update_time,</if>
82
+            <if test="remark != null">remark,</if>
83
+            <if test="brigadeId != null">brigade_id,</if>
84
+            <if test="brigadeName != null">brigade_name,</if>
85
+            <if test="yearAndMonth != null">year_and_month,</if>
86
+            <if test="code != null">code,</if>
87
+            <if test="employmentType != null">employment_type,</if>
88
+            <if test="userId != null">user_id,</if>
89
+            <if test="userName != null">user_name,</if>
90
+            <if test="reason != null">reason,</if>
91
+        </trim>
92
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
93
+            <if test="tenantId != null">#{tenantId},</if>
94
+            <if test="revision != null">#{revision},</if>
95
+            <if test="createBy != null">#{createBy},</if>
96
+            <if test="createTime != null">#{createTime},</if>
97
+            <if test="updateBy != null">#{updateBy},</if>
98
+            <if test="updateTime != null">#{updateTime},</if>
99
+            <if test="remark != null">#{remark},</if>
100
+            <if test="brigadeId != null">#{brigadeId},</if>
101
+            <if test="brigadeName != null">#{brigadeName},</if>
102
+            <if test="yearAndMonth != null">#{yearAndMonth},</if>
103
+            <if test="code != null">#{code},</if>
104
+            <if test="employmentType != null">#{employmentType},</if>
105
+            <if test="userId != null">#{userId},</if>
106
+            <if test="userName != null">#{userName},</if>
107
+            <if test="reason != null">#{reason},</if>
108
+        </trim>
109
+    </insert>
110
+
111
+    <update id="updateLedgerExcludedAssessmentStaff" parameterType="LedgerExcludedAssessmentStaff">
112
+        update ledger_excluded_assessment_staff
113
+        <trim prefix="SET" suffixOverrides=",">
114
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
115
+            <if test="revision != null">revision = #{revision},</if>
116
+            <if test="createBy != null">create_by = #{createBy},</if>
117
+            <if test="createTime != null">create_time = #{createTime},</if>
118
+            <if test="updateBy != null">update_by = #{updateBy},</if>
119
+            <if test="updateTime != null">update_time = #{updateTime},</if>
120
+            <if test="remark != null">remark = #{remark},</if>
121
+            <if test="brigadeId != null">brigade_id = #{brigadeId},</if>
122
+            <if test="brigadeName != null">brigade_name = #{brigadeName},</if>
123
+            <if test="yearAndMonth != null">year_and_month = #{yearAndMonth},</if>
124
+            <if test="code != null">code = #{code},</if>
125
+            <if test="employmentType != null">employment_type = #{employmentType},</if>
126
+            <if test="userId != null">user_id = #{userId},</if>
127
+            <if test="userName != null">user_name = #{userName},</if>
128
+            <if test="reason != null">reason = #{reason},</if>
129
+        </trim>
130
+        where id = #{id}
131
+    </update>
132
+
133
+    <delete id="deleteLedgerExcludedAssessmentStaffById" parameterType="Long">
134
+        delete
135
+        from ledger_excluded_assessment_staff
136
+        where id = #{id}
137
+    </delete>
138
+
139
+    <delete id="deleteLedgerExcludedAssessmentStaffByIds" parameterType="String">
140
+        delete from ledger_excluded_assessment_staff where id in
141
+        <foreach item="id" collection="array" open="(" separator="," close=")">
142
+            #{id}
143
+        </foreach>
144
+    </delete>
145
+</mapper>

+ 8 - 0
pom.xml

@@ -274,6 +274,13 @@
274 274
                 <version>${airport.version}</version>
275 275
             </dependency>
276 276
 
277
+            <!-- 台账管理模块-->
278
+            <dependency>
279
+                <groupId>com.sundot.airport</groupId>
280
+                <artifactId>airport-ledger</artifactId>
281
+                <version>${airport.version}</version>
282
+            </dependency>
283
+
277 284
             <dependency>
278 285
                 <groupId>org.projectlombok</groupId>
279 286
                 <artifactId>lombok</artifactId>
@@ -305,6 +312,7 @@
305 312
         <module>airport-blocked</module>
306 313
         <module>airport-personnel</module>
307 314
         <module>airport-equipment</module>
315
+        <module>airport-ledger</module>
308 316
     </modules>
309 317
     <packaging>pom</packaging>
310 318