java110
2021-10-18 ef287ad0781d18f6fb6f484f6c315a3af499b384
加入岗亭停车场关系表
2个文件已修改
11个文件已添加
989 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/parkingBoxArea/ParkingBoxAreaDto.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/parkingBoxArea/ParkingBoxAreaPo.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/ParkingBoxAreaV1ServiceDaoImplMapper.xml 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-generator/src/main/java/com/java110/code/TableToJson.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-generator/src/main/resources/newBack/template_1.json 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/community/IParkingBoxAreaV1InnerServiceSMO.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/DeleteParkingBoxAreaCmd.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/ListParkingBoxAreaCmd.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/SaveParkingBoxAreaCmd.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/UpdateParkingBoxAreaCmd.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/IParkingBoxAreaV1ServiceDao.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/impl/ParkingBoxAreaV1ServiceDaoImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/smo/impl/ParkingBoxAreaV1InnerServiceSMOImpl.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/parkingBoxArea/ParkingBoxAreaDto.java
New file
@@ -0,0 +1,83 @@
package com.java110.dto.parkingBoxArea;
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 ParkingBoxAreaDto extends PageDto implements Serializable {
    private String defaultArea;
private String baId;
private String paId;
private String remark;
private String communityId;
private String boxId;
    private Date createTime;
    private String statusCd = "0";
    public String getDefaultArea() {
        return defaultArea;
    }
public void setDefaultArea(String defaultArea) {
        this.defaultArea = defaultArea;
    }
public String getBaId() {
        return baId;
    }
public void setBaId(String baId) {
        this.baId = baId;
    }
public String getPaId() {
        return paId;
    }
public void setPaId(String paId) {
        this.paId = paId;
    }
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 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;
    }
}
java110-bean/src/main/java/com/java110/po/parkingBoxArea/ParkingBoxAreaPo.java
New file
@@ -0,0 +1,82 @@
/*
 * 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.parkingBoxArea;
import java.io.Serializable;
import java.util.Date;
/**
 * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
 * add by 吴学文 at 2021-10-18 00:15:30 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 ParkingBoxAreaPo implements Serializable {
    private String defaultArea;
private String baId;
private String paId;
private String remark;
private String statusCd = "0";
private String communityId;
private String boxId;
public String getDefaultArea() {
        return defaultArea;
    }
public void setDefaultArea(String defaultArea) {
        this.defaultArea = defaultArea;
    }
public String getBaId() {
        return baId;
    }
public void setBaId(String baId) {
        this.baId = baId;
    }
public String getPaId() {
        return paId;
    }
public void setPaId(String paId) {
        this.paId = paId;
    }
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 getBoxId() {
        return boxId;
    }
public void setBoxId(String boxId) {
        this.boxId = boxId;
    }
}
java110-db/src/main/resources/mapper/community/ParkingBoxAreaV1ServiceDaoImplMapper.xml
New file
@@ -0,0 +1,115 @@
<?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="parkingBoxAreaV1ServiceDaoImpl">
    <!-- 保存停车场岗亭信息 add by wuxw 2018-07-03 -->
    <insert id="saveParkingBoxAreaInfo" parameterType="Map">
        insert into parking_box_area(
default_area,ba_id,pa_id,remark,community_id,box_id
) values (
#{defaultArea},#{baId},#{paId},#{remark},#{communityId},#{boxId}
)
    </insert>
    <!-- 查询停车场岗亭信息 add by wuxw 2018-07-03 -->
    <select id="getParkingBoxAreaInfo" parameterType="Map" resultType="Map">
        select  t.default_area,t.default_area defaultArea,t.ba_id,t.ba_id baId,t.pa_id,t.pa_id paId,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.box_id,t.box_id boxId
from parking_box_area t
where 1 =1
<if test="defaultArea !=null and defaultArea != ''">
   and t.default_area= #{defaultArea}
</if>
<if test="baId !=null and baId != ''">
   and t.ba_id= #{baId}
</if>
<if test="paId !=null and paId != ''">
   and t.pa_id= #{paId}
</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="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="updateParkingBoxAreaInfo" parameterType="Map">
        update  parking_box_area t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="defaultArea !=null and defaultArea != ''">
, t.default_area= #{defaultArea}
</if>
<if test="paId !=null and paId != ''">
, t.pa_id= #{paId}
</if>
<if test="remark !=null and remark != ''">
, t.remark= #{remark}
</if>
<if test="communityId !=null and communityId != ''">
, t.community_id= #{communityId}
</if>
<if test="boxId !=null and boxId != ''">
, t.box_id= #{boxId}
</if>
 where 1=1 <if test="baId !=null and baId != ''">
and t.ba_id= #{baId}
</if>
    </update>
    <!-- 查询停车场岗亭数量 add by wuxw 2018-07-03 -->
     <select id="queryParkingBoxAreasCount" parameterType="Map" resultType="Map">
        select  count(1) count
from parking_box_area t
where 1 =1
<if test="defaultArea !=null and defaultArea != ''">
   and t.default_area= #{defaultArea}
</if>
<if test="baId !=null and baId != ''">
   and t.ba_id= #{baId}
</if>
<if test="paId !=null and paId != ''">
   and t.pa_id= #{paId}
</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="boxId !=null and boxId != ''">
   and t.box_id= #{boxId}
</if>
     </select>
</mapper>
java110-generator/src/main/java/com/java110/code/TableToJson.java
@@ -7,27 +7,24 @@
public class TableToJson {
    //show create table c_orders  用这个语句获取
    public static final String createTableSql = "CREATE TABLE `parking_box` (\n" +
    public static final String createTableSql = "CREATE TABLE `parking_box_area` (\n" +
            "  `ba_id` varchar(30) NOT NULL COMMENT '关系ID',\n" +
            "  `box_id` varchar(30) NOT NULL COMMENT '岗亭ID',\n" +
            "  `box_name` varchar(64) NOT NULL COMMENT '岗亭名称',\n" +
            "  `pa_id` varchar(30) NOT NULL COMMENT '停车场ID',\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" +
            "  `default_area` 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表,S 保存,0, 在用 1失效'\n" +
            ") ";
            ")";
    public static void main(String[] args) {
        String desc = "岗亭";
        String id = "boxId";
        String name = "parkingBox";
        String desc = "停车场岗亭";
        String id = "baId";
        String name = "parkingBoxArea";
        String shareName = "community"; //生成到那个服务下
        String shareColumn = "community_id";
        String shareParam = "communityId";
        //业务名称 desc 业务编码名称生成后类名 name 主键 id  需要放到那个服务 shareName
        String newSql = createTableSql.substring(createTableSql.indexOf("(") + 1, createTableSql.lastIndexOf(")"));
        String tableName = createTableSql.substring(createTableSql.indexOf("TABLE") + 5, createTableSql.indexOf("("));
java110-generator/src/main/resources/newBack/template_1.json
@@ -1,47 +1,37 @@
{
  "param": {
    "yelowCarIn": "yelow_car_in",
    "fee": "fee",
    "tempCarIn": "temp_car_in",
    "boxName": "box_name",
    "defaultArea": "default_area",
    "baId": "ba_id",
    "paId": "pa_id",
    "remark": "remark",
    "statusCd": "status_cd",
    "communityId": "community_id",
    "blueCarIn": "blue_car_in",
    "boxId": "box_id"
  },
  "name": "parkingBox",
  "name": "parkingBoxArea",
  "shareColumn": "community_id",
  "id": "boxId",
  "id": "baId",
  "shareName": "community",
  "autoMove": true,
  "required": [
    {
      "msg": "岗亭名称不能为空",
      "code": "boxName"
      "msg": "岗亭ID不能为空",
      "code": "boxId"
    },
    {
      "msg": "停车场ID不能为空",
      "code": "paId"
    },
    {
      "msg": "小区ID不能为空",
      "code": "communityId"
    },
    {
      "msg": "临时车是否进场不能为空",
      "code": "tempCarIn"
    },
    {
      "msg": "岗亭是否不能为空",
      "code": "fee"
    },
    {
      "msg": "蓝牌车是否可以进场不能为空",
      "code": "blueCarIn"
    },
    {
      "msg": "黄牌车是否可以进场不能为空",
      "code": "yelowCarIn"
      "msg": "是否默认停车场不能为空",
      "code": "defaultArea"
    }
  ],
  "desc": "岗亭",
  "desc": "停车场岗亭",
  "shareParam": "communityId",
  "tableName": "parking_box"
  "tableName": "parking_box_area"
}
java110-interface/src/main/java/com/java110/intf/community/IParkingBoxAreaV1InnerServiceSMO.java
New file
@@ -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.parkingBoxArea.ParkingBoxAreaDto;
import com.java110.po.parkingBoxArea.ParkingBoxAreaPo;
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:15:30 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("/parkingBoxAreaV1Api")
public interface IParkingBoxAreaV1InnerServiceSMO {
    @RequestMapping(value = "/saveParkingBoxArea", method = RequestMethod.POST)
    public int saveParkingBoxArea(@RequestBody  ParkingBoxAreaPo parkingBoxAreaPo);
    @RequestMapping(value = "/updateParkingBoxArea", method = RequestMethod.POST)
    public int updateParkingBoxArea(@RequestBody  ParkingBoxAreaPo parkingBoxAreaPo);
    @RequestMapping(value = "/deleteParkingBoxArea", method = RequestMethod.POST)
    public int deleteParkingBoxArea(@RequestBody  ParkingBoxAreaPo parkingBoxAreaPo);
    /**
     * <p>查询小区楼信息</p>
     *
     *
     * @param parkingBoxAreaDto 数据对象分享
     * @return ParkingBoxAreaDto 对象数据
     */
    @RequestMapping(value = "/queryParkingBoxAreas", method = RequestMethod.POST)
    List<ParkingBoxAreaDto> queryParkingBoxAreas(@RequestBody ParkingBoxAreaDto parkingBoxAreaDto);
    /**
     * 查询<p>小区楼</p>总记录数
     *
     * @param parkingBoxAreaDto 数据对象分享
     * @return 小区下的小区楼记录数
     */
    @RequestMapping(value = "/queryParkingBoxAreasCount", method = RequestMethod.POST)
    int queryParkingBoxAreasCount(@RequestBody ParkingBoxAreaDto parkingBoxAreaDto);
}
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/DeleteParkingBoxAreaCmd.java
New file
@@ -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.parkingBoxArea;
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.IParkingBoxAreaV1InnerServiceSMO;
import com.java110.po.parkingBoxArea.ParkingBoxAreaPo;
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;
/**
 * 类表述:删除
 * 服务编码:parkingBoxArea.deleteParkingBoxArea
 * 请求路劲:/app/parkingBoxArea.DeleteParkingBoxArea
 * add by 吴学文 at 2021-10-18 00:15:30 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 = "parkingBoxArea.deleteParkingBoxArea")
public class DeleteParkingBoxAreaCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(DeleteParkingBoxAreaCmd.class);
    @Autowired
    private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "baId", "baId不能为空");
        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        ParkingBoxAreaPo parkingBoxAreaPo = BeanConvertUtil.covertBean(reqJson, ParkingBoxAreaPo.class);
        int flag = parkingBoxAreaV1InnerServiceSMOImpl.deleteParkingBoxArea(parkingBoxAreaPo);
        if (flag < 1) {
            throw new CmdException("删除数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/ListParkingBoxAreaCmd.java
New file
@@ -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.parkingBoxArea;
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.parkingBoxArea.ParkingBoxAreaDto;
import com.java110.intf.community.IParkingBoxAreaV1InnerServiceSMO;
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;
/**
 * 类表述:查询
 * 服务编码:parkingBoxArea.listParkingBoxArea
 * 请求路劲:/app/parkingBoxArea.ListParkingBoxArea
 * add by 吴学文 at 2021-10-18 00:15:30 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 = "parkingBoxArea.listParkingBoxArea")
public class ListParkingBoxAreaCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(ListParkingBoxAreaCmd.class);
    @Autowired
    private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl;
    @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 {
        ParkingBoxAreaDto parkingBoxAreaDto = BeanConvertUtil.covertBean(reqJson, ParkingBoxAreaDto.class);
        int count = parkingBoxAreaV1InnerServiceSMOImpl.queryParkingBoxAreasCount(parkingBoxAreaDto);
        List<ParkingBoxAreaDto> parkingBoxAreaDtos = null;
        if (count > 0) {
            parkingBoxAreaDtos = parkingBoxAreaV1InnerServiceSMOImpl.queryParkingBoxAreas(parkingBoxAreaDto);
        } else {
            parkingBoxAreaDtos = new ArrayList<>();
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, parkingBoxAreaDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        cmdDataFlowContext.setResponseEntity(responseEntity);
    }
}
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/SaveParkingBoxAreaCmd.java
New file
@@ -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.community.cmd.parkingBoxArea;
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.IParkingBoxAreaV1InnerServiceSMO;
import com.java110.po.parkingBoxArea.ParkingBoxAreaPo;
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;
/**
 * 类表述:保存
 * 服务编码:parkingBoxArea.saveParkingBoxArea
 * 请求路劲:/app/parkingBoxArea.SaveParkingBoxArea
 * add by 吴学文 at 2021-10-18 00:15:30 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 = "parkingBoxArea.saveParkingBoxArea")
public class SaveParkingBoxAreaCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(SaveParkingBoxAreaCmd.class);
    public static final String CODE_PREFIX_ID = "10";
    @Autowired
    private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "boxId", "请求报文中未包含boxId");
        Assert.hasKeyAndValue(reqJson, "paId", "请求报文中未包含paId");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
        Assert.hasKeyAndValue(reqJson, "defaultArea", "请求报文中未包含defaultArea");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        ParkingBoxAreaPo parkingBoxAreaPo = BeanConvertUtil.covertBean(reqJson, ParkingBoxAreaPo.class);
        parkingBoxAreaPo.setBaId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
        int flag = parkingBoxAreaV1InnerServiceSMOImpl.saveParkingBoxArea(parkingBoxAreaPo);
        if (flag < 1) {
            throw new CmdException("保存数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-community/src/main/java/com/java110/community/cmd/parkingBoxArea/UpdateParkingBoxAreaCmd.java
New file
@@ -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.parkingBoxArea;
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.IParkingBoxAreaV1InnerServiceSMO;
import com.java110.po.parkingBoxArea.ParkingBoxAreaPo;
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;
/**
 * 类表述:更新
 * 服务编码:parkingBoxArea.updateParkingBoxArea
 * 请求路劲:/app/parkingBoxArea.UpdateParkingBoxArea
 * add by 吴学文 at 2021-10-18 00:15:30 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 = "parkingBoxArea.updateParkingBoxArea")
public class UpdateParkingBoxAreaCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(UpdateParkingBoxAreaCmd.class);
    @Autowired
    private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "baId", "baId不能为空");
        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        ParkingBoxAreaPo parkingBoxAreaPo = BeanConvertUtil.covertBean(reqJson, ParkingBoxAreaPo.class);
        int flag = parkingBoxAreaV1InnerServiceSMOImpl.updateParkingBoxArea(parkingBoxAreaPo);
        if (flag < 1) {
            throw new CmdException("更新数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-community/src/main/java/com/java110/community/dao/IParkingBoxAreaV1ServiceDao.java
New file
@@ -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:15:30 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 IParkingBoxAreaV1ServiceDao {
    /**
     * 保存 停车场岗亭信息
     * @param info
     * @throws DAOException DAO异常
     */
    int saveParkingBoxAreaInfo(Map info) throws DAOException;
    /**
     * 查询停车场岗亭信息(instance过程)
     * 根据bId 查询停车场岗亭信息
     * @param info bId 信息
     * @return 停车场岗亭信息
     * @throws DAOException DAO异常
     */
    List<Map> getParkingBoxAreaInfo(Map info) throws DAOException;
    /**
     * 修改停车场岗亭信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    int updateParkingBoxAreaInfo(Map info) throws DAOException;
    /**
     * 查询停车场岗亭总数
     *
     * @param info 停车场岗亭信息
     * @return 停车场岗亭数量
     */
    int queryParkingBoxAreasCount(Map info);
}
service-community/src/main/java/com/java110/community/dao/impl/ParkingBoxAreaV1ServiceDaoImpl.java
New file
@@ -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.IParkingBoxAreaV1ServiceDao;
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:15:30 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("parkingBoxAreaV1ServiceDaoImpl")
public class ParkingBoxAreaV1ServiceDaoImpl extends BaseServiceDao implements IParkingBoxAreaV1ServiceDao {
    private static Logger logger = LoggerFactory.getLogger(ParkingBoxAreaV1ServiceDaoImpl.class);
    /**
     * 保存停车场岗亭信息 到 instance
     * @param info   bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public int saveParkingBoxAreaInfo(Map info) throws DAOException {
        logger.debug("保存 saveParkingBoxAreaInfo 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.insert("parkingBoxAreaV1ServiceDaoImpl.saveParkingBoxAreaInfo",info);
        return saveFlag;
    }
    /**
     * 查询停车场岗亭信息(instance)
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getParkingBoxAreaInfo(Map info) throws DAOException {
        logger.debug("查询 getParkingBoxAreaInfo 入参 info : {}",info);
        List<Map> businessParkingBoxAreaInfos = sqlSessionTemplate.selectList("parkingBoxAreaV1ServiceDaoImpl.getParkingBoxAreaInfo",info);
        return businessParkingBoxAreaInfos;
    }
    /**
     * 修改停车场岗亭信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public int updateParkingBoxAreaInfo(Map info) throws DAOException {
        logger.debug("修改 updateParkingBoxAreaInfo 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.update("parkingBoxAreaV1ServiceDaoImpl.updateParkingBoxAreaInfo",info);
        return saveFlag;
    }
     /**
     * 查询停车场岗亭数量
     * @param info 停车场岗亭信息
     * @return 停车场岗亭数量
     */
    @Override
    public int queryParkingBoxAreasCount(Map info) {
        logger.debug("查询 queryParkingBoxAreasCount 入参 info : {}",info);
        List<Map> businessParkingBoxAreaInfos = sqlSessionTemplate.selectList("parkingBoxAreaV1ServiceDaoImpl.queryParkingBoxAreasCount", info);
        if (businessParkingBoxAreaInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessParkingBoxAreaInfos.get(0).get("count").toString());
    }
}
service-community/src/main/java/com/java110/community/smo/impl/ParkingBoxAreaV1InnerServiceSMOImpl.java
New file
@@ -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.IParkingBoxAreaV1ServiceDao;
import com.java110.intf.community.IParkingBoxAreaV1InnerServiceSMO;
import com.java110.dto.parkingBoxArea.ParkingBoxAreaDto;
import com.java110.po.parkingBoxArea.ParkingBoxAreaPo;
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:15:30 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 ParkingBoxAreaV1InnerServiceSMOImpl extends BaseServiceSMO implements IParkingBoxAreaV1InnerServiceSMO {
    @Autowired
    private IParkingBoxAreaV1ServiceDao parkingBoxAreaV1ServiceDaoImpl;
    @Override
    public int saveParkingBoxArea(@RequestBody  ParkingBoxAreaPo parkingBoxAreaPo) {
        int saveFlag = parkingBoxAreaV1ServiceDaoImpl.saveParkingBoxAreaInfo(BeanConvertUtil.beanCovertMap(parkingBoxAreaPo));
        return saveFlag;
    }
     @Override
    public int updateParkingBoxArea(@RequestBody  ParkingBoxAreaPo parkingBoxAreaPo) {
        int saveFlag = parkingBoxAreaV1ServiceDaoImpl.updateParkingBoxAreaInfo(BeanConvertUtil.beanCovertMap(parkingBoxAreaPo));
        return saveFlag;
    }
     @Override
    public int deleteParkingBoxArea(@RequestBody  ParkingBoxAreaPo parkingBoxAreaPo) {
       parkingBoxAreaPo.setStatusCd("1");
       int saveFlag = parkingBoxAreaV1ServiceDaoImpl.updateParkingBoxAreaInfo(BeanConvertUtil.beanCovertMap(parkingBoxAreaPo));
       return saveFlag;
    }
    @Override
    public List<ParkingBoxAreaDto> queryParkingBoxAreas(@RequestBody  ParkingBoxAreaDto parkingBoxAreaDto) {
        //校验是否传了 分页信息
        int page = parkingBoxAreaDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            parkingBoxAreaDto.setPage((page - 1) * parkingBoxAreaDto.getRow());
        }
        List<ParkingBoxAreaDto> parkingBoxAreas = BeanConvertUtil.covertBeanList(parkingBoxAreaV1ServiceDaoImpl.getParkingBoxAreaInfo(BeanConvertUtil.beanCovertMap(parkingBoxAreaDto)), ParkingBoxAreaDto.class);
        return parkingBoxAreas;
    }
    @Override
    public int queryParkingBoxAreasCount(@RequestBody ParkingBoxAreaDto parkingBoxAreaDto) {
        return parkingBoxAreaV1ServiceDaoImpl.queryParkingBoxAreasCount(BeanConvertUtil.beanCovertMap(parkingBoxAreaDto));    }
}