From 1917e1b69a8480654c086df54e32b0be94a88e7d Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期一, 17 三月 2025 17:51:35 +0800
Subject: [PATCH] zjh20250317

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 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 abe7b43..e7c76b4 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
@@ -241,7 +241,11 @@
                     tjCustomer1.setTjType(tjReservation.getTjType());
                     tjCustomer1.setCusName(tjReservation.getName());
                     tjCustomer1.setCusSex(Long.valueOf(tjReservation.getSex()));
-                    tjCustomer1.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    try {
+                        tjCustomer1.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    } catch (Exception e) {
+                        return AjaxResult.error("韬唤璇佸彿涓嶆纭�");
+                    }
                     tjCustomer1.setCusPhone(tjReservation.getPhoe());
                     tjCustomer1.setCusEmail(tjReservation.getEmail());
                     tjCustomer1.setCusAddr(tjReservation.getAddress());
@@ -261,7 +265,7 @@
                     tjCustomer1.setGroupingId(tjReservation.getGroupingId());
 
 //                    if(null !=tjReservation.getCompanyId())tjCustomer1.setDictCompId(Long.valueOf(tjReservation.getCompanyId()));
-//                    if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany());
+                    if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany());
 
 //                    tjCustomerService.updateById(tjCustomer1);
 
@@ -271,7 +275,11 @@
                     tjCustomer.setCusIdcard(tjReservation.getIdCard());
                     tjCustomer.setCusName(tjReservation.getName());
                     tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex()));
-                    tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    try {
+                        tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
+                    } catch (Exception e) {
+                        return AjaxResult.error("韬唤璇佸彿涓嶆纭�");
+                    }
                     tjCustomer.setCusPhone(tjReservation.getPhoe());
                     tjCustomer.setCusEmail(tjReservation.getEmail());
                     tjCustomer.setCusAddr(tjReservation.getAddress());
@@ -291,8 +299,8 @@
                     tjCustomer.setCusPassword(substring);
                     tjCustomer.setTjType(tjReservation.getTjType());
                     tjCustomer.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),""));
-//                    if(null !=tjReservation.getCompanyId())tjCustomer.setDictCompId(Long.valueOf(tjReservation.getCompanyId()));
-//                    if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany());
+                    if(null !=tjReservation.getCompanyId())tjCustomer.setCompId(tjReservation.getCompanyId());
+                    if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany());
 
                     if (null != key && key.equals("Y")) {
                         AjaxResult result = controller.Outpincreateapply(tjCustomer);
@@ -510,7 +518,13 @@
         String substring = cusIdcard.substring(cusIdcard.length() - 6);
         substring = DigestUtils.md5DigestAsHex(substring.getBytes());
         tjCustomer.setCusPassword(substring);
-        if(cusIdcard.length()==18)tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd"));
+        if(cusIdcard.length()==18) {
+            try {
+                tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd"));
+            } catch (Exception e) {
+                return AjaxResult.error("韬唤璇佸彿涓嶆纭�");
+            }
+        }
         tjCustomer.setCusNumber(0L);
         tjCustomer.setPym(PinyinUtil.getFirstLetter(tjCustomer.getCusName(),""));
         String config = sysConfigService.selectConfigByKey("sfkqdyhis");

--
Gitblit v1.8.0