From 91247799acda248773d79c41794e4e1f5fe8ff88 Mon Sep 17 00:00:00 2001 From: Caps <452713115@qq.com> Date: Mon, 27 Apr 2020 16:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E7=AE=A1=E7=90=86=E9=9B=B6?= =?UTF-8?q?=E5=94=AE=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kiisoo/ic/customer/CustomerService.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/kiisoo/ic/customer/CustomerService.java b/src/main/java/com/kiisoo/ic/customer/CustomerService.java index 8c63d34..a9102de 100644 --- a/src/main/java/com/kiisoo/ic/customer/CustomerService.java +++ b/src/main/java/com/kiisoo/ic/customer/CustomerService.java @@ -38,6 +38,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.text.DateFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; @@ -216,7 +217,11 @@ public class CustomerService { if(turnBackDTOS.getVipData() != null){ log.info("如果有vip数据就认为是vip客户然后绑定客户vip关系"); //有vip数据就不需要重新请求bsd的vip接口 - vipCheck(turnBackDTOS); + try { + vipCheck(turnBackDTOS); + } catch (ParseException e) { + e.printStackTrace(); + } } } @@ -224,7 +229,8 @@ public class CustomerService { * vip数据检验 * @param turnBackDTO vip数据 */ - private void vipCheck(TurnBackDTO turnBackDTO){ + private void vipCheck(TurnBackDTO turnBackDTO) throws ParseException { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); OpCustomer opCustomer = new OpCustomer(turnBackDTO.getName(),turnBackDTO.getPhone()); opCustomer.setUpdateBy(Constants.SYS_OPERATION); @@ -236,7 +242,7 @@ public class CustomerService { opVip1.setPhone(turnBackDTO.getVipData().getPhone()); opVip1.setName(turnBackDTO.getVipData().getName()); opVip1.setBirthday(turnBackDTO.getVipData().getBirthday()); - opVip1.setRegisterTime(new Date(turnBackDTO.getVipData().getRegisterTime())); + opVip1.setRegisterTime(simpleDateFormat.parse(turnBackDTO.getVipData().getRegisterTime())); if(opVip == null){ //数据库没有这个数据--新建数据 opVip1.setCreateBy(Constants.SYS_OPERATION); @@ -264,7 +270,7 @@ public class CustomerService { */ private void sellerCustomerRelation(OpCustomer opCustomer,String staffCode,long shopId,long sellerId){ QueryWrapper staf = new QueryWrapper(); - staf.eq("staff_code",staffCode); + staf.eq("staff_code",staffCode).last("limit 1");; PoiStoreStaff poiStoreStaff = poiStoreStaffDOMapper.selectOne(staf); QueryWrapper wrapper1 = new QueryWrapper<>(); wrapper1.eq("customer_id",opCustomer.getId()).eq("user_id",poiStoreStaff.getUserId()).eq("store_id",shopId).last("limit 1");