Browse Source

1、新增车辆属性

xiaogang 4 years ago
parent
commit
4b5da34447
18 changed files with 966 additions and 59 deletions
  1. 35 19
      java110-bean/src/main/java/com/java110/dto/ownerCarAttr/OwnerCarAttrDto.java
  2. 65 18
      java110-bean/src/main/java/com/java110/po/ownerCarAttr/OwnerCarAttrPo.java
  3. 102 0
      java110-db/src/main/resources/mapper/user/OwnerCarAttrV1ServiceDaoImplMapper.xml
  4. 9 9
      java110-generator/src/main/java/com/java110/code/TableToJson.java
  5. 19 11
      java110-generator/src/main/resources/newBack/template_1.json
  6. 68 0
      java110-interface/src/main/java/com/java110/intf/user/IOwnerCarAttrV1InnerServiceSMO.java
  7. 39 0
      service-api/src/main/java/com/java110/api/listener/owner/SaveOwnerCarListener.java
  8. 1 2
      service-job/src/main/java/com/java110/job/adapt/hcGov/car/AddCarToHcGovReturnAdapt.java
  9. 14 0
      service-job/src/main/java/com/java110/job/adapt/hcIot/car/AddCarToIotAdapt.java
  10. 14 0
      service-job/src/main/java/com/java110/job/adapt/hcIot/car/DeleteCarToIotAdapt.java
  11. 14 0
      service-job/src/main/java/com/java110/job/adapt/hcIot/car/ModifyCarToIotAdapt.java
  12. 71 0
      service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/DeleteOwnerCarAttrCmd.java
  13. 84 0
      service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/ListOwnerCarAttrCmd.java
  14. 78 0
      service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/SaveOwnerCarAttrCmd.java
  15. 75 0
      service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/UpdateOwnerCarAttrCmd.java
  16. 77 0
      service-user/src/main/java/com/java110/user/dao/IOwnerCarAttrV1ServiceDao.java
  17. 112 0
      service-user/src/main/java/com/java110/user/dao/impl/OwnerCarAttrV1ServiceDaoImpl.java
  18. 89 0
      service-user/src/main/java/com/java110/user/smo/impl/OwnerCarAttrV1InnerServiceSMOImpl.java

+ 35 - 19
java110-bean/src/main/java/com/java110/dto/ownerCarAttr/OwnerCarAttrDto.java

@@ -1,12 +1,13 @@
 package com.java110.dto.ownerCarAttr;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
 /**
  * @ClassName FloorDto
- * @Description 业主车辆属性数据层封装
+ * @Description 车辆属性数据层封装
  * @Author wuxw
  * @Date 2019/4/24 8:52
  * @Version 1.0
@@ -15,48 +16,55 @@ import java.util.Date;
 public class OwnerCarAttrDto extends PageDto implements Serializable {
 
     private String attrId;
-private String specCd;
-private String communityId;
-private String value;
-private String carId;
-
+    private String specCd;
+    private String communityId;
+    private String value;
+    private String memberId;
+    private String carId;
 
     private Date createTime;
 
     private String statusCd = "0";
 
-
     public String getAttrId() {
         return attrId;
     }
-public void setAttrId(String attrId) {
+
+    public void setAttrId(String attrId) {
         this.attrId = attrId;
     }
-public String getSpecCd() {
+
+    public String getSpecCd() {
         return specCd;
     }
-public void setSpecCd(String specCd) {
+
+    public void setSpecCd(String specCd) {
         this.specCd = specCd;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getValue() {
+
+    public String getValue() {
         return value;
     }
-public void setValue(String value) {
+
+    public void setValue(String value) {
         this.value = value;
     }
-public String getCarId() {
-        return carId;
-    }
-public void setCarId(String carId) {
-        this.carId = carId;
+
+    public String getMemberId() {
+        return memberId;
     }
 
+    public void setMemberId(String memberId) {
+        this.memberId = memberId;
+    }
 
     public Date getCreateTime() {
         return createTime;
@@ -73,4 +81,12 @@ public void setCarId(String carId) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getCarId() {
+        return carId;
+    }
+
+    public void setCarId(String carId) {
+        this.carId = carId;
+    }
 }

+ 65 - 18
java110-bean/src/main/java/com/java110/po/ownerCarAttr/OwnerCarAttrPo.java

@@ -1,46 +1,93 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package com.java110.po.ownerCarAttr;
 
 import java.io.Serializable;
-import java.util.Date;
 
+/**
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
 public class OwnerCarAttrPo implements Serializable {
 
     private String attrId;
-private String specCd;
-private String communityId;
-private String value;
-private String carId;
-public String getAttrId() {
+    private String specCd;
+    private String statusCd = "0";
+    private String communityId;
+    private String value;
+    private String memberId;
+    private String carId;
+
+    public String getAttrId() {
         return attrId;
     }
-public void setAttrId(String attrId) {
+
+    public void setAttrId(String attrId) {
         this.attrId = attrId;
     }
-public String getSpecCd() {
+
+    public String getSpecCd() {
         return specCd;
     }
-public void setSpecCd(String specCd) {
+
+    public void setSpecCd(String specCd) {
         this.specCd = specCd;
     }
-public String getCommunityId() {
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getValue() {
+
+    public String getValue() {
         return value;
     }
-public void setValue(String value) {
+
+    public void setValue(String value) {
         this.value = value;
     }
-public String getCarId() {
-        return carId;
-    }
-public void setCarId(String carId) {
-        this.carId = carId;
+
+    public String getMemberId() {
+        return memberId;
     }
 
+    public void setMemberId(String memberId) {
+        this.memberId = memberId;
+    }
 
+    public String getCarId() {
+        return carId;
+    }
 
+    public void setCarId(String carId) {
+        this.carId = carId;
+    }
 }

+ 102 - 0
java110-db/src/main/resources/mapper/user/OwnerCarAttrV1ServiceDaoImplMapper.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="ownerCarAttrV1ServiceDaoImpl">
+
+
+    <!-- 保存车辆属性信息 add by wuxw 2018-07-03 -->
+    <insert id="saveOwnerCarAttrInfo" parameterType="Map">
+        insert into owner_car_attr(
+attr_id,spec_cd,community_id,value,member_id
+) values (
+#{attrId},#{specCd},#{communityId},#{value},#{memberId}
+)
+    </insert>
+
+
+    <!-- 查询车辆属性信息 add by wuxw 2018-07-03 -->
+    <select id="getOwnerCarAttrInfo" parameterType="Map" resultType="Map">
+        select t.attr_id,t.attr_id attrId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd
+        statusCd,t.community_id,t.community_id communityId,t.value,t.member_id,t.member_id memberId
+        from owner_car_attr t
+        where 1 =1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="value !=null and value != ''">
+            and t.value= #{value}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            and t.member_id= #{memberId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改车辆属性信息 add by wuxw 2018-07-03 -->
+    <update id="updateOwnerCarAttrInfo" parameterType="Map">
+        update owner_car_attr t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            , t.spec_cd= #{specCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="value !=null and value != ''">
+            , t.value= #{value}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            , t.member_id= #{memberId}
+        </if>
+        where 1=1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+
+    </update>
+
+    <!-- 查询车辆属性数量 add by wuxw 2018-07-03 -->
+    <select id="queryOwnerCarAttrsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from owner_car_attr t
+        where 1 =1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="value !=null and value != ''">
+            and t.value= #{value}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            and t.member_id= #{memberId}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 9 - 9
java110-generator/src/main/java/com/java110/code/TableToJson.java

@@ -18,20 +18,20 @@ import java.nio.charset.Charset;
 public class TableToJson {
 
     //show create table c_orders  用这个语句获取
-    public static final String createTableSql = "CREATE TABLE `m_menu_group_community` (\n" +
-            "  `gc_id` varchar(30) NOT NULL COMMENT '主键ID',\n" +
-            "  `g_id` varchar(30) NOT NULL COMMENT '菜单组ID',\n" +
-            "  `name` varchar(10) NOT NULL COMMENT '菜单组名称',\n" +
+    public static final String createTableSql = "CREATE TABLE `owner_car_attr` (\n" +
+            "  `attr_id` varchar(30) NOT NULL COMMENT '属性id',\n" +
+            "  `member_id` varchar(30) NOT NULL COMMENT '车辆ID',\n" +
             "  `community_id` varchar(30) NOT NULL COMMENT '小区ID',\n" +
-            "  `community_name` varchar(64) NOT NULL COMMENT '小区名称',\n" +
+            "  `spec_cd` varchar(12) NOT NULL COMMENT '规格id,参考spec表',\n" +
+            "  `value` varchar(50) NOT NULL COMMENT '属性值',\n" +
             "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
-            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'\n" +
+            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'\n" +
             ")";
 
     public static void main(String[] args) {
-        String desc = "小区功能";
-        String id = "gcId";
-        String name = "menuGroupCommunity";
+        String desc = "车辆属性";
+        String id = "attrId";
+        String name = "ownerCarAttr";
         String shareName = "user"; //生成到那个服务下
         String shareColumn = "community_id";
         String shareParam = "communityId";

+ 19 - 11
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,28 +1,36 @@
 {
   "param": {
-    "gId": "g_id",
-    "gcId": "gc_id",
-    "name": "name",
-    "communityName": "community_name",
+    "attrId": "attr_id",
+    "specCd": "spec_cd",
     "statusCd": "status_cd",
-    "communityId": "community_id"
+    "communityId": "community_id",
+    "value": "value",
+    "memberId": "member_id"
   },
-  "name": "menuGroupCommunity",
+  "name": "ownerCarAttr",
   "shareColumn": "community_id",
-  "id": "gcId",
+  "id": "attrId",
   "shareName": "user",
   "autoMove": true,
   "required": [
     {
-      "msg": "菜单组ID不能为空",
-      "code": "gId"
+      "msg": "车辆ID不能为空",
+      "code": "memberId"
     },
     {
       "msg": "小区ID不能为空",
       "code": "communityId"
+    },
+    {
+      "msg": "规格id,参考spec表不能为空",
+      "code": "specCd"
+    },
+    {
+      "msg": "属性值不能为空",
+      "code": "value"
     }
   ],
-  "desc": "小区功能",
+  "desc": "车辆属性",
   "shareParam": "communityId",
-  "tableName": "m_menu_group_community"
+  "tableName": "owner_car_attr"
 }

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/user/IOwnerCarAttrV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.ownerCarAttr.OwnerCarAttrDto;
+import com.java110.po.ownerCarAttr.OwnerCarAttrPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "user-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/ownerCarAttrV1Api")
+public interface IOwnerCarAttrV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveOwnerCarAttr", method = RequestMethod.POST)
+    public int saveOwnerCarAttr(@RequestBody  OwnerCarAttrPo ownerCarAttrPo);
+
+    @RequestMapping(value = "/updateOwnerCarAttr", method = RequestMethod.POST)
+    public int updateOwnerCarAttr(@RequestBody  OwnerCarAttrPo ownerCarAttrPo);
+
+    @RequestMapping(value = "/deleteOwnerCarAttr", method = RequestMethod.POST)
+    public int deleteOwnerCarAttr(@RequestBody  OwnerCarAttrPo ownerCarAttrPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param ownerCarAttrDto 数据对象分享
+     * @return OwnerCarAttrDto 对象数据
+     */
+    @RequestMapping(value = "/queryOwnerCarAttrs", method = RequestMethod.POST)
+    List<OwnerCarAttrDto> queryOwnerCarAttrs(@RequestBody OwnerCarAttrDto ownerCarAttrDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param ownerCarAttrDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryOwnerCarAttrsCount", method = RequestMethod.POST)
+    int queryOwnerCarAttrsCount(@RequestBody OwnerCarAttrDto ownerCarAttrDto);
+}

+ 39 - 0
service-api/src/main/java/com/java110/api/listener/owner/SaveOwnerCarListener.java

@@ -1,24 +1,32 @@
 package com.java110.api.listener.owner;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.api.bmo.parkingSpace.IParkingSpaceBMO;
 import com.java110.api.listener.AbstractServiceApiPlusListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.owner.OwnerCarDto;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
 import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
+import com.java110.intf.user.IOwnerCarAttrInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
+import com.java110.po.ownerCarAttr.OwnerCarAttrPo;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.constant.ServiceCodeConstant;
 import com.java110.utils.exception.ListenerExecuteException;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.StringUtil;
 import org.slf4j.Logger;
 import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
 
+import java.util.List;
+
 /**
  * @ClassName SaveParkingSpaceListener
  * @Description 保存小区楼信息
@@ -46,6 +54,9 @@ public class SaveOwnerCarListener extends AbstractServiceApiPlusListener {
     @Autowired
     private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
 
+    @Autowired
+    private IOwnerCarAttrInnerServiceSMO ownerCarAttrInnerServiceSMOImpl;
+
     @Override
     public String getServiceCode() {
         return ServiceCodeConstant.SERVICE_CODE_SAVE_OWNER_CAR;
@@ -103,6 +114,10 @@ public class SaveOwnerCarListener extends AbstractServiceApiPlusListener {
         if (count > 0) {
             throw new IllegalArgumentException("车辆已存在");
         }
+
+        /*OwnerCarAttrPo ownerCarAttrPo = new OwnerCarAttrPo();
+        ownerCarAttrPo.setAttrId("");
+        ownerCarAttrInnerServiceSMOImpl.saveOwnerCarAttr(ownerCarAttrPo);*/
     }
 
     @Override
@@ -110,6 +125,30 @@ public class SaveOwnerCarListener extends AbstractServiceApiPlusListener {
         //添加小区楼
         parkingSpaceBMOImpl.sellParkingSpace(reqJson, context);
         parkingSpaceBMOImpl.modifySellParkingSpaceState(reqJson, context);
+        commit(context);
+        OwnerCarDto ownerCarDto = new OwnerCarDto();
+        ownerCarDto.setOwnerId(reqJson.getString("ownerId"));
+        ownerCarDto.setCarNum(reqJson.getString("carNum"));
+        //查询业主车辆
+        List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
+        Assert.listOnlyOne(ownerCarDtos, "查询业主车辆错误");
+        OwnerCarAttrPo ownerCarAttrPo = new OwnerCarAttrPo();
+        ownerCarAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_cartId));
+        ownerCarAttrPo.setCarId(ownerCarDtos.get(0).getCarId());
+        ownerCarAttrPo.setCommunityId(reqJson.getString("communityId"));
+        //获取属性值
+        String carAttrs = reqJson.getString("carAttrs");
+        if (StringUtil.isEmpty(carAttrs)) {
+            throw new IllegalArgumentException("属性值为空");
+        }
+        JSONArray jsonArray = JSONArray.parseArray(carAttrs);
+        String specCd = "";
+        if (jsonArray.size() > 0) {
+            specCd = jsonArray.getJSONObject(0).getString("specCd");
+        }
+        ownerCarAttrPo.setSpecCd(specCd);
+        ownerCarAttrPo.setValue(reqJson.getString("value"));
+        ownerCarAttrInnerServiceSMOImpl.saveOwnerCarAttr(ownerCarAttrPo);
     }
 
 

+ 1 - 2
service-job/src/main/java/com/java110/job/adapt/hcGov/car/AddCarToHcGovReturnAdapt.java

@@ -41,6 +41,7 @@ public class AddCarToHcGovReturnAdapt implements IReportReturnDataAdapt {
 
     @Autowired
     private IOwnerCarAttrInnerServiceSMO ownerCarAttrInnerServiceSMOImpl;
+
     @Autowired
     private IHcGovTranslateInnerServiceSMO hcGovTranslateInnerServiceSMOImpl;
 
@@ -73,7 +74,5 @@ public class AddCarToHcGovReturnAdapt implements IReportReturnDataAdapt {
                 throw new IllegalArgumentException("保存楼栋属性失败");
             }
         }
-
-
     }
 }

+ 14 - 0
service-job/src/main/java/com/java110/job/adapt/hcIot/car/AddCarToIotAdapt.java

@@ -18,9 +18,12 @@ package com.java110.job.adapt.hcIot.car;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.owner.OwnerCarDto;
+import com.java110.dto.ownerCarAttr.OwnerCarAttrDto;
 import com.java110.dto.parking.ParkingSpaceDto;
+import com.java110.dto.parkingAreaAttr.ParkingAreaAttrDto;
 import com.java110.entity.order.Business;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
+import com.java110.intf.user.IOwnerCarAttrInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
 import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
@@ -52,6 +55,9 @@ public class AddCarToIotAdapt extends DatabusAdaptImpl {
     @Autowired
     private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
 
+    @Autowired
+    private IOwnerCarAttrInnerServiceSMO ownerCarAttrInnerServiceSMOImpl;
+
     @Autowired
     private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
 
@@ -125,6 +131,13 @@ public class AddCarToIotAdapt extends DatabusAdaptImpl {
         ownerCarDto.setStatusCd(StatusConstant.STATUS_CD_VALID);
         long parkingSpaceCount = ownerCarInnerServiceSMOImpl.queryOwnerParkingSpaceCount(ownerCarDto);
 
+        //查询属性
+        OwnerCarAttrDto ownerCarAttrDto = new OwnerCarAttrDto();
+        ownerCarAttrDto.setCarId(ownerCarDtos.get(0).getCarId());
+        ownerCarAttrDto.setCommunityId(ownerCarDtos.get(0).getCommunityId());
+        List<OwnerCarAttrDto> parkingAreaAttrDtos = ownerCarAttrInnerServiceSMOImpl.queryOwnerCarAttrs(ownerCarAttrDto);
+
+
         JSONObject postParameters = new JSONObject();
 
         postParameters.put("carNum", ownerCarDtos.get(0).getCarNum());
@@ -137,6 +150,7 @@ public class AddCarToIotAdapt extends DatabusAdaptImpl {
         postParameters.put("extCarId", ownerCarDtos.get(0).getCarId());
         postParameters.put("parkingNum", parkingSpaceCount);
         postParameters.put("extCommunityId", ownerCarDtos.get(0).getCommunityId());
+        postParameters.put("attrs", parkingAreaAttrDtos);
         hcOwnerCarAsynImpl.addOwnerCar(postParameters);
     }
 }

+ 14 - 0
service-job/src/main/java/com/java110/job/adapt/hcIot/car/DeleteCarToIotAdapt.java

@@ -18,9 +18,11 @@ package com.java110.job.adapt.hcIot.car;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.owner.OwnerCarDto;
+import com.java110.dto.ownerCarAttr.OwnerCarAttrDto;
 import com.java110.dto.parking.ParkingSpaceDto;
 import com.java110.entity.order.Business;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
+import com.java110.intf.user.IOwnerCarAttrInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
 import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
@@ -50,6 +52,10 @@ public class DeleteCarToIotAdapt extends DatabusAdaptImpl {
     @Autowired
     private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
 
+
+    @Autowired
+    private IOwnerCarAttrInnerServiceSMO ownerCarAttrInnerServiceSMOImpl;
+
     @Autowired
     private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
 
@@ -108,6 +114,13 @@ public class DeleteCarToIotAdapt extends DatabusAdaptImpl {
         ownerCarDto.setStatusCd(StatusConstant.STATUS_CD_VALID);
         long parkingSpaceCount = ownerCarInnerServiceSMOImpl.queryOwnerParkingSpaceCount(ownerCarDto);
 
+
+        //查询属性
+        OwnerCarAttrDto ownerCarAttrDto = new OwnerCarAttrDto();
+        ownerCarAttrDto.setCarId(ownerCarDtos.get(0).getCarId());
+        ownerCarAttrDto.setCommunityId(ownerCarDtos.get(0).getCommunityId());
+        List<OwnerCarAttrDto> parkingAreaAttrDtos = ownerCarAttrInnerServiceSMOImpl.queryOwnerCarAttrs(ownerCarAttrDto);
+
         JSONObject postParameters = new JSONObject();
         postParameters.put("extCarId", ownerCarDtos.get(0).getCarId());
         postParameters.put("carNum", ownerCarDtos.get(0).getCarNum());
@@ -118,6 +131,7 @@ public class DeleteCarToIotAdapt extends DatabusAdaptImpl {
         postParameters.put("extCarId", ownerCarDtos.get(0).getCarId());
         postParameters.put("parkingNum", parkingSpaceCount);
         postParameters.put("extCommunityId", ownerCarDtos.get(0).getCommunityId());
+        postParameters.put("attrs", parkingAreaAttrDtos);
         hcOwnerCarAsynImpl.deleteOwnerCar(postParameters);
     }
 }

+ 14 - 0
service-job/src/main/java/com/java110/job/adapt/hcIot/car/ModifyCarToIotAdapt.java

@@ -18,9 +18,11 @@ package com.java110.job.adapt.hcIot.car;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.owner.OwnerCarDto;
+import com.java110.dto.ownerCarAttr.OwnerCarAttrDto;
 import com.java110.dto.parking.ParkingSpaceDto;
 import com.java110.entity.order.Business;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
+import com.java110.intf.user.IOwnerCarAttrInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
 import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
@@ -50,6 +52,9 @@ public class ModifyCarToIotAdapt extends DatabusAdaptImpl {
     @Autowired
     private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
 
+    @Autowired
+    private IOwnerCarAttrInnerServiceSMO ownerCarAttrInnerServiceSMOImpl;
+
     @Autowired
     private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
 
@@ -121,6 +126,14 @@ public class ModifyCarToIotAdapt extends DatabusAdaptImpl {
         ownerCarDto.setCommunityId(ownerCarPo.getCommunityId());
         ownerCarDto.setStatusCd(StatusConstant.STATUS_CD_VALID);
         long parkingSpaceCount = ownerCarInnerServiceSMOImpl.queryOwnerParkingSpaceCount(ownerCarDto);
+
+        //查询属性
+        OwnerCarAttrDto ownerCarAttrDto = new OwnerCarAttrDto();
+        ownerCarAttrDto.setCarId(ownerCarDtos.get(0).getCarId());
+        ownerCarAttrDto.setCommunityId(ownerCarDtos.get(0).getCommunityId());
+        List<OwnerCarAttrDto> parkingAreaAttrDtos = ownerCarAttrInnerServiceSMOImpl.queryOwnerCarAttrs(ownerCarAttrDto);
+
+
         JSONObject postParameters = new JSONObject();
 
         postParameters.put("carNum", ownerCarDtos.get(0).getCarNum());
@@ -133,6 +146,7 @@ public class ModifyCarToIotAdapt extends DatabusAdaptImpl {
         postParameters.put("extCarId", ownerCarDtos.get(0).getCarId());
         postParameters.put("parkingNum", parkingSpaceCount);
         postParameters.put("extCommunityId", ownerCarDtos.get(0).getCommunityId());
+        postParameters.put("attrs", parkingAreaAttrDtos);
         hcOwnerCarAsynImpl.updateOwnerCar(postParameters);
     }
 }

+ 71 - 0
service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/DeleteOwnerCarAttrCmd.java

@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.ownerCarAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.user.IOwnerCarAttrV1InnerServiceSMO;
+import com.java110.po.ownerCarAttr.OwnerCarAttrPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 类表述:删除
+ * 服务编码:ownerCarAttr.deleteOwnerCarAttr
+ * 请求路劲:/app/ownerCarAttr.DeleteOwnerCarAttr
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "ownerCarAttr.deleteOwnerCarAttr")
+public class DeleteOwnerCarAttrCmd extends AbstractServiceCmdListener {
+    private static Logger logger = LoggerFactory.getLogger(DeleteOwnerCarAttrCmd.class);
+
+    @Autowired
+    private IOwnerCarAttrV1InnerServiceSMO ownerCarAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        OwnerCarAttrPo ownerCarAttrPo = BeanConvertUtil.covertBean(reqJson, OwnerCarAttrPo.class);
+        int flag = ownerCarAttrV1InnerServiceSMOImpl.deleteOwnerCarAttr(ownerCarAttrPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 84 - 0
service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/ListOwnerCarAttrCmd.java

@@ -0,0 +1,84 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.ownerCarAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.IOwnerCarAttrV1InnerServiceSMO;
+import com.java110.po.ownerCarAttr.OwnerCarAttrPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.java110.dto.ownerCarAttr.OwnerCarAttrDto;
+import java.util.List;
+import java.util.ArrayList;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:ownerCarAttr.listOwnerCarAttr
+ * 请求路劲:/app/ownerCarAttr.ListOwnerCarAttr
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "ownerCarAttr.listOwnerCarAttr")
+public class ListOwnerCarAttrCmd extends AbstractServiceCmdListener {
+
+  private static Logger logger = LoggerFactory.getLogger(ListOwnerCarAttrCmd.class);
+    @Autowired
+    private IOwnerCarAttrV1InnerServiceSMO ownerCarAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+           OwnerCarAttrDto ownerCarAttrDto = BeanConvertUtil.covertBean(reqJson, OwnerCarAttrDto.class);
+
+           int count = ownerCarAttrV1InnerServiceSMOImpl.queryOwnerCarAttrsCount(ownerCarAttrDto);
+
+           List<OwnerCarAttrDto> ownerCarAttrDtos = null;
+
+           if (count > 0) {
+               ownerCarAttrDtos = ownerCarAttrV1InnerServiceSMOImpl.queryOwnerCarAttrs(ownerCarAttrDto);
+           } else {
+               ownerCarAttrDtos = new ArrayList<>();
+           }
+
+           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerCarAttrDtos);
+
+           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+           cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 78 - 0
service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/SaveOwnerCarAttrCmd.java

@@ -0,0 +1,78 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.ownerCarAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.IOwnerCarAttrV1InnerServiceSMO;
+import com.java110.po.ownerCarAttr.OwnerCarAttrPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:保存
+ * 服务编码:ownerCarAttr.saveOwnerCarAttr
+ * 请求路劲:/app/ownerCarAttr.SaveOwnerCarAttr
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "ownerCarAttr.saveOwnerCarAttr")
+public class SaveOwnerCarAttrCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveOwnerCarAttrCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IOwnerCarAttrV1InnerServiceSMO ownerCarAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "memberId", "请求报文中未包含memberId");
+Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd");
+Assert.hasKeyAndValue(reqJson, "value", "请求报文中未包含value");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       OwnerCarAttrPo ownerCarAttrPo = BeanConvertUtil.covertBean(reqJson, OwnerCarAttrPo.class);
+        ownerCarAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = ownerCarAttrV1InnerServiceSMOImpl.saveOwnerCarAttr(ownerCarAttrPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 75 - 0
service-user/src/main/java/com/java110/user/cmd/ownerCarAttr/UpdateOwnerCarAttrCmd.java

@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.ownerCarAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.IOwnerCarAttrV1InnerServiceSMO;
+import com.java110.po.ownerCarAttr.OwnerCarAttrPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:ownerCarAttr.updateOwnerCarAttr
+ * 请求路劲:/app/ownerCarAttr.UpdateOwnerCarAttr
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "ownerCarAttr.updateOwnerCarAttr")
+public class UpdateOwnerCarAttrCmd extends AbstractServiceCmdListener {
+
+  private static Logger logger = LoggerFactory.getLogger(UpdateOwnerCarAttrCmd.class);
+
+
+    @Autowired
+    private IOwnerCarAttrV1InnerServiceSMO ownerCarAttrV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
+Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       OwnerCarAttrPo ownerCarAttrPo = BeanConvertUtil.covertBean(reqJson, OwnerCarAttrPo.class);
+        int flag = ownerCarAttrV1InnerServiceSMOImpl.updateOwnerCarAttr(ownerCarAttrPo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-user/src/main/java/com/java110/user/dao/IOwnerCarAttrV1ServiceDao.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IOwnerCarAttrV1ServiceDao {
+
+
+    /**
+     * 保存 车辆属性信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveOwnerCarAttrInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询车辆属性信息(instance过程)
+     * 根据bId 查询车辆属性信息
+     * @param info bId 信息
+     * @return 车辆属性信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getOwnerCarAttrInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改车辆属性信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateOwnerCarAttrInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询车辆属性总数
+     *
+     * @param info 车辆属性信息
+     * @return 车辆属性数量
+     */
+    int queryOwnerCarAttrsCount(Map info);
+
+}

+ 112 - 0
service-user/src/main/java/com/java110/user/dao/impl/OwnerCarAttrV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.IOwnerCarAttrV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("ownerCarAttrV1ServiceDaoImpl")
+public class OwnerCarAttrV1ServiceDaoImpl extends BaseServiceDao implements IOwnerCarAttrV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(OwnerCarAttrV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存车辆属性信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveOwnerCarAttrInfo(Map info) throws DAOException {
+        logger.debug("保存 saveOwnerCarAttrInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("ownerCarAttrV1ServiceDaoImpl.saveOwnerCarAttrInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询车辆属性信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getOwnerCarAttrInfo(Map info) throws DAOException {
+        logger.debug("查询 getOwnerCarAttrInfo 入参 info : {}",info);
+
+        List<Map> businessOwnerCarAttrInfos = sqlSessionTemplate.selectList("ownerCarAttrV1ServiceDaoImpl.getOwnerCarAttrInfo",info);
+
+        return businessOwnerCarAttrInfos;
+    }
+
+
+    /**
+     * 修改车辆属性信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateOwnerCarAttrInfo(Map info) throws DAOException {
+        logger.debug("修改 updateOwnerCarAttrInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("ownerCarAttrV1ServiceDaoImpl.updateOwnerCarAttrInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询车辆属性数量
+     * @param info 车辆属性信息
+     * @return 车辆属性数量
+     */
+    @Override
+    public int queryOwnerCarAttrsCount(Map info) {
+        logger.debug("查询 queryOwnerCarAttrsCount 入参 info : {}",info);
+
+        List<Map> businessOwnerCarAttrInfos = sqlSessionTemplate.selectList("ownerCarAttrV1ServiceDaoImpl.queryOwnerCarAttrsCount", info);
+        if (businessOwnerCarAttrInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessOwnerCarAttrInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-user/src/main/java/com/java110/user/smo/impl/OwnerCarAttrV1InnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.smo.impl;
+
+
+import com.java110.user.dao.IOwnerCarAttrV1ServiceDao;
+import com.java110.intf.user.IOwnerCarAttrV1InnerServiceSMO;
+import com.java110.dto.ownerCarAttr.OwnerCarAttrDto;
+import com.java110.po.ownerCarAttr.OwnerCarAttrPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-03-14 18:31:37 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class OwnerCarAttrV1InnerServiceSMOImpl extends BaseServiceSMO implements IOwnerCarAttrV1InnerServiceSMO {
+
+    @Autowired
+    private IOwnerCarAttrV1ServiceDao ownerCarAttrV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveOwnerCarAttr(@RequestBody  OwnerCarAttrPo ownerCarAttrPo) {
+        int saveFlag = ownerCarAttrV1ServiceDaoImpl.saveOwnerCarAttrInfo(BeanConvertUtil.beanCovertMap(ownerCarAttrPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateOwnerCarAttr(@RequestBody  OwnerCarAttrPo ownerCarAttrPo) {
+        int saveFlag = ownerCarAttrV1ServiceDaoImpl.updateOwnerCarAttrInfo(BeanConvertUtil.beanCovertMap(ownerCarAttrPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteOwnerCarAttr(@RequestBody  OwnerCarAttrPo ownerCarAttrPo) {
+       ownerCarAttrPo.setStatusCd("1");
+       int saveFlag = ownerCarAttrV1ServiceDaoImpl.updateOwnerCarAttrInfo(BeanConvertUtil.beanCovertMap(ownerCarAttrPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<OwnerCarAttrDto> queryOwnerCarAttrs(@RequestBody  OwnerCarAttrDto ownerCarAttrDto) {
+
+        //校验是否传了 分页信息
+
+        int page = ownerCarAttrDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            ownerCarAttrDto.setPage((page - 1) * ownerCarAttrDto.getRow());
+        }
+
+        List<OwnerCarAttrDto> ownerCarAttrs = BeanConvertUtil.covertBeanList(ownerCarAttrV1ServiceDaoImpl.getOwnerCarAttrInfo(BeanConvertUtil.beanCovertMap(ownerCarAttrDto)), OwnerCarAttrDto.class);
+
+        return ownerCarAttrs;
+    }
+
+
+    @Override
+    public int queryOwnerCarAttrsCount(@RequestBody OwnerCarAttrDto ownerCarAttrDto) {
+        return ownerCarAttrV1ServiceDaoImpl.queryOwnerCarAttrsCount(BeanConvertUtil.beanCovertMap(ownerCarAttrDto));    }
+
+}