java110 пре 3 година
родитељ
комит
d7ae449bce

+ 115 - 0
java110-db/src/main/resources/mapper/user/OrgCommunityV1ServiceDaoImplMapper.xml

@@ -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="orgCommunityV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存组织小区信息 add by wuxw 2018-07-03 -->
+    <insert id="saveOrgCommunityInfo" parameterType="Map">
+        insert into u_org_community(
+org_name,community_name,community_id,store_id,org_id,org_community_id
+) values (
+#{orgName},#{communityName},#{communityId},#{storeId},#{orgId},#{orgCommunityId}
+)
+    </insert>
+
+
+
+    <!-- 查询组织小区信息 add by wuxw 2018-07-03 -->
+    <select id="getOrgCommunityInfo" parameterType="Map" resultType="Map">
+        select  t.org_name,t.org_name orgName,t.community_name,t.community_name communityName,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.store_id,t.store_id storeId,t.org_id,t.org_id orgId,t.org_community_id,t.org_community_id orgCommunityId 
+from u_org_community t 
+where 1 =1 
+<if test="orgName !=null and orgName != ''">
+   and t.org_name= #{orgName}
+</if> 
+<if test="communityName !=null and communityName != ''">
+   and t.community_name= #{communityName}
+</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="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+   and t.org_id= #{orgId}
+</if> 
+<if test="orgCommunityId !=null and orgCommunityId != ''">
+   and t.org_community_id= #{orgCommunityId}
+</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="updateOrgCommunityInfo" parameterType="Map">
+        update  u_org_community t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="orgName !=null and orgName != ''">
+, t.org_name= #{orgName}
+</if> 
+<if test="communityName !=null and communityName != ''">
+, t.community_name= #{communityName}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="storeId !=null and storeId != ''">
+, t.store_id= #{storeId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+, t.org_id= #{orgId}
+</if> 
+ where 1=1 <if test="orgCommunityId !=null and orgCommunityId != ''">
+and t.org_community_id= #{orgCommunityId}
+</if> 
+
+    </update>
+
+    <!-- 查询组织小区数量 add by wuxw 2018-07-03 -->
+     <select id="queryOrgCommunitysCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from u_org_community t 
+where 1 =1 
+<if test="orgName !=null and orgName != ''">
+   and t.org_name= #{orgName}
+</if> 
+<if test="communityName !=null and communityName != ''">
+   and t.community_name= #{communityName}
+</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="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+   and t.org_id= #{orgId}
+</if> 
+<if test="orgCommunityId !=null and orgCommunityId != ''">
+   and t.org_community_id= #{orgCommunityId}
+</if> 
+
+
+     </select>
+
+</mapper>

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

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.org.OrgCommunityDto;
+import com.java110.po.community.OrgCommunityPo;
+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-08-08 18:05:07 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "user-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/orgCommunityV1Api")
+public interface IOrgCommunityV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveOrgCommunity", method = RequestMethod.POST)
+    public int saveOrgCommunity(@RequestBody OrgCommunityPo orgCommunityPo);
+
+    @RequestMapping(value = "/updateOrgCommunity", method = RequestMethod.POST)
+    public int updateOrgCommunity(@RequestBody  OrgCommunityPo orgCommunityPo);
+
+    @RequestMapping(value = "/deleteOrgCommunity", method = RequestMethod.POST)
+    public int deleteOrgCommunity(@RequestBody  OrgCommunityPo orgCommunityPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param orgCommunityDto 数据对象分享
+     * @return OrgCommunityDto 对象数据
+     */
+    @RequestMapping(value = "/queryOrgCommunitys", method = RequestMethod.POST)
+    List<OrgCommunityDto> queryOrgCommunitys(@RequestBody OrgCommunityDto orgCommunityDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param orgCommunityDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryOrgCommunitysCount", method = RequestMethod.POST)
+    int queryOrgCommunitysCount(@RequestBody OrgCommunityDto orgCommunityDto);
+}

+ 0 - 51
service-api/src/main/java/com/java110/api/listener/org/DeleteOrgCommunityListener.java

@@ -1,51 +0,0 @@
-package com.java110.api.listener.org;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.org.IOrgBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeOrgConstant;
-import com.java110.utils.util.Assert;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteOrgCommunityListener")
-public class DeleteOrgCommunityListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IOrgBMO orgBMOImpl;
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "orgCommunityId", "组织ID不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        orgBMOImpl.deleteOrgCommunity(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeOrgConstant.DELETE_ORG_COMMUNITY;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-}

+ 0 - 61
service-api/src/main/java/com/java110/api/listener/org/SaveOrgCommunityListener.java

@@ -1,61 +0,0 @@
-package com.java110.api.listener.org;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.org.IOrgBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeOrgConstant;
-import com.java110.utils.util.Assert;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("saveOrgCommunityListener")
-public class SaveOrgCommunityListener extends AbstractServiceApiPlusListener {
-    @Autowired
-    private IOrgBMO orgBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "orgId", "必填,请填写组织ID");
-        Assert.hasKeyAndValue(reqJson, "orgName", "必填,请填写组织名称");
-        if (!reqJson.containsKey("communitys") || reqJson.getJSONArray("communitys").size() < 1) {
-            throw new IllegalArgumentException("未包含小区信息");
-        }
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-
-        //添加单元信息
-        JSONArray communitys = reqJson.getJSONArray("communitys");
-        for (int communityIndex = 0; communityIndex < communitys.size(); communityIndex++) {
-            orgBMOImpl.addOrgCommunity(reqJson, communitys.getJSONObject(communityIndex), communityIndex, context);
-        }
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeOrgConstant.ADD_ORG_COMMUNITY;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-}

+ 71 - 0
service-user/src/main/java/com/java110/user/cmd/org/DeleteOrgCommunityCmd.java

@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.org;
+
+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.user.IOrgCommunityV1InnerServiceSMO;
+import com.java110.po.community.OrgCommunityPo;
+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;
+
+/**
+ * 类表述:删除
+ * 服务编码:orgCommunity.deleteOrgCommunity
+ * 请求路劲:/app/orgCommunity.DeleteOrgCommunity
+ * add by 吴学文 at 2022-08-08 18:05:07 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 = "org.deleteOrgCommunity")
+public class DeleteOrgCommunityCmd extends Cmd {
+    private static Logger logger = LoggerFactory.getLogger(DeleteOrgCommunityCmd.class);
+
+    @Autowired
+    private IOrgCommunityV1InnerServiceSMO orgCommunityV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "orgCommunityId", "组织ID不能为空");
+
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        OrgCommunityPo orgCommunityPo = BeanConvertUtil.covertBean(reqJson, OrgCommunityPo.class);
+        int flag = orgCommunityV1InnerServiceSMOImpl.deleteOrgCommunity(orgCommunityPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 100 - 0
service-user/src/main/java/com/java110/user/cmd/org/SaveOrgCommunityCmd.java

@@ -0,0 +1,100 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.cmd.org;
+
+import com.alibaba.fastjson.JSONArray;
+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.user.IOrgCommunityV1InnerServiceSMO;
+import com.java110.po.community.OrgCommunityPo;
+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;
+
+/**
+ * 类表述:保存
+ * 服务编码:orgCommunity.saveOrgCommunity
+ * 请求路劲:/app/orgCommunity.SaveOrgCommunity
+ * add by 吴学文 at 2022-08-08 18:05:07 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 = "org.saveOrgCommunity")
+public class SaveOrgCommunityCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveOrgCommunityCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IOrgCommunityV1InnerServiceSMO orgCommunityV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "orgId", "必填,请填写组织ID");
+        Assert.hasKeyAndValue(reqJson, "orgName", "必填,请填写组织名称");
+        if (!reqJson.containsKey("communitys") || reqJson.getJSONArray("communitys").size() < 1) {
+            throw new IllegalArgumentException("未包含小区信息");
+        }
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        JSONArray communitys = reqJson.getJSONArray("communitys");
+        for (int communityIndex = 0; communityIndex < communitys.size(); communityIndex++) {
+            addOrgCommunity(reqJson, communitys.getJSONObject(communityIndex), communityIndex);
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson 接口调用放传入入参
+     * @return 订单服务能够接受的报文
+     */
+    public void addOrgCommunity(JSONObject paramInJson, JSONObject communityObj, int seq) {
+
+        JSONObject businessOrg = new JSONObject();
+        businessOrg.putAll(paramInJson);
+        businessOrg.put("communityId", communityObj.getString("communityId"));
+        businessOrg.put("communityName", communityObj.getString("communityName"));
+
+        OrgCommunityPo orgCommunityPo = BeanConvertUtil.covertBean(businessOrg, OrgCommunityPo.class);
+        orgCommunityPo.setOrgCommunityId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+
+        int flag = orgCommunityV1InnerServiceSMOImpl.saveOrgCommunity(orgCommunityPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+    }
+}

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

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-08-08 18:05:07 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 IOrgCommunityV1ServiceDao {
+
+
+    /**
+     * 保存 组织小区信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveOrgCommunityInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询组织小区信息(instance过程)
+     * 根据bId 查询组织小区信息
+     * @param info bId 信息
+     * @return 组织小区信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getOrgCommunityInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改组织小区信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateOrgCommunityInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询组织小区总数
+     *
+     * @param info 组织小区信息
+     * @return 组织小区数量
+     */
+    int queryOrgCommunitysCount(Map info);
+
+}

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

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.IOrgCommunityV1ServiceDao;
+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-08-08 18:05:07 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("orgCommunityV1ServiceDaoImpl")
+public class OrgCommunityV1ServiceDaoImpl extends BaseServiceDao implements IOrgCommunityV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(OrgCommunityV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存组织小区信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveOrgCommunityInfo(Map info) throws DAOException {
+        logger.debug("保存 saveOrgCommunityInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("orgCommunityV1ServiceDaoImpl.saveOrgCommunityInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询组织小区信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getOrgCommunityInfo(Map info) throws DAOException {
+        logger.debug("查询 getOrgCommunityInfo 入参 info : {}",info);
+
+        List<Map> businessOrgCommunityInfos = sqlSessionTemplate.selectList("orgCommunityV1ServiceDaoImpl.getOrgCommunityInfo",info);
+
+        return businessOrgCommunityInfos;
+    }
+
+
+    /**
+     * 修改组织小区信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateOrgCommunityInfo(Map info) throws DAOException {
+        logger.debug("修改 updateOrgCommunityInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("orgCommunityV1ServiceDaoImpl.updateOrgCommunityInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询组织小区数量
+     * @param info 组织小区信息
+     * @return 组织小区数量
+     */
+    @Override
+    public int queryOrgCommunitysCount(Map info) {
+        logger.debug("查询 queryOrgCommunitysCount 入参 info : {}",info);
+
+        List<Map> businessOrgCommunityInfos = sqlSessionTemplate.selectList("orgCommunityV1ServiceDaoImpl.queryOrgCommunitysCount", info);
+        if (businessOrgCommunityInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessOrgCommunityInfos.get(0).get("count").toString());
+    }
+
+
+}

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

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.user.smo.impl;
+
+
+import com.java110.dto.org.OrgCommunityDto;
+import com.java110.po.community.OrgCommunityPo;
+import com.java110.user.dao.IOrgCommunityV1ServiceDao;
+import com.java110.intf.user.IOrgCommunityV1InnerServiceSMO;
+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-08-08 18:05:07 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 OrgCommunityV1InnerServiceSMOImpl extends BaseServiceSMO implements IOrgCommunityV1InnerServiceSMO {
+
+    @Autowired
+    private IOrgCommunityV1ServiceDao orgCommunityV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveOrgCommunity(@RequestBody OrgCommunityPo orgCommunityPo) {
+        int saveFlag = orgCommunityV1ServiceDaoImpl.saveOrgCommunityInfo(BeanConvertUtil.beanCovertMap(orgCommunityPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateOrgCommunity(@RequestBody  OrgCommunityPo orgCommunityPo) {
+        int saveFlag = orgCommunityV1ServiceDaoImpl.updateOrgCommunityInfo(BeanConvertUtil.beanCovertMap(orgCommunityPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteOrgCommunity(@RequestBody  OrgCommunityPo orgCommunityPo) {
+       orgCommunityPo.setStatusCd("1");
+       int saveFlag = orgCommunityV1ServiceDaoImpl.updateOrgCommunityInfo(BeanConvertUtil.beanCovertMap(orgCommunityPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<OrgCommunityDto> queryOrgCommunitys(@RequestBody OrgCommunityDto orgCommunityDto) {
+
+        //校验是否传了 分页信息
+
+        int page = orgCommunityDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            orgCommunityDto.setPage((page - 1) * orgCommunityDto.getRow());
+        }
+
+        List<OrgCommunityDto> orgCommunitys = BeanConvertUtil.covertBeanList(orgCommunityV1ServiceDaoImpl.getOrgCommunityInfo(BeanConvertUtil.beanCovertMap(orgCommunityDto)), OrgCommunityDto.class);
+
+        return orgCommunitys;
+    }
+
+
+    @Override
+    public int queryOrgCommunitysCount(@RequestBody OrgCommunityDto orgCommunityDto) {
+        return orgCommunityV1ServiceDaoImpl.queryOrgCommunitysCount(BeanConvertUtil.beanCovertMap(orgCommunityDto));    }
+
+}