From ac93781b1fc572fdb388d99c3565b17ee087d887 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=95=B8=E9=9D=9E?= <8153694@qq.com>
Date: Sat, 15 Jul 2023 21:00:42 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=85=A7=E7=89=87=E6=B5=B7?=
 =?UTF-8?q?=E5=BA=B7=E4=B8=8B=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../mortals/xhx/busiz/h5/web/PerformApiController.java   | 4 +++-
 .../xhx/module/staff/service/impl/StaffServiceImpl.java  | 9 +++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java b/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java
index 0725ef38..8f34a928 100644
--- a/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java
+++ b/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/h5/web/PerformApiController.java
@@ -5,6 +5,7 @@ import java.math.BigDecimal;
 
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.RandomUtil;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.mortals.framework.common.Rest;
 import com.mortals.framework.exception.AppException;
@@ -377,7 +378,6 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
             if (PerformTypeEnum.鑰冨嫟缁╂晥.getValue().equals(performReq.getPerformType())) {
                 CheckAttendRecordEntity checkEntity = checkAttendRecordService.get(performReq.getId(), context);
                 BeanUtils.copyProperties(checkEntity, performDetailInfo, BeanUtil.getNullPropertyNames(checkEntity));
-
             } else if (PerformTypeEnum.璇勪环宸瘎缁╂晥.getValue().equals(performReq.getPerformType())) {
                 CheckReviewRecordEntity checkEntity = checkReviewRecordService.get(performReq.getId(), context);
                 BeanUtils.copyProperties(checkEntity, performDetailInfo, BeanUtil.getNullPropertyNames(checkEntity));
@@ -413,6 +413,8 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
             }
 
             rest.setData(performDetailInfo);
+            log.info("rspperformDetailInfo:{}", JSON.toJSONString(performDetailInfo));
+
             recordSysLog(request, busiDesc + " 銆愭垚鍔熴€�");
         } catch (Exception e) {
             log.error(busiDesc, e);
diff --git a/attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java b/attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
index 8985692a..f35ca859 100644
--- a/attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
+++ b/attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
@@ -50,6 +50,14 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
         //  return "1000"+data.getWorkNum();
     }
 
+    @Override
+    protected void saveBefore(StaffEntity entity, Context context) throws AppException {
+        int count = this.count(new StaffQuery().workNum(entity.getWorkNum()), context);
+        if(count>0){
+            throw new AppException("宸ュ彿閲嶅锛�");
+        }
+    }
+
     @Override
     public StaffInfoVo queryAll() {
         StaffInfoVo staffInfoVo = new StaffInfoVo();
@@ -103,6 +111,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
             userEntity.setUserType(UserType.WORK_PERSON.getValue());
             userEntity.setSiteIds("1");
             userEntity.setAreaCodes("511500000000");
+            userEntity.setMobile(entity.getPhoneNumber());
             userEntity.setStatus(UserStatus.NORMAL.getValue());
             userEntity.setCreateUserId(this.getContextUserId(context));
             userEntity.setCreateTime(new Date());
-- 
2.24.3