From b3a30267d5fcb3e2a4f19441b8667c728fd28609 Mon Sep 17 00:00:00 2001
From: zhaowenxuan <chacca165@163.com>
Date: 星期五, 18 七月 2025 14:37:39 +0800
Subject: [PATCH] 报告弃检重复问题

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java |   48 +++++++++++++++++++-----------------------------
 1 files changed, 19 insertions(+), 29 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
index def672b..86bb882 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -269,6 +269,7 @@
 
 //                    if(null !=tjReservation.getCompanyId())tjCustomer1.setDictCompId(Long.valueOf(tjReservation.getCompanyId()));
                     if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany());
+                    if(null !=tjReservation.getDepartment())tjCustomer1.setDepartment(tjReservation.getDepartment());
 
 //                    tjCustomerService.updateById(tjCustomer1);
 
@@ -304,7 +305,7 @@
                     tjCustomer.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),""));
                     if(null !=tjReservation.getCompanyId())tjCustomer.setCompId(tjReservation.getCompanyId());
                     if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany());
-
+                    if(null !=tjReservation.getDepartment())tjCustomer.setDepartment(tjReservation.getDepartment());
                     if (null != key && key.equals("Y")) {
                         AjaxResult result = controller.Outpincreateapply(tjCustomer);
                         String result1 = getAjaxResult(result);
@@ -329,18 +330,16 @@
                             }
                         }
                     } else if(null != s && s.equalsIgnoreCase("Y")) {
-                        TjCustomer requestCommonHisApi = isRequestCommonHisApi(tjCustomer);
-                        if (null !=requestCommonHisApi){
-                            tjCustomerService.save(requestCommonHisApi);
-                        }
-                    }else {
-                        tjCustomerService.save(tjCustomer);
+                        tjCustomer = isRequestCommonHisApi(tjCustomer);
                     }
-                    tjCustomer.setTeamNo(tjReservation.getTeamNo());
-                    tjCustomer.setCompId(tjReservation.getCompanyId());
-                    tjCustomer.setReservationId(tjReservation.getId());
-                    tjCustomer.setDiscount(tjReservation.getDiscount());
-                    tjCustomer.setGroupingId(tjReservation.getGroupingId());
+                    if(null != tjCustomer){
+                        tjCustomerService.save(tjCustomer);
+                        tjCustomer.setTeamNo(tjReservation.getTeamNo());
+                        tjCustomer.setCompId(tjReservation.getCompanyId());
+                        tjCustomer.setReservationId(tjReservation.getId());
+                        tjCustomer.setDiscount(tjReservation.getDiscount());
+                        tjCustomer.setGroupingId(tjReservation.getGroupingId());
+                    }
                     return success(tjCustomer);
                 }
 
@@ -353,16 +352,7 @@
             if (null == tjCustomerServiceOne) {
                 return AjaxResult.error("璇ヤ汉鍛樹俊鎭笉瀛樺湪璇峰厛杩涜鐧昏!!!");
             }
-//            if (null != key && key.equals("Y")) {
-                String cardId = tjCustomerServiceOne.getCardId();
-                if (null != cardId && !cardId.equals("0")) {
-//                    int i = tjOrderService.selectTjOrderByCardId(cardId);
-//                    if (i > 0) {
-//                        return AjaxResult.error("涓嶅彲閲嶅绛惧埌");
-//                    }
-                }
 
-//            }
             if(!tjCustomerServiceOne.getAge().equals(String.valueOf(DateUtil.ageOfNow(tjCustomerServiceOne.getCusBrithday())))){
                 tjCustomerServiceOne.setAge(String.valueOf(DateUtil.ageOfNow(tjCustomerServiceOne.getCusBrithday())));
                 tjCustomerService.updateById(tjCustomerServiceOne);
@@ -492,24 +482,24 @@
                 if(sfjysfzh.equalsIgnoreCase("Y")){
                     if(cusIdcard.length()==18){
                         b = MatchUtils.isIdCard(cusIdcard);
+                    }else {
+                        return AjaxResult.error("璇疯緭鍏ュ崄鍏綅鍙风殑璇佷欢鍙�!");
                     }
                 }
             }
-//            else {
-//                if(cusIdcard.length()==9){
-//                    b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType());
-//                }
-//
-//            }
         } else {
             return AjaxResult.error("璇烽�夋嫨璇佷欢绫诲瀷");
         }
-        if (!b) return AjaxResult.error("璇佷欢鍙锋湁璇�");
+        if (!b) return AjaxResult.error("璇佷欢鍙锋湁璇�,璇锋鏌ヨ瘉浠跺彿鏄惁鏈夋晥!");
+
 
         //鍒ゆ柇韬唤璇佸彿鏍煎紡鏄惁姝g‘
+        if (tjCustomer.getCusPhone().length() != 11)
+            return AjaxResult.error("璇疯緭鍏ュ崄涓�浣嶅彿鐨勬墜鏈哄彿!");
+
         if(sfjysjh.equalsIgnoreCase("Y")){
             if (!(MatchUtils.isMobileNO(tjCustomer.getCusPhone())))
-                return AjaxResult.error("鎵嬫満鍙烽敊璇�");
+                return AjaxResult.error("鎵嬫満鍙烽敊璇�,璇锋鏌ユ墜鏈哄彿鏄惁鏈夋晥!");
         }
 
         LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>();

--
Gitblit v1.8.0