Browse Source

加入场地管理功能

java110 3 years ago
parent
commit
41c1d7c07e

+ 104 - 0
java110-bean/src/main/java/com/java110/dto/communitySpace/CommunitySpaceDto.java

@@ -0,0 +1,104 @@
+package com.java110.dto.communitySpace;
+
+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 CommunitySpaceDto extends PageDto implements Serializable {
+
+    private String adminName;
+private String spaceId;
+private String name;
+private String startTime;
+private String tel;
+private String endTime;
+private String state;
+private String communityId;
+private String feeMoney;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getAdminName() {
+        return adminName;
+    }
+public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+public String getSpaceId() {
+        return spaceId;
+    }
+public void setSpaceId(String spaceId) {
+        this.spaceId = spaceId;
+    }
+public String getName() {
+        return name;
+    }
+public void setName(String name) {
+        this.name = name;
+    }
+public String getStartTime() {
+        return startTime;
+    }
+public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+public String getTel() {
+        return tel;
+    }
+public void setTel(String tel) {
+        this.tel = tel;
+    }
+public String getEndTime() {
+        return endTime;
+    }
+public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getFeeMoney() {
+        return feeMoney;
+    }
+public void setFeeMoney(String feeMoney) {
+        this.feeMoney = feeMoney;
+    }
+
+
+    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;
+    }
+}

+ 103 - 0
java110-bean/src/main/java/com/java110/po/communitySpace/CommunitySpacePo.java

@@ -0,0 +1,103 @@
+/*
+ * 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.communitySpace;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2022-09-30 10:21:28 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 CommunitySpacePo implements Serializable {
+
+    private String adminName;
+private String spaceId;
+private String name;
+private String startTime;
+private String tel;
+private String statusCd = "0";
+private String endTime;
+private String state;
+private String communityId;
+private String feeMoney;
+public String getAdminName() {
+        return adminName;
+    }
+public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+public String getSpaceId() {
+        return spaceId;
+    }
+public void setSpaceId(String spaceId) {
+        this.spaceId = spaceId;
+    }
+public String getName() {
+        return name;
+    }
+public void setName(String name) {
+        this.name = name;
+    }
+public String getStartTime() {
+        return startTime;
+    }
+public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+public String getTel() {
+        return tel;
+    }
+public void setTel(String tel) {
+        this.tel = tel;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getEndTime() {
+        return endTime;
+    }
+public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getFeeMoney() {
+        return feeMoney;
+    }
+public void setFeeMoney(String feeMoney) {
+        this.feeMoney = feeMoney;
+    }
+
+
+
+}

+ 142 - 0
java110-db/src/main/resources/mapper/community/CommunitySpaceV1ServiceDaoImplMapper.xml

@@ -0,0 +1,142 @@
+<?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="communitySpaceV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存小区场地信息 add by wuxw 2018-07-03 -->
+    <insert id="saveCommunitySpaceInfo" parameterType="Map">
+        insert into community_space(
+admin_name,space_id,name,start_time,tel,end_time,state,community_id,fee_money
+) values (
+#{adminName},#{spaceId},#{name},#{startTime},#{tel},#{endTime},#{state},#{communityId},#{feeMoney}
+)
+    </insert>
+
+
+
+    <!-- 查询小区场地信息 add by wuxw 2018-07-03 -->
+    <select id="getCommunitySpaceInfo" parameterType="Map" resultType="Map">
+        select  t.admin_name,t.admin_name adminName,t.space_id,t.space_id spaceId,t.name,t.start_time,t.start_time startTime,t.tel,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time endTime,t.state,t.community_id,t.community_id communityId,t.fee_money,t.fee_money feeMoney 
+from community_space t 
+where 1 =1 
+<if test="adminName !=null and adminName != ''">
+   and t.admin_name= #{adminName}
+</if> 
+<if test="spaceId !=null and spaceId != ''">
+   and t.space_id= #{spaceId}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="tel !=null and tel != ''">
+   and t.tel= #{tel}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="feeMoney !=null and feeMoney != ''">
+   and t.fee_money= #{feeMoney}
+</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="updateCommunitySpaceInfo" parameterType="Map">
+        update  community_space t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="adminName !=null and adminName != ''">
+, t.admin_name= #{adminName}
+</if> 
+<if test="name !=null and name != ''">
+, t.name= #{name}
+</if> 
+<if test="startTime !=null and startTime != ''">
+, t.start_time= #{startTime}
+</if> 
+<if test="tel !=null and tel != ''">
+, t.tel= #{tel}
+</if> 
+<if test="endTime !=null and endTime != ''">
+, t.end_time= #{endTime}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="feeMoney !=null and feeMoney != ''">
+, t.fee_money= #{feeMoney}
+</if> 
+ where 1=1 <if test="spaceId !=null and spaceId != ''">
+and t.space_id= #{spaceId}
+</if> 
+
+    </update>
+
+    <!-- 查询小区场地数量 add by wuxw 2018-07-03 -->
+     <select id="queryCommunitySpacesCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from community_space t 
+where 1 =1 
+<if test="adminName !=null and adminName != ''">
+   and t.admin_name= #{adminName}
+</if> 
+<if test="spaceId !=null and spaceId != ''">
+   and t.space_id= #{spaceId}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="tel !=null and tel != ''">
+   and t.tel= #{tel}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="feeMoney !=null and feeMoney != ''">
+   and t.fee_money= #{feeMoney}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/community/ICommunitySpaceV1InnerServiceSMO.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.communitySpace.CommunitySpaceDto;
+import com.java110.po.communitySpace.CommunitySpacePo;
+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-09-30 10:21:28 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("/communitySpaceV1Api")
+public interface ICommunitySpaceV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveCommunitySpace", method = RequestMethod.POST)
+    public int saveCommunitySpace(@RequestBody  CommunitySpacePo communitySpacePo);
+
+    @RequestMapping(value = "/updateCommunitySpace", method = RequestMethod.POST)
+    public int updateCommunitySpace(@RequestBody  CommunitySpacePo communitySpacePo);
+
+    @RequestMapping(value = "/deleteCommunitySpace", method = RequestMethod.POST)
+    public int deleteCommunitySpace(@RequestBody  CommunitySpacePo communitySpacePo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param communitySpaceDto 数据对象分享
+     * @return CommunitySpaceDto 对象数据
+     */
+    @RequestMapping(value = "/queryCommunitySpaces", method = RequestMethod.POST)
+    List<CommunitySpaceDto> queryCommunitySpaces(@RequestBody CommunitySpaceDto communitySpaceDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param communitySpaceDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryCommunitySpacesCount", method = RequestMethod.POST)
+    int queryCommunitySpacesCount(@RequestBody CommunitySpaceDto communitySpaceDto);
+}

+ 71 - 0
service-community/src/main/java/com/java110/community/cmd/communitySpace/DeleteCommunitySpaceCmd.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.communitySpace;
+
+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.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.community.ICommunitySpaceV1InnerServiceSMO;
+import com.java110.po.communitySpace.CommunitySpacePo;
+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;
+
+/**
+ * 类表述:删除
+ * 服务编码:communitySpace.deleteCommunitySpace
+ * 请求路劲:/app/communitySpace.DeleteCommunitySpace
+ * add by 吴学文 at 2022-09-30 10:21:28 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 = "communitySpace.deleteCommunitySpace")
+public class DeleteCommunitySpaceCmd extends Cmd {
+    private static Logger logger = LoggerFactory.getLogger(DeleteCommunitySpaceCmd.class);
+
+    @Autowired
+    private ICommunitySpaceV1InnerServiceSMO communitySpaceV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "spaceId", "spaceId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        CommunitySpacePo communitySpacePo = BeanConvertUtil.covertBean(reqJson, CommunitySpacePo.class);
+        int flag = communitySpaceV1InnerServiceSMOImpl.deleteCommunitySpace(communitySpacePo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 81 - 0
service-community/src/main/java/com/java110/community/cmd/communitySpace/ListCommunitySpaceCmd.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.communitySpace;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.communitySpace.CommunitySpaceDto;
+import com.java110.intf.community.ICommunitySpaceV1InnerServiceSMO;
+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;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:communitySpace.listCommunitySpace
+ * 请求路劲:/app/communitySpace.ListCommunitySpace
+ * add by 吴学文 at 2022-09-30 10:21:28 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 = "communitySpace.listCommunitySpace")
+public class ListCommunitySpaceCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(ListCommunitySpaceCmd.class);
+    @Autowired
+    private ICommunitySpaceV1InnerServiceSMO communitySpaceV1InnerServiceSMOImpl;
+
+    @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 {
+
+        CommunitySpaceDto communitySpaceDto = BeanConvertUtil.covertBean(reqJson, CommunitySpaceDto.class);
+
+        int count = communitySpaceV1InnerServiceSMOImpl.queryCommunitySpacesCount(communitySpaceDto);
+
+        List<CommunitySpaceDto> communitySpaceDtos = null;
+
+        if (count > 0) {
+            communitySpaceDtos = communitySpaceV1InnerServiceSMOImpl.queryCommunitySpaces(communitySpaceDto);
+        } else {
+            communitySpaceDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, communitySpaceDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 80 - 0
service-community/src/main/java/com/java110/community/cmd/communitySpace/SaveCommunitySpaceCmd.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.communitySpace;
+
+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.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.ICommunitySpaceV1InnerServiceSMO;
+import com.java110.po.communitySpace.CommunitySpacePo;
+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;
+
+/**
+ * 类表述:保存
+ * 服务编码:communitySpace.saveCommunitySpace
+ * 请求路劲:/app/communitySpace.SaveCommunitySpace
+ * add by 吴学文 at 2022-09-30 10:21:28 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 = "communitySpace.saveCommunitySpace")
+public class SaveCommunitySpaceCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveCommunitySpaceCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private ICommunitySpaceV1InnerServiceSMO communitySpaceV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "name", "请求报文中未包含name");
+        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
+        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
+        Assert.hasKeyAndValue(reqJson, "feeMoney", "请求报文中未包含feeMoney");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        CommunitySpacePo communitySpacePo = BeanConvertUtil.covertBean(reqJson, CommunitySpacePo.class);
+        communitySpacePo.setSpaceId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = communitySpaceV1InnerServiceSMOImpl.saveCommunitySpace(communitySpacePo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 74 - 0
service-community/src/main/java/com/java110/community/cmd/communitySpace/UpdateCommunitySpaceCmd.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.communitySpace;
+
+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.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.community.ICommunitySpaceV1InnerServiceSMO;
+import com.java110.po.communitySpace.CommunitySpacePo;
+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;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:communitySpace.updateCommunitySpace
+ * 请求路劲:/app/communitySpace.UpdateCommunitySpace
+ * add by 吴学文 at 2022-09-30 10:21:28 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 = "communitySpace.updateCommunitySpace")
+public class UpdateCommunitySpaceCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateCommunitySpaceCmd.class);
+
+
+    @Autowired
+    private ICommunitySpaceV1InnerServiceSMO communitySpaceV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "spaceId", "spaceId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        CommunitySpacePo communitySpacePo = BeanConvertUtil.covertBean(reqJson, CommunitySpacePo.class);
+        int flag = communitySpaceV1InnerServiceSMOImpl.updateCommunitySpace(communitySpacePo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-community/src/main/java/com/java110/community/dao/ICommunitySpaceV1ServiceDao.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 2022-09-30 10:21:28 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 ICommunitySpaceV1ServiceDao {
+
+
+    /**
+     * 保存 小区场地信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveCommunitySpaceInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询小区场地信息(instance过程)
+     * 根据bId 查询小区场地信息
+     * @param info bId 信息
+     * @return 小区场地信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getCommunitySpaceInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改小区场地信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateCommunitySpaceInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区场地总数
+     *
+     * @param info 小区场地信息
+     * @return 小区场地数量
+     */
+    int queryCommunitySpacesCount(Map info);
+
+}

+ 112 - 0
service-community/src/main/java/com/java110/community/dao/impl/CommunitySpaceV1ServiceDaoImpl.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.ICommunitySpaceV1ServiceDao;
+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-09-30 10:21:28 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("communitySpaceV1ServiceDaoImpl")
+public class CommunitySpaceV1ServiceDaoImpl extends BaseServiceDao implements ICommunitySpaceV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(CommunitySpaceV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存小区场地信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveCommunitySpaceInfo(Map info) throws DAOException {
+        logger.debug("保存 saveCommunitySpaceInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("communitySpaceV1ServiceDaoImpl.saveCommunitySpaceInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询小区场地信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getCommunitySpaceInfo(Map info) throws DAOException {
+        logger.debug("查询 getCommunitySpaceInfo 入参 info : {}",info);
+
+        List<Map> businessCommunitySpaceInfos = sqlSessionTemplate.selectList("communitySpaceV1ServiceDaoImpl.getCommunitySpaceInfo",info);
+
+        return businessCommunitySpaceInfos;
+    }
+
+
+    /**
+     * 修改小区场地信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateCommunitySpaceInfo(Map info) throws DAOException {
+        logger.debug("修改 updateCommunitySpaceInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("communitySpaceV1ServiceDaoImpl.updateCommunitySpaceInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询小区场地数量
+     * @param info 小区场地信息
+     * @return 小区场地数量
+     */
+    @Override
+    public int queryCommunitySpacesCount(Map info) {
+        logger.debug("查询 queryCommunitySpacesCount 入参 info : {}",info);
+
+        List<Map> businessCommunitySpaceInfos = sqlSessionTemplate.selectList("communitySpaceV1ServiceDaoImpl.queryCommunitySpacesCount", info);
+        if (businessCommunitySpaceInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessCommunitySpaceInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-community/src/main/java/com/java110/community/smo/impl/CommunitySpaceV1InnerServiceSMOImpl.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.ICommunitySpaceV1ServiceDao;
+import com.java110.intf.community.ICommunitySpaceV1InnerServiceSMO;
+import com.java110.dto.communitySpace.CommunitySpaceDto;
+import com.java110.po.communitySpace.CommunitySpacePo;
+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-09-30 10:21:28 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 CommunitySpaceV1InnerServiceSMOImpl extends BaseServiceSMO implements ICommunitySpaceV1InnerServiceSMO {
+
+    @Autowired
+    private ICommunitySpaceV1ServiceDao communitySpaceV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveCommunitySpace(@RequestBody  CommunitySpacePo communitySpacePo) {
+        int saveFlag = communitySpaceV1ServiceDaoImpl.saveCommunitySpaceInfo(BeanConvertUtil.beanCovertMap(communitySpacePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateCommunitySpace(@RequestBody  CommunitySpacePo communitySpacePo) {
+        int saveFlag = communitySpaceV1ServiceDaoImpl.updateCommunitySpaceInfo(BeanConvertUtil.beanCovertMap(communitySpacePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteCommunitySpace(@RequestBody  CommunitySpacePo communitySpacePo) {
+       communitySpacePo.setStatusCd("1");
+       int saveFlag = communitySpaceV1ServiceDaoImpl.updateCommunitySpaceInfo(BeanConvertUtil.beanCovertMap(communitySpacePo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<CommunitySpaceDto> queryCommunitySpaces(@RequestBody  CommunitySpaceDto communitySpaceDto) {
+
+        //校验是否传了 分页信息
+
+        int page = communitySpaceDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            communitySpaceDto.setPage((page - 1) * communitySpaceDto.getRow());
+        }
+
+        List<CommunitySpaceDto> communitySpaces = BeanConvertUtil.covertBeanList(communitySpaceV1ServiceDaoImpl.getCommunitySpaceInfo(BeanConvertUtil.beanCovertMap(communitySpaceDto)), CommunitySpaceDto.class);
+
+        return communitySpaces;
+    }
+
+
+    @Override
+    public int queryCommunitySpacesCount(@RequestBody CommunitySpaceDto communitySpaceDto) {
+        return communitySpaceV1ServiceDaoImpl.queryCommunitySpacesCount(BeanConvertUtil.beanCovertMap(communitySpaceDto));    }
+
+}