java110
2021-09-23 29af678f6bb1dd6200f7c2c0811b35306659f84a
优化小区功能
2个文件已修改
11个文件已添加
1069 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/parkingAreaText/ParkingAreaTextDto.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/parkingAreaText/ParkingAreaTextPo.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/ParkingAreaTextV1ServiceDaoImplMapper.xml 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-generator/src/main/java/com/java110/code/TableToJson.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-generator/src/main/resources/newBack/template_1.json 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/community/IParkingAreaTextV1InnerServiceSMO.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/DeleteParkingAreaTextCmd.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/ListParkingAreaTextCmd.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/SaveParkingAreaTextCmd.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/UpdateParkingAreaTextCmd.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/IParkingAreaTextV1ServiceDao.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/impl/ParkingAreaTextV1ServiceDaoImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/smo/impl/ParkingAreaTextV1InnerServiceSMOImpl.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/parkingAreaText/ParkingAreaTextDto.java
New file
@@ -0,0 +1,104 @@
package com.java110.dto.parkingAreaText;
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 ParkingAreaTextDto extends PageDto implements Serializable {
    private String voice;
private String textId;
private String typeCd;
private String text3;
private String text4;
private String text1;
private String text2;
private String paId;
private String communityId;
    private Date createTime;
    private String statusCd = "0";
    public String getVoice() {
        return voice;
    }
public void setVoice(String voice) {
        this.voice = voice;
    }
public String getTextId() {
        return textId;
    }
public void setTextId(String textId) {
        this.textId = textId;
    }
public String getTypeCd() {
        return typeCd;
    }
public void setTypeCd(String typeCd) {
        this.typeCd = typeCd;
    }
public String getText3() {
        return text3;
    }
public void setText3(String text3) {
        this.text3 = text3;
    }
public String getText4() {
        return text4;
    }
public void setText4(String text4) {
        this.text4 = text4;
    }
public String getText1() {
        return text1;
    }
public void setText1(String text1) {
        this.text1 = text1;
    }
public String getText2() {
        return text2;
    }
public void setText2(String text2) {
        this.text2 = text2;
    }
public String getPaId() {
        return paId;
    }
public void setPaId(String paId) {
        this.paId = paId;
    }
public String getCommunityId() {
        return communityId;
    }
public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    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/parkingAreaText/ParkingAreaTextPo.java
New file
@@ -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.parkingAreaText;
import java.io.Serializable;
import java.util.Date;
/**
 * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
 * add by 吴学文 at 2021-09-23 18:15:21 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 ParkingAreaTextPo implements Serializable {
    private String voice;
private String textId;
private String typeCd;
private String text3;
private String text4;
private String text1;
private String text2;
private String paId;
private String statusCd = "0";
private String communityId;
public String getVoice() {
        return voice;
    }
public void setVoice(String voice) {
        this.voice = voice;
    }
public String getTextId() {
        return textId;
    }
public void setTextId(String textId) {
        this.textId = textId;
    }
public String getTypeCd() {
        return typeCd;
    }
public void setTypeCd(String typeCd) {
        this.typeCd = typeCd;
    }
public String getText3() {
        return text3;
    }
public void setText3(String text3) {
        this.text3 = text3;
    }
public String getText4() {
        return text4;
    }
public void setText4(String text4) {
        this.text4 = text4;
    }
public String getText1() {
        return text1;
    }
public void setText1(String text1) {
        this.text1 = text1;
    }
public String getText2() {
        return text2;
    }
public void setText2(String text2) {
        this.text2 = text2;
    }
public String getPaId() {
        return paId;
    }
public void setPaId(String paId) {
        this.paId = paId;
    }
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;
    }
}
java110-db/src/main/resources/mapper/community/ParkingAreaTextV1ServiceDaoImplMapper.xml
New file
@@ -0,0 +1,139 @@
<?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="parkingAreaTextV1ServiceDaoImpl">
    <!-- 保存停车场道闸文字语音配置信息 add by wuxw 2018-07-03 -->
    <insert id="saveParkingAreaTextInfo" parameterType="Map">
        insert into parking_area_text(
        voice,text_id,type_cd,text3,text4,text1,text2,pa_id,community_id
        ) values (
        #{voice},#{textId},#{typeCd},#{text3},#{text4},#{text1},#{text2},#{paId},#{communityId}
        )
    </insert>
    <!-- 查询停车场道闸文字语音配置信息 add by wuxw 2018-07-03 -->
    <select id="getParkingAreaTextInfo" parameterType="Map" resultType="Map">
        select t.voice,t.text_id,t.text_id textId,t.type_cd,t.type_cd
        typeCd,t.text3,t.text4,t.text1,t.text2,t.pa_id,t.pa_id paId,t.status_cd,t.status_cd
        statusCd,t.community_id,t.community_id communityId
        from parking_area_text t
        where 1 =1
        <if test="voice !=null and voice != ''">
            and t.voice= #{voice}
        </if>
        <if test="textId !=null and textId != ''">
            and t.text_id= #{textId}
        </if>
        <if test="typeCd !=null and typeCd != ''">
            and t.type_cd= #{typeCd}
        </if>
        <if test="text3 !=null and text3 != ''">
            and t.text3= #{text3}
        </if>
        <if test="text4 !=null and text4 != ''">
            and t.text4= #{text4}
        </if>
        <if test="text1 !=null and text1 != ''">
            and t.text1= #{text1}
        </if>
        <if test="text2 !=null and text2 != ''">
            and t.text2= #{text2}
        </if>
        <if test="paId !=null and paId != ''">
            and t.pa_id= #{paId}
        </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>
        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="updateParkingAreaTextInfo" parameterType="Map">
        update parking_area_text t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="voice !=null and voice != ''">
            , t.voice= #{voice}
        </if>
        <if test="typeCd !=null and typeCd != ''">
            , t.type_cd= #{typeCd}
        </if>
        <if test="text3 !=null and text3 != ''">
            , t.text3= #{text3}
        </if>
        <if test="text4 !=null and text4 != ''">
            , t.text4= #{text4}
        </if>
        <if test="text1 !=null and text1 != ''">
            , t.text1= #{text1}
        </if>
        <if test="text2 !=null and text2 != ''">
            , t.text2= #{text2}
        </if>
        <if test="paId !=null and paId != ''">
            , t.pa_id= #{paId}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        where 1=1
        <if test="textId !=null and textId != ''">
            and t.text_id= #{textId}
        </if>
    </update>
    <!-- 查询停车场道闸文字语音配置数量 add by wuxw 2018-07-03 -->
    <select id="queryParkingAreaTextsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from parking_area_text t
        where 1 =1
        <if test="voice !=null and voice != ''">
            and t.voice= #{voice}
        </if>
        <if test="textId !=null and textId != ''">
            and t.text_id= #{textId}
        </if>
        <if test="typeCd !=null and typeCd != ''">
            and t.type_cd= #{typeCd}
        </if>
        <if test="text3 !=null and text3 != ''">
            and t.text3= #{text3}
        </if>
        <if test="text4 !=null and text4 != ''">
            and t.text4= #{text4}
        </if>
        <if test="text1 !=null and text1 != ''">
            and t.text1= #{text1}
        </if>
        <if test="text2 !=null and text2 != ''">
            and t.text2= #{text2}
        </if>
        <if test="paId !=null and paId != ''">
            and t.pa_id= #{paId}
        </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>
    </select>
</mapper>
java110-generator/src/main/java/com/java110/code/TableToJson.java
@@ -7,16 +7,17 @@
public class TableToJson {
    //show create table c_orders  用这个语句获取
    public static final String createTableSql = "CREATE TABLE `pay_fee_batch` (\n" +
            "  `batch_id` varchar(30) NOT NULL COMMENT '批次号',\n" +
    public static final String createTableSql = "CREATE TABLE `parking_area_text` (\n" +
            "  `pa_id` varchar(30) NOT NULL COMMENT '停车场ID',\n" +
            "  `community_id` varchar(30) NOT NULL COMMENT '小区ID',\n" +
            "   create_user_id varchar(30) not null comment '创建人',\n" +
            " create_user_name varchar(64) not null comment '创建人',\n" +
            "  `type_cd` varchar(12) NOT NULL COMMENT '类型:1001 月租车进场,2002 月租车出场,3003 月租车到期,4004 临时车进场 5005 临时车出场 6006 临时车未缴费',\n" +
            "  `text1` varchar(512) NOT NULL COMMENT '文字显示第一行',\n" +
            "  `text2` varchar(512) NOT NULL COMMENT '文字显示第二行',\n" +
            "  `text3` varchar(512) NOT NULL COMMENT '文字显示第三行',\n" +
            "  `text4` varchar(512) NOT NULL COMMENT '文字显示第四行',\n" +
            "  `voice` varchar(512) NOT NULL COMMENT '语音播放',\n" +
            "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',\n" +
            "  `state` varchar(12) NOT NULL DEFAULT '2007001' COMMENT '状态 2007001待审核 2008001 审核通过 2009001 审核失败',\n" +
            "  `msg` varchar(512) NOT NULL  COMMENT '审核说明',\n" +
            "`remark` varchar(512)  COMMENT '备注'\n" +
            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'\n" +
            ")";
    public static void main(String[] args) {
java110-generator/src/main/resources/newBack/template_1.json
@@ -1,34 +1,56 @@
{
  "param": {
    "msg": "msg",
    "createUserId": "create_user_id",
    "createUserName": "create_user_name",
    "voice": "voice",
    "typeCd": "type_cd",
    "text3": "text3",
    "text4": "text4",
    "text1": "text1",
    "text2": "text2",
    "paId": "pa_id",
    "textId": "text_id",
    "statusCd": "status_cd",
    "remark": "remark",
    "state": "state",
    "batchId": "batch_id",
    "communityId": "community_id"
  },
  "name": "payFeeBatch",
  "name": "parkingAreaText",
  "shareColumn": "community_id",
  "id": "batchId",
  "shareName": "fee",
  "id": "textId",
  "shareName": "community",
  "autoMove": true,
  "required": [
    {
      "msg": "停车场ID不能为空",
      "code": "paId"
    },
    {
      "msg": "小区ID不能为空",
      "code": "communityId"
    },
    {
      "msg": "createUserId不能为空",
      "code": "createUserId"
      "msg": "类型:1001不能为空",
      "code": "typeCd"
    },
    {
      "msg": "createUserName不能为空",
      "code": "createUserName"
      "msg": "文字显示第一行不能为空",
      "code": "text1"
    },
    {
      "msg": "文字显示第二行不能为空",
      "code": "text2"
    },
    {
      "msg": "文字显示第三行不能为空",
      "code": "text3"
    },
    {
      "msg": "文字显示第四行不能为空",
      "code": "text4"
    },
    {
      "msg": "语音播放不能为空",
      "code": "voice"
    }
  ],
  "desc": "费用批次",
  "desc": "停车场道闸文字语音配置",
  "shareParam": "communityId",
  "tableName": "pay_fee_batch"
  "tableName": "parking_area_text"
}
java110-interface/src/main/java/com/java110/intf/community/IParkingAreaTextV1InnerServiceSMO.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.parkingAreaText.ParkingAreaTextDto;
import com.java110.po.parkingAreaText.ParkingAreaTextPo;
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-09-23 18:15:21 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("/parkingAreaTextV1Api")
public interface IParkingAreaTextV1InnerServiceSMO {
    @RequestMapping(value = "/saveParkingAreaText", method = RequestMethod.POST)
    public int saveParkingAreaText(@RequestBody  ParkingAreaTextPo parkingAreaTextPo);
    @RequestMapping(value = "/updateParkingAreaText", method = RequestMethod.POST)
    public int updateParkingAreaText(@RequestBody  ParkingAreaTextPo parkingAreaTextPo);
    @RequestMapping(value = "/deleteParkingAreaText", method = RequestMethod.POST)
    public int deleteParkingAreaText(@RequestBody  ParkingAreaTextPo parkingAreaTextPo);
    /**
     * <p>查询小区楼信息</p>
     *
     *
     * @param parkingAreaTextDto 数据对象分享
     * @return ParkingAreaTextDto 对象数据
     */
    @RequestMapping(value = "/queryParkingAreaTexts", method = RequestMethod.POST)
    List<ParkingAreaTextDto> queryParkingAreaTexts(@RequestBody ParkingAreaTextDto parkingAreaTextDto);
    /**
     * 查询<p>小区楼</p>总记录数
     *
     * @param parkingAreaTextDto 数据对象分享
     * @return 小区下的小区楼记录数
     */
    @RequestMapping(value = "/queryParkingAreaTextsCount", method = RequestMethod.POST)
    int queryParkingAreaTextsCount(@RequestBody ParkingAreaTextDto parkingAreaTextDto);
}
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/DeleteParkingAreaTextCmd.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.parkingAreaText;
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.IParkingAreaTextV1InnerServiceSMO;
import com.java110.po.parkingAreaText.ParkingAreaTextPo;
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;
/**
 * 类表述:删除
 * 服务编码:parkingAreaText.deleteParkingAreaText
 * 请求路劲:/app/parkingAreaText.DeleteParkingAreaText
 * add by 吴学文 at 2021-09-23 18:15:21 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 = "parkingAreaText.deleteParkingAreaText")
public class DeleteParkingAreaTextCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(DeleteParkingAreaTextCmd.class);
    @Autowired
    private IParkingAreaTextV1InnerServiceSMO parkingAreaTextV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "textId", "textId不能为空");
        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        ParkingAreaTextPo parkingAreaTextPo = BeanConvertUtil.covertBean(reqJson, ParkingAreaTextPo.class);
        int flag = parkingAreaTextV1InnerServiceSMOImpl.deleteParkingAreaText(parkingAreaTextPo);
        if (flag < 1) {
            throw new CmdException("删除数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/ListParkingAreaTextCmd.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.parkingAreaText;
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.parkingAreaText.ParkingAreaTextDto;
import com.java110.intf.community.IParkingAreaTextV1InnerServiceSMO;
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;
/**
 * 类表述:查询
 * 服务编码:parkingAreaText.listParkingAreaText
 * 请求路劲:/app/parkingAreaText.ListParkingAreaText
 * add by 吴学文 at 2021-09-23 18:15:21 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 = "parkingAreaText.listParkingAreaText")
public class ListParkingAreaTextCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(ListParkingAreaTextCmd.class);
    @Autowired
    private IParkingAreaTextV1InnerServiceSMO parkingAreaTextV1InnerServiceSMOImpl;
    @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 {
        ParkingAreaTextDto parkingAreaTextDto = BeanConvertUtil.covertBean(reqJson, ParkingAreaTextDto.class);
        int count = parkingAreaTextV1InnerServiceSMOImpl.queryParkingAreaTextsCount(parkingAreaTextDto);
        List<ParkingAreaTextDto> parkingAreaTextDtos = null;
        if (count > 0) {
            parkingAreaTextDtos = parkingAreaTextV1InnerServiceSMOImpl.queryParkingAreaTexts(parkingAreaTextDto);
        } else {
            parkingAreaTextDtos = new ArrayList<>();
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, parkingAreaTextDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        cmdDataFlowContext.setResponseEntity(responseEntity);
    }
}
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/SaveParkingAreaTextCmd.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.community.cmd.parkingAreaText;
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.IParkingAreaTextV1InnerServiceSMO;
import com.java110.po.parkingAreaText.ParkingAreaTextPo;
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;
/**
 * 类表述:保存
 * 服务编码:parkingAreaText.saveParkingAreaText
 * 请求路劲:/app/parkingAreaText.SaveParkingAreaText
 * add by 吴学文 at 2021-09-23 18:15:21 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 = "parkingAreaText.saveParkingAreaText")
public class SaveParkingAreaTextCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(SaveParkingAreaTextCmd.class);
    public static final String CODE_PREFIX_ID = "10";
    @Autowired
    private IParkingAreaTextV1InnerServiceSMO parkingAreaTextV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "paId", "请求报文中未包含paId");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
        Assert.hasKeyAndValue(reqJson, "typeCd", "请求报文中未包含typeCd");
        Assert.hasKeyAndValue(reqJson, "text1", "请求报文中未包含text1");
        Assert.hasKeyAndValue(reqJson, "text2", "请求报文中未包含text2");
        Assert.hasKeyAndValue(reqJson, "text3", "请求报文中未包含text3");
        Assert.hasKeyAndValue(reqJson, "text4", "请求报文中未包含text4");
        Assert.hasKeyAndValue(reqJson, "voice", "请求报文中未包含voice");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        ParkingAreaTextPo parkingAreaTextPo = BeanConvertUtil.covertBean(reqJson, ParkingAreaTextPo.class);
        parkingAreaTextPo.setTextId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
        int flag = parkingAreaTextV1InnerServiceSMOImpl.saveParkingAreaText(parkingAreaTextPo);
        if (flag < 1) {
            throw new CmdException("保存数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-community/src/main/java/com/java110/community/cmd/parkingAreaText/UpdateParkingAreaTextCmd.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.parkingAreaText;
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.IParkingAreaTextV1InnerServiceSMO;
import com.java110.po.parkingAreaText.ParkingAreaTextPo;
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;
/**
 * 类表述:更新
 * 服务编码:parkingAreaText.updateParkingAreaText
 * 请求路劲:/app/parkingAreaText.UpdateParkingAreaText
 * add by 吴学文 at 2021-09-23 18:15:21 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 = "parkingAreaText.updateParkingAreaText")
public class UpdateParkingAreaTextCmd extends AbstractServiceCmdListener {
    private static Logger logger = LoggerFactory.getLogger(UpdateParkingAreaTextCmd.class);
    @Autowired
    private IParkingAreaTextV1InnerServiceSMO parkingAreaTextV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "textId", "textId不能为空");
        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        ParkingAreaTextPo parkingAreaTextPo = BeanConvertUtil.covertBean(reqJson, ParkingAreaTextPo.class);
        int flag = parkingAreaTextV1InnerServiceSMOImpl.updateParkingAreaText(parkingAreaTextPo);
        if (flag < 1) {
            throw new CmdException("更新数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-community/src/main/java/com/java110/community/dao/IParkingAreaTextV1ServiceDao.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-09-23 18:15:21 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 IParkingAreaTextV1ServiceDao {
    /**
     * 保存 停车场道闸文字语音配置信息
     * @param info
     * @throws DAOException DAO异常
     */
    int saveParkingAreaTextInfo(Map info) throws DAOException;
    /**
     * 查询停车场道闸文字语音配置信息(instance过程)
     * 根据bId 查询停车场道闸文字语音配置信息
     * @param info bId 信息
     * @return 停车场道闸文字语音配置信息
     * @throws DAOException DAO异常
     */
    List<Map> getParkingAreaTextInfo(Map info) throws DAOException;
    /**
     * 修改停车场道闸文字语音配置信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    int updateParkingAreaTextInfo(Map info) throws DAOException;
    /**
     * 查询停车场道闸文字语音配置总数
     *
     * @param info 停车场道闸文字语音配置信息
     * @return 停车场道闸文字语音配置数量
     */
    int queryParkingAreaTextsCount(Map info);
}
service-community/src/main/java/com/java110/community/dao/impl/ParkingAreaTextV1ServiceDaoImpl.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.IParkingAreaTextV1ServiceDao;
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-09-23 18:15:21 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("parkingAreaTextV1ServiceDaoImpl")
public class ParkingAreaTextV1ServiceDaoImpl extends BaseServiceDao implements IParkingAreaTextV1ServiceDao {
    private static Logger logger = LoggerFactory.getLogger(ParkingAreaTextV1ServiceDaoImpl.class);
    /**
     * 保存停车场道闸文字语音配置信息 到 instance
     * @param info   bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public int saveParkingAreaTextInfo(Map info) throws DAOException {
        logger.debug("保存 saveParkingAreaTextInfo 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.insert("parkingAreaTextV1ServiceDaoImpl.saveParkingAreaTextInfo",info);
        return saveFlag;
    }
    /**
     * 查询停车场道闸文字语音配置信息(instance)
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getParkingAreaTextInfo(Map info) throws DAOException {
        logger.debug("查询 getParkingAreaTextInfo 入参 info : {}",info);
        List<Map> businessParkingAreaTextInfos = sqlSessionTemplate.selectList("parkingAreaTextV1ServiceDaoImpl.getParkingAreaTextInfo",info);
        return businessParkingAreaTextInfos;
    }
    /**
     * 修改停车场道闸文字语音配置信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public int updateParkingAreaTextInfo(Map info) throws DAOException {
        logger.debug("修改 updateParkingAreaTextInfo 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.update("parkingAreaTextV1ServiceDaoImpl.updateParkingAreaTextInfo",info);
        return saveFlag;
    }
     /**
     * 查询停车场道闸文字语音配置数量
     * @param info 停车场道闸文字语音配置信息
     * @return 停车场道闸文字语音配置数量
     */
    @Override
    public int queryParkingAreaTextsCount(Map info) {
        logger.debug("查询 queryParkingAreaTextsCount 入参 info : {}",info);
        List<Map> businessParkingAreaTextInfos = sqlSessionTemplate.selectList("parkingAreaTextV1ServiceDaoImpl.queryParkingAreaTextsCount", info);
        if (businessParkingAreaTextInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessParkingAreaTextInfos.get(0).get("count").toString());
    }
}
service-community/src/main/java/com/java110/community/smo/impl/ParkingAreaTextV1InnerServiceSMOImpl.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.IParkingAreaTextV1ServiceDao;
import com.java110.intf.community.IParkingAreaTextV1InnerServiceSMO;
import com.java110.dto.parkingAreaText.ParkingAreaTextDto;
import com.java110.po.parkingAreaText.ParkingAreaTextPo;
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-09-23 18:15:21 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 ParkingAreaTextV1InnerServiceSMOImpl extends BaseServiceSMO implements IParkingAreaTextV1InnerServiceSMO {
    @Autowired
    private IParkingAreaTextV1ServiceDao parkingAreaTextV1ServiceDaoImpl;
    @Override
    public int saveParkingAreaText(@RequestBody  ParkingAreaTextPo parkingAreaTextPo) {
        int saveFlag = parkingAreaTextV1ServiceDaoImpl.saveParkingAreaTextInfo(BeanConvertUtil.beanCovertMap(parkingAreaTextPo));
        return saveFlag;
    }
     @Override
    public int updateParkingAreaText(@RequestBody  ParkingAreaTextPo parkingAreaTextPo) {
        int saveFlag = parkingAreaTextV1ServiceDaoImpl.updateParkingAreaTextInfo(BeanConvertUtil.beanCovertMap(parkingAreaTextPo));
        return saveFlag;
    }
     @Override
    public int deleteParkingAreaText(@RequestBody  ParkingAreaTextPo parkingAreaTextPo) {
       parkingAreaTextPo.setStatusCd("1");
       int saveFlag = parkingAreaTextV1ServiceDaoImpl.updateParkingAreaTextInfo(BeanConvertUtil.beanCovertMap(parkingAreaTextPo));
       return saveFlag;
    }
    @Override
    public List<ParkingAreaTextDto> queryParkingAreaTexts(@RequestBody  ParkingAreaTextDto parkingAreaTextDto) {
        //校验是否传了 分页信息
        int page = parkingAreaTextDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            parkingAreaTextDto.setPage((page - 1) * parkingAreaTextDto.getRow());
        }
        List<ParkingAreaTextDto> parkingAreaTexts = BeanConvertUtil.covertBeanList(parkingAreaTextV1ServiceDaoImpl.getParkingAreaTextInfo(BeanConvertUtil.beanCovertMap(parkingAreaTextDto)), ParkingAreaTextDto.class);
        return parkingAreaTexts;
    }
    @Override
    public int queryParkingAreaTextsCount(@RequestBody ParkingAreaTextDto parkingAreaTextDto) {
        return parkingAreaTextV1ServiceDaoImpl.queryParkingAreaTextsCount(BeanConvertUtil.beanCovertMap(parkingAreaTextDto));    }
}