Parcourir la source

加入岗亭功能

java110 il y a 4 ans
Parent
commit
e201c05eb9

+ 97 - 0
java110-bean/src/main/java/com/java110/dto/parkingBox/ParkingBoxDto.java

@@ -0,0 +1,97 @@
+package com.java110.dto.parkingBox;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 岗亭数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class ParkingBoxDto extends PageDto implements Serializable {
+
+    private String yelowCarIn;
+private String fee;
+private String tempCarIn;
+private String boxName;
+private String remark;
+private String communityId;
+private String blueCarIn;
+private String boxId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getYelowCarIn() {
+        return yelowCarIn;
+    }
+public void setYelowCarIn(String yelowCarIn) {
+        this.yelowCarIn = yelowCarIn;
+    }
+public String getFee() {
+        return fee;
+    }
+public void setFee(String fee) {
+        this.fee = fee;
+    }
+public String getTempCarIn() {
+        return tempCarIn;
+    }
+public void setTempCarIn(String tempCarIn) {
+        this.tempCarIn = tempCarIn;
+    }
+public String getBoxName() {
+        return boxName;
+    }
+public void setBoxName(String boxName) {
+        this.boxName = boxName;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getBlueCarIn() {
+        return blueCarIn;
+    }
+public void setBlueCarIn(String blueCarIn) {
+        this.blueCarIn = blueCarIn;
+    }
+public String getBoxId() {
+        return boxId;
+    }
+public void setBoxId(String boxId) {
+        this.boxId = boxId;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 96 - 0
java110-bean/src/main/java/com/java110/po/parkingBox/ParkingBoxPo.java

@@ -0,0 +1,96 @@
+/*
+ * 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.parkingBox;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2021-10-18 00:10:40 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 ParkingBoxPo implements Serializable {
+
+    private String yelowCarIn;
+private String fee;
+private String tempCarIn;
+private String boxName;
+private String remark;
+private String statusCd = "0";
+private String communityId;
+private String blueCarIn;
+private String boxId;
+public String getYelowCarIn() {
+        return yelowCarIn;
+    }
+public void setYelowCarIn(String yelowCarIn) {
+        this.yelowCarIn = yelowCarIn;
+    }
+public String getFee() {
+        return fee;
+    }
+public void setFee(String fee) {
+        this.fee = fee;
+    }
+public String getTempCarIn() {
+        return tempCarIn;
+    }
+public void setTempCarIn(String tempCarIn) {
+        this.tempCarIn = tempCarIn;
+    }
+public String getBoxName() {
+        return boxName;
+    }
+public void setBoxName(String boxName) {
+        this.boxName = boxName;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getBlueCarIn() {
+        return blueCarIn;
+    }
+public void setBlueCarIn(String blueCarIn) {
+        this.blueCarIn = blueCarIn;
+    }
+public String getBoxId() {
+        return boxId;
+    }
+public void setBoxId(String boxId) {
+        this.boxId = boxId;
+    }
+
+
+
+}

+ 133 - 0
java110-db/src/main/resources/mapper/community/ParkingBoxV1ServiceDaoImplMapper.xml

@@ -0,0 +1,133 @@
+<?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="parkingBoxV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存岗亭信息 add by wuxw 2018-07-03 -->
+    <insert id="saveParkingBoxInfo" parameterType="Map">
+        insert into parking_box(
+yelow_car_in,fee,temp_car_in,box_name,remark,community_id,blue_car_in,box_id
+) values (
+#{yelowCarIn},#{fee},#{tempCarIn},#{boxName},#{remark},#{communityId},#{blueCarIn},#{boxId}
+)
+    </insert>
+
+
+
+    <!-- 查询岗亭信息 add by wuxw 2018-07-03 -->
+    <select id="getParkingBoxInfo" parameterType="Map" resultType="Map">
+        select  t.yelow_car_in,t.yelow_car_in yelowCarIn,t.fee,t.temp_car_in,t.temp_car_in tempCarIn,t.box_name,t.box_name boxName,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.blue_car_in,t.blue_car_in blueCarIn,t.box_id,t.box_id boxId 
+from parking_box t 
+where 1 =1 
+<if test="yelowCarIn !=null and yelowCarIn != ''">
+   and t.yelow_car_in= #{yelowCarIn}
+</if> 
+<if test="fee !=null and fee != ''">
+   and t.fee= #{fee}
+</if> 
+<if test="tempCarIn !=null and tempCarIn != ''">
+   and t.temp_car_in= #{tempCarIn}
+</if> 
+<if test="boxName !=null and boxName != ''">
+   and t.box_name= #{boxName}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</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="blueCarIn !=null and blueCarIn != ''">
+   and t.blue_car_in= #{blueCarIn}
+</if> 
+<if test="boxId !=null and boxId != ''">
+   and t.box_id= #{boxId}
+</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="updateParkingBoxInfo" parameterType="Map">
+        update  parking_box t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="yelowCarIn !=null and yelowCarIn != ''">
+, t.yelow_car_in= #{yelowCarIn}
+</if> 
+<if test="fee !=null and fee != ''">
+, t.fee= #{fee}
+</if> 
+<if test="tempCarIn !=null and tempCarIn != ''">
+, t.temp_car_in= #{tempCarIn}
+</if> 
+<if test="boxName !=null and boxName != ''">
+, t.box_name= #{boxName}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="blueCarIn !=null and blueCarIn != ''">
+, t.blue_car_in= #{blueCarIn}
+</if> 
+ where 1=1 <if test="boxId !=null and boxId != ''">
+and t.box_id= #{boxId}
+</if> 
+
+    </update>
+
+    <!-- 查询岗亭数量 add by wuxw 2018-07-03 -->
+     <select id="queryParkingBoxsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from parking_box t 
+where 1 =1 
+<if test="yelowCarIn !=null and yelowCarIn != ''">
+   and t.yelow_car_in= #{yelowCarIn}
+</if> 
+<if test="fee !=null and fee != ''">
+   and t.fee= #{fee}
+</if> 
+<if test="tempCarIn !=null and tempCarIn != ''">
+   and t.temp_car_in= #{tempCarIn}
+</if> 
+<if test="boxName !=null and boxName != ''">
+   and t.box_name= #{boxName}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</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="blueCarIn !=null and blueCarIn != ''">
+   and t.blue_car_in= #{blueCarIn}
+</if> 
+<if test="boxId !=null and boxId != ''">
+   and t.box_id= #{boxId}
+</if> 
+
+
+     </select>
+
+</mapper>

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

@@ -7,25 +7,26 @@ import com.java110.utils.util.StringUtil;
 public class TableToJson {
 
     //show create table c_orders  用这个语句获取
-    public static final String createTableSql = "CREATE TABLE `owner_car_open_user` (\n" +
-            "  `open_user_id` varchar(30) NOT NULL COMMENT 'app用户ID',\n" +
-            "  `open_id` varchar(128) NOT NULL COMMENT '微信或支付宝开放ID',\n" +
-            "  `car_num` varchar(32) NOT NULL COMMENT '车牌号',\n" +
-            "  `open_type` varchar(12) NOT NULL DEFAULT 'WECHAT' COMMENT '微信WECHAT 支付宝 ALI',\n" +
-            "  `nickname` varchar(255) DEFAULT NULL COMMENT '昵称',\n" +
-            "  `headimgurl` varchar(255) DEFAULT NULL COMMENT '微信头像',\n" +
+    public static final String createTableSql = "CREATE TABLE `parking_box` (\n" +
+            "  `box_id` varchar(30) NOT NULL COMMENT '岗亭ID',\n" +
+            "  `box_name` varchar(64) NOT NULL COMMENT '岗亭名称',\n" +
+            "  `community_id` varchar(30) NOT NULL COMMENT '小区ID',\n" +
+            "  `temp_car_in` varchar(12) NOT NULL COMMENT '临时车是否进场 Y 进场 N 不进场',\n" +
+            "  `fee` varchar(12) NOT NULL DEFAULT 'Y' COMMENT '岗亭是否 收费,主要考虑 岗亭嵌套问题 Y 收费 N 不收费',\n" +
+            "  `blue_car_in` varchar(12) NOT NULL COMMENT '蓝牌车是否可以进场 Y 进场 N 不进场',\n" +
+            "  `yelow_car_in` varchar(12) NOT NULL COMMENT '黄牌车是否可以进场 Y 进场 N 不进场',\n" +
+            "  `remark` varchar(300) DEFAULT 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" +
-            "  PRIMARY KEY (`open_user_id`)\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 = "openUserId";
-        String name = "ownerCarOpenUser";
-        String shareName = "user"; //生成到那个服务下
-        String shareColumn = "open_user_id";
-        String shareParam = "openUserId";
+        String desc = "岗亭";
+        String id = "boxId";
+        String name = "parkingBox";
+        String shareName = "community"; //生成到那个服务下
+        String shareColumn = "community_id";
+        String shareParam = "communityId";
 
         //业务名称 desc 业务编码名称生成后类名 name 主键 id  需要放到那个服务 shareName
         String newSql = createTableSql.substring(createTableSql.indexOf("(") + 1, createTableSql.lastIndexOf(")"));

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

@@ -1,33 +1,47 @@
 {
   "param": {
-    "openId": "open_id",
-    "nickname": "nickname",
-    "headimgurl": "headimgurl",
-    "carNum": "car_num",
+    "yelowCarIn": "yelow_car_in",
+    "fee": "fee",
+    "tempCarIn": "temp_car_in",
+    "boxName": "box_name",
+    "remark": "remark",
     "statusCd": "status_cd",
-    "openUserId": "open_user_id",
-    "openType": "open_type"
+    "communityId": "community_id",
+    "blueCarIn": "blue_car_in",
+    "boxId": "box_id"
   },
-  "name": "ownerCarOpenUser",
-  "shareColumn": "open_user_id",
-  "id": "openUserId",
-  "shareName": "user",
+  "name": "parkingBox",
+  "shareColumn": "community_id",
+  "id": "boxId",
+  "shareName": "community",
   "autoMove": true,
   "required": [
     {
-      "msg": "微信或支付宝开放ID不能为空",
-      "code": "openId"
+      "msg": "岗亭名称不能为空",
+      "code": "boxName"
     },
     {
-      "msg": "车牌号不能为空",
-      "code": "carNum"
+      "msg": "小区ID不能为空",
+      "code": "communityId"
     },
     {
-      "msg": "微信WECHAT不能为空",
-      "code": "openType"
+      "msg": "临时车是否进场不能为空",
+      "code": "tempCarIn"
+    },
+    {
+      "msg": "岗亭是否不能为空",
+      "code": "fee"
+    },
+    {
+      "msg": "蓝牌车是否可以进场不能为空",
+      "code": "blueCarIn"
+    },
+    {
+      "msg": "黄牌车是否可以进场不能为空",
+      "code": "yelowCarIn"
     }
   ],
-  "desc": "车辆微信关系",
-  "shareParam": "openUserId",
-  "tableName": "owner_car_open_user"
+  "desc": "岗亭",
+  "shareParam": "communityId",
+  "tableName": "parking_box"
 }

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/community/IParkingBoxV1InnerServiceSMO.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.community;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.parkingBox.ParkingBoxDto;
+import com.java110.po.parkingBox.ParkingBoxPo;
+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 2021-10-18 00:10:40 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 = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/parkingBoxV1Api")
+public interface IParkingBoxV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveParkingBox", method = RequestMethod.POST)
+    public int saveParkingBox(@RequestBody  ParkingBoxPo parkingBoxPo);
+
+    @RequestMapping(value = "/updateParkingBox", method = RequestMethod.POST)
+    public int updateParkingBox(@RequestBody  ParkingBoxPo parkingBoxPo);
+
+    @RequestMapping(value = "/deleteParkingBox", method = RequestMethod.POST)
+    public int deleteParkingBox(@RequestBody  ParkingBoxPo parkingBoxPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param parkingBoxDto 数据对象分享
+     * @return ParkingBoxDto 对象数据
+     */
+    @RequestMapping(value = "/queryParkingBoxs", method = RequestMethod.POST)
+    List<ParkingBoxDto> queryParkingBoxs(@RequestBody ParkingBoxDto parkingBoxDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param parkingBoxDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryParkingBoxsCount", method = RequestMethod.POST)
+    int queryParkingBoxsCount(@RequestBody ParkingBoxDto parkingBoxDto);
+}

+ 71 - 0
service-community/src/main/java/com/java110/community/cmd/parkingBox/DeleteParkingBoxCmd.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.community.cmd.parkingBox;
+
+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.community.IParkingBoxV1InnerServiceSMO;
+import com.java110.po.parkingBox.ParkingBoxPo;
+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;
+
+/**
+ * 类表述:删除
+ * 服务编码:parkingBox.deleteParkingBox
+ * 请求路劲:/app/parkingBox.DeleteParkingBox
+ * add by 吴学文 at 2021-10-18 00:10:40 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 = "parkingBox.deleteParkingBox")
+public class DeleteParkingBoxCmd extends AbstractServiceCmdListener {
+    private static Logger logger = LoggerFactory.getLogger(DeleteParkingBoxCmd.class);
+
+    @Autowired
+    private IParkingBoxV1InnerServiceSMO parkingBoxV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "boxId", "boxId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        ParkingBoxPo parkingBoxPo = BeanConvertUtil.covertBean(reqJson, ParkingBoxPo.class);
+        int flag = parkingBoxV1InnerServiceSMOImpl.deleteParkingBox(parkingBoxPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 81 - 0
service-community/src/main/java/com/java110/community/cmd/parkingBox/ListParkingBoxCmd.java

@@ -0,0 +1,81 @@
+/*
+ * 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.community.cmd.parkingBox;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.parkingBox.ParkingBoxDto;
+import com.java110.intf.community.IParkingBoxV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+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;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:parkingBox.listParkingBox
+ * 请求路劲:/app/parkingBox.ListParkingBox
+ * add by 吴学文 at 2021-10-18 00:10:40 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 = "parkingBox.listParkingBox")
+public class ListParkingBoxCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(ListParkingBoxCmd.class);
+    @Autowired
+    private IParkingBoxV1InnerServiceSMO parkingBoxV1InnerServiceSMOImpl;
+
+    @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 {
+
+        ParkingBoxDto parkingBoxDto = BeanConvertUtil.covertBean(reqJson, ParkingBoxDto.class);
+
+        int count = parkingBoxV1InnerServiceSMOImpl.queryParkingBoxsCount(parkingBoxDto);
+
+        List<ParkingBoxDto> parkingBoxDtos = null;
+
+        if (count > 0) {
+            parkingBoxDtos = parkingBoxV1InnerServiceSMOImpl.queryParkingBoxs(parkingBoxDto);
+        } else {
+            parkingBoxDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, parkingBoxDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 80 - 0
service-community/src/main/java/com/java110/community/cmd/parkingBox/SaveParkingBoxCmd.java

@@ -0,0 +1,80 @@
+/*
+ * 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.community.cmd.parkingBox;
+
+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.community.IParkingBoxV1InnerServiceSMO;
+import com.java110.po.parkingBox.ParkingBoxPo;
+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;
+
+/**
+ * 类表述:保存
+ * 服务编码:parkingBox.saveParkingBox
+ * 请求路劲:/app/parkingBox.SaveParkingBox
+ * add by 吴学文 at 2021-10-18 00:10:40 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 = "parkingBox.saveParkingBox")
+public class SaveParkingBoxCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveParkingBoxCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IParkingBoxV1InnerServiceSMO parkingBoxV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "boxName", "请求报文中未包含boxName");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "tempCarIn", "请求报文中未包含tempCarIn");
+        Assert.hasKeyAndValue(reqJson, "fee", "请求报文中未包含fee");
+        Assert.hasKeyAndValue(reqJson, "blueCarIn", "请求报文中未包含blueCarIn");
+        Assert.hasKeyAndValue(reqJson, "yelowCarIn", "请求报文中未包含yelowCarIn");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        ParkingBoxPo parkingBoxPo = BeanConvertUtil.covertBean(reqJson, ParkingBoxPo.class);
+        parkingBoxPo.setBoxId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = parkingBoxV1InnerServiceSMOImpl.saveParkingBox(parkingBoxPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 74 - 0
service-community/src/main/java/com/java110/community/cmd/parkingBox/UpdateParkingBoxCmd.java

@@ -0,0 +1,74 @@
+/*
+ * 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.community.cmd.parkingBox;
+
+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.community.IParkingBoxV1InnerServiceSMO;
+import com.java110.po.parkingBox.ParkingBoxPo;
+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;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:parkingBox.updateParkingBox
+ * 请求路劲:/app/parkingBox.UpdateParkingBox
+ * add by 吴学文 at 2021-10-18 00:10:40 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 = "parkingBox.updateParkingBox")
+public class UpdateParkingBoxCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateParkingBoxCmd.class);
+
+
+    @Autowired
+    private IParkingBoxV1InnerServiceSMO parkingBoxV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "boxId", "boxId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        ParkingBoxPo parkingBoxPo = BeanConvertUtil.covertBean(reqJson, ParkingBoxPo.class);
+        int flag = parkingBoxV1InnerServiceSMOImpl.updateParkingBox(parkingBoxPo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-community/src/main/java/com/java110/community/dao/IParkingBoxV1ServiceDao.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.community.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 2021-10-18 00:10:40 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 IParkingBoxV1ServiceDao {
+
+
+    /**
+     * 保存 岗亭信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveParkingBoxInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询岗亭信息(instance过程)
+     * 根据bId 查询岗亭信息
+     * @param info bId 信息
+     * @return 岗亭信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getParkingBoxInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改岗亭信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateParkingBoxInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询岗亭总数
+     *
+     * @param info 岗亭信息
+     * @return 岗亭数量
+     */
+    int queryParkingBoxsCount(Map info);
+
+}

+ 112 - 0
service-community/src/main/java/com/java110/community/dao/impl/ParkingBoxV1ServiceDaoImpl.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.community.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.community.dao.IParkingBoxV1ServiceDao;
+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 2021-10-18 00:10:40 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("parkingBoxV1ServiceDaoImpl")
+public class ParkingBoxV1ServiceDaoImpl extends BaseServiceDao implements IParkingBoxV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(ParkingBoxV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存岗亭信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveParkingBoxInfo(Map info) throws DAOException {
+        logger.debug("保存 saveParkingBoxInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("parkingBoxV1ServiceDaoImpl.saveParkingBoxInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询岗亭信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getParkingBoxInfo(Map info) throws DAOException {
+        logger.debug("查询 getParkingBoxInfo 入参 info : {}",info);
+
+        List<Map> businessParkingBoxInfos = sqlSessionTemplate.selectList("parkingBoxV1ServiceDaoImpl.getParkingBoxInfo",info);
+
+        return businessParkingBoxInfos;
+    }
+
+
+    /**
+     * 修改岗亭信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateParkingBoxInfo(Map info) throws DAOException {
+        logger.debug("修改 updateParkingBoxInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("parkingBoxV1ServiceDaoImpl.updateParkingBoxInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询岗亭数量
+     * @param info 岗亭信息
+     * @return 岗亭数量
+     */
+    @Override
+    public int queryParkingBoxsCount(Map info) {
+        logger.debug("查询 queryParkingBoxsCount 入参 info : {}",info);
+
+        List<Map> businessParkingBoxInfos = sqlSessionTemplate.selectList("parkingBoxV1ServiceDaoImpl.queryParkingBoxsCount", info);
+        if (businessParkingBoxInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessParkingBoxInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-community/src/main/java/com/java110/community/smo/impl/ParkingBoxV1InnerServiceSMOImpl.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.community.smo.impl;
+
+
+import com.java110.community.dao.IParkingBoxV1ServiceDao;
+import com.java110.intf.community.IParkingBoxV1InnerServiceSMO;
+import com.java110.dto.parkingBox.ParkingBoxDto;
+import com.java110.po.parkingBox.ParkingBoxPo;
+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 2021-10-18 00:10:40 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 ParkingBoxV1InnerServiceSMOImpl extends BaseServiceSMO implements IParkingBoxV1InnerServiceSMO {
+
+    @Autowired
+    private IParkingBoxV1ServiceDao parkingBoxV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveParkingBox(@RequestBody  ParkingBoxPo parkingBoxPo) {
+        int saveFlag = parkingBoxV1ServiceDaoImpl.saveParkingBoxInfo(BeanConvertUtil.beanCovertMap(parkingBoxPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateParkingBox(@RequestBody  ParkingBoxPo parkingBoxPo) {
+        int saveFlag = parkingBoxV1ServiceDaoImpl.updateParkingBoxInfo(BeanConvertUtil.beanCovertMap(parkingBoxPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteParkingBox(@RequestBody  ParkingBoxPo parkingBoxPo) {
+       parkingBoxPo.setStatusCd("1");
+       int saveFlag = parkingBoxV1ServiceDaoImpl.updateParkingBoxInfo(BeanConvertUtil.beanCovertMap(parkingBoxPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<ParkingBoxDto> queryParkingBoxs(@RequestBody  ParkingBoxDto parkingBoxDto) {
+
+        //校验是否传了 分页信息
+
+        int page = parkingBoxDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            parkingBoxDto.setPage((page - 1) * parkingBoxDto.getRow());
+        }
+
+        List<ParkingBoxDto> parkingBoxs = BeanConvertUtil.covertBeanList(parkingBoxV1ServiceDaoImpl.getParkingBoxInfo(BeanConvertUtil.beanCovertMap(parkingBoxDto)), ParkingBoxDto.class);
+
+        return parkingBoxs;
+    }
+
+
+    @Override
+    public int queryParkingBoxsCount(@RequestBody ParkingBoxDto parkingBoxDto) {
+        return parkingBoxV1ServiceDaoImpl.queryParkingBoxsCount(BeanConvertUtil.beanCovertMap(parkingBoxDto));    }
+
+}