From 9c02950486e2654149dcca932d944ccf1a29398e Mon Sep 17 00:00:00 2001
From: ty <1577900710@qq.com>
Date: Tue, 2 Jan 2024 15:49:45 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../hzims/basic/entity/PersonManagemetEntity.java | 6 +--
.../controller/PresonManagementController.java | 8 +---
.../hzims/basic/mapper/PersonManagemetMapper.xml | 6 +--
.../basic/service/IImsPresonManagementService.java | 3 +-
.../service/impl/PresonManagementServiceImpl.java | 55 +++++++++++++---------
5 files changed, 43 insertions(+), 35 deletions(-)
diff --git a/hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java b/hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java
index 7dec2fa..44bb68f 100644
--- a/hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java
+++ b/hzims-service-api/basic-api/src/main/java/com/hnac/hzims/basic/entity/PersonManagemetEntity.java
@@ -9,6 +9,8 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.mp.support.QueryField;
import org.springblade.core.tenant.mp.TenantEntity;
+import java.io.Serializable;
+
/**
* 实体类
@@ -18,9 +20,7 @@ import org.springblade.core.tenant.mp.TenantEntity;
@TableName("hzims_person_managemet")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "人员管理表", description = "人员管理表")
-public class PersonManagemetEntity extends TenantEntity {
-
- private static final long serialVersionUID = 1L;
+public class PersonManagemetEntity extends TenantEntity implements Serializable {
/**
* 用户ID
diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
index c68768d..4c6f7ff 100644
--- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
+++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
@@ -61,12 +61,8 @@ public class PresonManagementController extends BladeController {
@PostMapping ("/submit")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "增加", notes = "传入imsDutyClass")
- public R submit(@RequestBody PersonManagemetVo personManagemetVo) {
- Boolean submit = iImsPresonManagementService.submit(personManagemetVo);
- if (submit){
- return R.success("保存成功");
- }
- return R.fail("保存失败");
+ public R submit(@RequestBody PersonManagemetVo personManagemetVo) throws IllegalAccessException {
+ return iImsPresonManagementService.submit(personManagemetVo);
}
/**
diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml
index ca4e02d..e4c173b 100644
--- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml
+++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.xml
@@ -19,7 +19,7 @@
-
+
@@ -27,8 +27,8 @@
@@ -95,5 +96,45 @@
and b.status =#{status}
+
+
diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java
index 2ff68b8..408e4be 100644
--- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java
+++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/IImsPresonManagementService.java
@@ -3,10 +3,13 @@ package com.hnac.hzims.basic.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.basic.entity.PersonManagemetEntity;
+import com.hnac.hzims.basic.vo.PersonManagemetExportVo;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
+import java.util.List;
+
/**
* 服务类
*
@@ -19,4 +22,6 @@ public interface IImsPresonManagementService extends IService exportPersonManagemet(PersonManagemetVo personManagemetVo);
}
diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java
index e73e684..830a440 100644
--- a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java
+++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/service/impl/PresonManagementServiceImpl.java
@@ -9,6 +9,8 @@ import com.hnac.hzims.basic.entity.PersonManagemetEntity;
import com.hnac.hzims.basic.mapper.PersonManagemetMapper;
import com.hnac.hzims.basic.service.IImsCertificatetService;
import com.hnac.hzims.basic.service.IImsPresonManagementService;
+import com.hnac.hzims.basic.utils.CertificatetType;
+import com.hnac.hzims.basic.vo.PersonManagemetExportVo;
import com.hnac.hzims.basic.vo.PersonManagemetVo;
import com.hnac.hzims.common.logs.utils.StringUtils;
import lombok.RequiredArgsConstructor;
@@ -131,5 +133,22 @@ public class PresonManagementServiceImpl extends BaseServiceImpl exportPersonManagemet(PersonManagemetVo personManagemetVo) {
+ List list = baseMapper.exportPersonManagemet(personManagemetVo.getType(), personManagemetVo.getDeadStartTime(), personManagemetVo.getDeadTime(),
+ personManagemetVo.getName(), personManagemetVo.getUnitName(), personManagemetVo.getSex(), personManagemetVo.getJob(),
+ personManagemetVo.getAcademicTitle(), personManagemetVo.getStatus());
+ list = list.stream().map(s -> {
+ CertificatetType[] types = CertificatetType.values();
+ for (int i = 0; i < types.length; i++) {
+ if (types[i].getValue().equals(s.getType())) {
+ s.setType(types[i].getKey());
+ }
+ }
+ return s;
+ }).collect(Collectors.toList());
+ return list;
+ }
+
}
diff --git a/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/utils/CertificatetType.java b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/utils/CertificatetType.java
new file mode 100644
index 0000000..041f5fe
--- /dev/null
+++ b/hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/utils/CertificatetType.java
@@ -0,0 +1,41 @@
+package com.hnac.hzims.basic.utils;
+
+
+import lombok.Getter;
+
+/**
+ * 证书类型
+ * @author ty
+ */
+public enum CertificatetType
+{
+ /**
+ * 电工证
+ */
+ Electrician("1","电工证"),
+
+ /**
+ * 安全员证
+ */
+ Safety("2","安全员证"),
+
+ /**
+ * 登高证
+ */
+ Climbe("3","登高证"),
+
+ /**
+ * 桥机证
+ */
+ Bridge("4","桥机证");
+ @Getter
+ private String value;
+
+ @Getter
+ private String key;
+
+ CertificatetType(String value, String key){
+ this.key = key;
+ this.value = value;
+ }
+}