From eda58e0e6d4abdd2b060e28867d103045845aa69 Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期一, 30 八月 2021 13:13:18 +0800
Subject: [PATCH] Merge branch 'test' into 'yuyue_dev'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java |   55 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java
index ea5703a..3cc4723 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngCarServiceImpl.java
@@ -1,5 +1,14 @@
 package com.panzhihua.service_community.service.impl;
 
+import java.util.*;
+
+import javax.annotation.Resource;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
+
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -13,25 +22,16 @@
 import com.panzhihua.common.model.vos.R;
 import com.panzhihua.common.model.vos.community.ComMngCarExcelVO;
 import com.panzhihua.common.model.vos.community.ComMngCarVO;
-import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO;
 import com.panzhihua.common.model.vos.user.SysUserVO;
 import com.panzhihua.common.service.user.UserService;
 import com.panzhihua.common.utlis.ParamRegularUtil;
 import com.panzhihua.service_community.dao.ComMngCarDAO;
 import com.panzhihua.service_community.dao.ComMngStructAreaDAO;
 import com.panzhihua.service_community.dao.ComMngVillageDAO;
-import com.panzhihua.service_community.model.dos.ComCvtServeDO;
 import com.panzhihua.service_community.model.dos.ComMngCarDO;
 import com.panzhihua.service_community.model.dos.ComMngStructAreaDO;
 import com.panzhihua.service_community.model.dos.ComMngVillageDO;
 import com.panzhihua.service_community.service.ComMngCarService;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.util.ObjectUtils;
-
-import javax.annotation.Resource;
-import java.util.*;
 
 /**
  * @description:
@@ -52,11 +52,10 @@
     @Value("${domain.aesKey:}")
     private String aesKey;
 
-
     @Override
     public R addComMngCarApplet(ComMngCarAppletDTO comCvtBusinessDTO) {
-        int count = comMngCarDAO.selectCount(new QueryWrapper<ComMngCarDO>().lambda()
-                .eq(ComMngCarDO::getPlateNum, comCvtBusinessDTO.getPlateNum())
+        int count = comMngCarDAO.selectCount(
+            new QueryWrapper<ComMngCarDO>().lambda().eq(ComMngCarDO::getPlateNum, comCvtBusinessDTO.getPlateNum())
                 .and(wrapper -> wrapper.eq(ComMngCarDO::getSource, 1)));
         if (count > 0) {
             return R.ok("车辆已存在");
@@ -74,7 +73,8 @@
     @Override
     public R userComMngCarList(Long userId) {
         List<ComMngCarVO> comMngCarVOS = new ArrayList<>();
-        List<ComMngCarDO> carDOS = comMngCarDAO.selectList(new QueryWrapper<ComMngCarDO>().lambda().eq(ComMngCarDO::getUserId, userId));
+        List<ComMngCarDO> carDOS =
+            comMngCarDAO.selectList(new QueryWrapper<ComMngCarDO>().lambda().eq(ComMngCarDO::getUserId, userId));
         carDOS.forEach(carDO -> {
             ComMngCarVO carVO = new ComMngCarVO();
             BeanUtils.copyProperties(carDO, carVO);
@@ -106,9 +106,9 @@
         if (!carResult) {
             return R.fail("车牌号有误!");
         }
-        if (comMngCarSaveDTO.getId()==null) {
-            List<ComMngCarDO> existList = comMngCarDAO.selectList(new QueryWrapper<ComMngCarDO>()
-                    .lambda().eq(ComMngCarDO::getPlateNum, comMngCarSaveDTO.getPlateNum()));
+        if (comMngCarSaveDTO.getId() == null) {
+            List<ComMngCarDO> existList = comMngCarDAO.selectList(
+                new QueryWrapper<ComMngCarDO>().lambda().eq(ComMngCarDO::getPlateNum, comMngCarSaveDTO.getPlateNum()));
             if (!existList.isEmpty()) {
                 return R.ok("车辆已存在");
             }
@@ -128,15 +128,16 @@
         comMngCarDO.setAreaName(comMngVillageDO.getGroupAt());
         comMngCarDO.setCommunityId(comMngVillageDO.getCommunityId());
         try {
-            comMngCarDO.setCardNo(AESUtil.encrypt128(comMngCarSaveDTO.getCardNo(),aesKey));
-        }catch (Exception e){
+            comMngCarDO.setCardNo(AESUtil.encrypt128(comMngCarSaveDTO.getCardNo(), aesKey));
+        } catch (Exception e) {
 
         }
         comMngCarDO.setCreateAt(new Date());
         comMngCarDO.setSource(2);
         R<SysUserVO> sysUserVOR = userService.getSysUserVOByPhone(comMngCarSaveDTO.getMobile());
         if (R.isOk(sysUserVOR)) {
-            SysUserVO sysUserVO = JSONObject.parseObject(JSONObject.toJSONString(sysUserVOR.getData()), SysUserVO.class);
+            SysUserVO sysUserVO =
+                JSONObject.parseObject(JSONObject.toJSONString(sysUserVOR.getData()), SysUserVO.class);
             comMngCarSaveDTO.setUserId(sysUserVO.getUserId());
         }
         if (null != comMngCarDO.getId() && comMngCarDO.getId() != 0) {
@@ -164,29 +165,31 @@
 
     @Override
     public R listSaveMngCarExcelVO(List<ComMngCarExcelVO> list, Long communityId) {
-        //获取社区下所有的小区
-        List<ComMngStructAreaDO> comMngStructAreaDOs = comMngStructAreaDAO.selectList(new QueryWrapper<ComMngStructAreaDO>().lambda().eq(ComMngStructAreaDO::getCommunityId, communityId));
+        // 获取社区下所有的小区
+        List<ComMngStructAreaDO> comMngStructAreaDOs = comMngStructAreaDAO.selectList(
+            new QueryWrapper<ComMngStructAreaDO>().lambda().eq(ComMngStructAreaDO::getCommunityId, communityId));
         Map<String, ComMngStructAreaDO> areaMap = new HashMap<>(comMngStructAreaDOs.size());
         comMngStructAreaDOs.forEach(comMngStructAreaDO -> {
             areaMap.put(comMngStructAreaDO.getAreaName(), comMngStructAreaDO);
         });
         List<ComMngCarDO> comMngCarDOS = new ArrayList<>();
         list.forEach(vo -> {
-            int count = comMngCarDAO.selectCount(new QueryWrapper<ComMngCarDO>()
-                    .lambda().eq(ComMngCarDO::getPlateNum, vo.getPlateNum()).and(wrapper -> wrapper.eq(ComMngCarDO::getSource, 2)));
+            int count = comMngCarDAO.selectCount(new QueryWrapper<ComMngCarDO>().lambda()
+                .eq(ComMngCarDO::getPlateNum, vo.getPlateNum()).and(wrapper -> wrapper.eq(ComMngCarDO::getSource, 2)));
             if (count == 0 && areaMap.containsKey(vo.getAreaName())) {
                 ComMngCarDO comMngCarDO = new ComMngCarDO();
                 BeanUtils.copyProperties(vo, comMngCarDO);
                 try {
-                    comMngCarDO.setCardNo(AESUtil.encrypt128(vo.getCardNo(),aesKey));
-                }catch (Exception e){
+                    comMngCarDO.setCardNo(AESUtil.encrypt128(vo.getCardNo(), aesKey));
+                } catch (Exception e) {
 
                 }
                 comMngCarDO.setCommunityId(communityId);
                 comMngCarDO.setAreaId(areaMap.get(vo.getAreaName()).getId());
                 R<SysUserVO> sysUserVOR = userService.getSysUserVOByPhone(vo.getMobile());
                 if (R.isOk(sysUserVOR)) {
-                    SysUserVO sysUserVO = JSONObject.parseObject(JSONObject.toJSONString(sysUserVOR.getData()), SysUserVO.class);
+                    SysUserVO sysUserVO =
+                        JSONObject.parseObject(JSONObject.toJSONString(sysUserVOR.getData()), SysUserVO.class);
                     comMngCarDO.setUserId(sysUserVO.getUserId());
                 }
                 comMngCarDO.setSource(2);

--
Gitblit v1.7.1