wuxw
2022-07-07 bc0176841d627c16518a71b745ef6f0aabb6600c
加入 dict 功能
2个文件已修改
13个文件已添加
869 ■■■■■ 已修改文件
.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/Dict/DictDto.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/dict/DictPo.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/dev/DictV1ServiceDaoImplMapper.xml 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/dev/IDictV1InnerServiceSMO.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/cmd/dict/DeleteDictCmd.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/cmd/dict/ListDictCmd.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/cmd/dict/SaveDictCmd.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/cmd/dict/UpdateDictCmd.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/dao/IDictV1ServiceDao.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/dao/impl/DictV1ServiceDaoImpl.java 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-dev/src/main/java/com/java110/dev/smo/impl/DictV1InnerServiceSMOImpl.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.DS_Store
Binary files differ
java110-bean/src/main/java/com/java110/dto/Dict/DictDto.java
@@ -1,5 +1,7 @@
package com.java110.dto.Dict;
import com.java110.dto.PageDto;
import java.io.Serializable;
/**
@@ -7,11 +9,15 @@
 * Created by hu ping on 10/22/2019
 * <p>
 */
public class DictDto implements Serializable {
public class DictDto extends PageDto implements Serializable {
    private int id;
    private String statusCd;
    private String name;
    private String description;
    private String tableName;
    private String tableColumns;
    public String getStatusCd() {
        return statusCd;
@@ -36,4 +42,28 @@
    public void setDescription(String description) {
        this.description = description;
    }
    public String getTableName() {
        return tableName;
    }
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    public String getTableColumns() {
        return tableColumns;
    }
    public void setTableColumns(String tableColumns) {
        this.tableColumns = tableColumns;
    }
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
}
java110-bean/src/main/java/com/java110/po/dict/DictPo.java
New file
@@ -0,0 +1,59 @@
package com.java110.po.dict;
public class DictPo {
    private int id;
    private String statusCd;
    private String name;
    private String description;
    private String tableName;
    private String tableColumns;
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getStatusCd() {
        return statusCd;
    }
    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getTableName() {
        return tableName;
    }
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    public String getTableColumns() {
        return tableColumns;
    }
    public void setTableColumns(String tableColumns) {
        this.tableColumns = tableColumns;
    }
}
java110-db/src/main/resources/mapper/dev/DictV1ServiceDaoImplMapper.xml
New file
@@ -0,0 +1,110 @@
<?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="dictV1ServiceDaoImpl">
    <!-- 保存字典表信息 add by wuxw 2018-07-03 -->
    <insert id="saveDictInfo" parameterType="Map">
        insert into t_dict(
        table_columns,name,description,status_cd,table_name
        ) values (
        #{tableColumns},#{name},#{description},#{statusCd},#{tableName}
        )
    </insert>
    <!-- 查询字典表信息 add by wuxw 2018-07-03 -->
    <select id="getDictInfo" parameterType="Map" resultType="Map">
        select t.table_columns,t.table_columns tableColumns,t.name,t.description,t.status_cd,t.status_cd
        statusCd,t.id,t.table_name,t.table_name tableName
        from t_dict t
        where 1 =1
        <if test="tableColumns !=null and tableColumns != ''">
            and t.table_columns= #{tableColumns}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
        </if>
        <if test="description !=null and description != ''">
            and t.description= #{description}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="tableName !=null and tableName != ''">
            and t.table_name= #{tableName}
        </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="updateDictInfo" parameterType="Map">
        update t_dict t <set>
        <if test="statusCd != null and statusCd != ''">
            t.status_cd = #{statusCd},
        </if>
        <if test="tableColumns !=null and tableColumns != ''">
             t.table_columns= #{tableColumns},
        </if>
        <if test="name !=null and name != ''">
             t.name= #{name},
        </if>
        <if test="description !=null and description != ''">
             t.description= #{description},
        </if>
        <if test="tableName !=null and tableName != ''">
             t.table_name= #{tableName}
        </if>
    </set>
        where 1=1
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
    </update>
    <!-- 修改字典表信息 add by wuxw 2018-07-03 -->
    <update id="deleteDictInfo" parameterType="Map">
        delete from  t_dict
        where 1=1
            and id= #{id}
    </update>
    <!-- 查询字典表数量 add by wuxw 2018-07-03 -->
    <select id="queryDictsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from t_dict t
        where 1 =1
        <if test="tableColumns !=null and tableColumns != ''">
            and t.table_columns= #{tableColumns}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
        </if>
        <if test="description !=null and description != ''">
            and t.description= #{description}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="id !=null and id != ''">
            and t.id= #{id}
        </if>
        <if test="tableName !=null and tableName != ''">
            and t.table_name= #{tableName}
        </if>
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/dev/IDictV1InnerServiceSMO.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.dev;
import com.java110.config.feign.FeignConfiguration;
import com.java110.dto.Dict.DictDto;
import com.java110.po.dict.DictPo;
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-07-06 20:03:58 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 = "dev-service", configuration = {FeignConfiguration.class})
@RequestMapping("/dictV1Api")
public interface IDictV1InnerServiceSMO {
    @RequestMapping(value = "/saveDict", method = RequestMethod.POST)
    public int saveDict(@RequestBody DictPo dictPo);
    @RequestMapping(value = "/updateDict", method = RequestMethod.POST)
    public int updateDict(@RequestBody DictPo dictPo);
    @RequestMapping(value = "/deleteDict", method = RequestMethod.POST)
    public int deleteDict(@RequestBody DictPo dictPo);
    /**
     * <p>查询小区楼信息</p>
     *
     *
     * @param dictDto 数据对象分享
     * @return DictDto 对象数据
     */
    @RequestMapping(value = "/queryDicts", method = RequestMethod.POST)
    List<DictDto> queryDicts(@RequestBody DictDto dictDto);
    /**
     * 查询<p>小区楼</p>总记录数
     *
     * @param dictDto 数据对象分享
     * @return 小区下的小区楼记录数
     */
    @RequestMapping(value = "/queryDictsCount", method = RequestMethod.POST)
    int queryDictsCount(@RequestBody DictDto dictDto);
}
service-dev/src/main/java/com/.DS_Store
Binary files differ
service-dev/src/main/java/com/java110/.DS_Store
Binary files differ
service-dev/src/main/java/com/java110/dev/.DS_Store
Binary files differ
service-dev/src/main/java/com/java110/dev/cmd/dict/DeleteDictCmd.java
New file
@@ -0,0 +1,70 @@
/*
 * 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.dev.cmd.dict;
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.dev.IDictV1InnerServiceSMO;
import com.java110.po.dict.DictPo;
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.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:删除
 * 服务编码:dict.deleteDict
 * 请求路劲:/app/dict.DeleteDict
 * add by 吴学文 at 2022-07-06 20:03:58 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 = "dict.deleteDict")
public class DeleteDictCmd extends Cmd {
  private static Logger logger = LoggerFactory.getLogger(DeleteDictCmd.class);
    @Autowired
    private IDictV1InnerServiceSMO dictV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "id", "id不能为空");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
       DictPo dictPo = BeanConvertUtil.covertBean(reqJson, DictPo.class);
        int flag = dictV1InnerServiceSMOImpl.deleteDict(dictPo);
        if (flag < 1) {
            throw new CmdException("删除数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-dev/src/main/java/com/java110/dev/cmd/dict/ListDictCmd.java
New file
@@ -0,0 +1,84 @@
/*
 * 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.dev.cmd.dict;
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.dto.Dict.DictDto;
import com.java110.intf.dev.IDictV1InnerServiceSMO;
import com.java110.po.dict.DictPo;
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.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.ArrayList;
import org.springframework.http.ResponseEntity;
import org.springframework.http.HttpStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:查询
 * 服务编码:dict.listDict
 * 请求路劲:/app/dict.ListDict
 * add by 吴学文 at 2022-07-06 20:03:58 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 = "dict.listDict")
public class ListDictCmd extends Cmd {
  private static Logger logger = LoggerFactory.getLogger(ListDictCmd.class);
    @Autowired
    private IDictV1InnerServiceSMO dictV1InnerServiceSMOImpl;
    @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 {
           DictDto dictDto = BeanConvertUtil.covertBean(reqJson, DictDto.class);
           int count = dictV1InnerServiceSMOImpl.queryDictsCount(dictDto);
           List<DictDto> dictDtos = null;
           if (count > 0) {
               dictDtos = dictV1InnerServiceSMOImpl.queryDicts(dictDto);
           } else {
               dictDtos = new ArrayList<>();
           }
           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, dictDtos);
           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
           cmdDataFlowContext.setResponseEntity(responseEntity);
    }
}
service-dev/src/main/java/com/java110/dev/cmd/dict/SaveDictCmd.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.dev.cmd.dict;
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.dev.IDictV1InnerServiceSMO;
import com.java110.po.dict.DictPo;
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.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:保存
 * 服务编码:dict.saveDict
 * 请求路劲:/app/dict.SaveDict
 * add by 吴学文 at 2022-07-06 20:03:58 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 = "dict.saveDict")
public class SaveDictCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(SaveDictCmd.class);
    public static final String CODE_PREFIX_ID = "10";
    @Autowired
    private IDictV1InnerServiceSMO dictV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "statusCd", "请求报文中未包含statusCd");
Assert.hasKeyAndValue(reqJson, "name", "请求报文中未包含name");
Assert.hasKeyAndValue(reqJson, "tableColumns", "请求报文中未包含tableColumns");
Assert.hasKeyAndValue(reqJson, "tableName", "请求报文中未包含tableName");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
       DictPo dictPo = BeanConvertUtil.covertBean(reqJson, DictPo.class);
        int flag = dictV1InnerServiceSMOImpl.saveDict(dictPo);
        if (flag < 1) {
            throw new CmdException("保存数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-dev/src/main/java/com/java110/dev/cmd/dict/UpdateDictCmd.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.dev.cmd.dict;
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.dev.IDictV1InnerServiceSMO;
import com.java110.po.dict.DictPo;
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.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 类表述:更新
 * 服务编码:dict.updateDict
 * 请求路劲:/app/dict.UpdateDict
 * add by 吴学文 at 2022-07-06 20:03:58 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 = "dict.updateDict")
public class UpdateDictCmd extends Cmd {
  private static Logger logger = LoggerFactory.getLogger(UpdateDictCmd.class);
    @Autowired
    private IDictV1InnerServiceSMO dictV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "id", "id不能为空");
    }
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
       DictPo dictPo = BeanConvertUtil.covertBean(reqJson, DictPo.class);
        int flag = dictV1InnerServiceSMOImpl.updateDict(dictPo);
        if (flag < 1) {
            throw new CmdException("更新数据失败");
        }
        cmdDataFlowContext.setResponseEntity(ResultVo.success());
    }
}
service-dev/src/main/java/com/java110/dev/dao/IDictV1ServiceDao.java
New file
@@ -0,0 +1,83 @@
/*
 * 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.dev.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-07-06 20:03:58 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 IDictV1ServiceDao {
    /**
     * 保存 字典表信息
     * @param info
     * @throws DAOException DAO异常
     */
    int saveDictInfo(Map info) throws DAOException;
    /**
     * 查询字典表信息(instance过程)
     * 根据bId 查询字典表信息
     * @param info bId 信息
     * @return 字典表信息
     * @throws DAOException DAO异常
     */
    List<Map> getDictInfo(Map info) throws DAOException;
    /**
     * 修改字典表信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    int updateDictInfo(Map info) throws DAOException;
    /**
     * 修改字典表信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    int deleteDictInfo(Map info) throws DAOException;
    /**
     * 查询字典表总数
     *
     * @param info 字典表信息
     * @return 字典表数量
     */
    int queryDictsCount(Map info);
}
service-dev/src/main/java/com/java110/dev/dao/impl/DictV1ServiceDaoImpl.java
New file
@@ -0,0 +1,125 @@
/*
 * 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.dev.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.dev.dao.IDictV1ServiceDao;
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-07-06 20:03:58 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("dictV1ServiceDaoImpl")
public class DictV1ServiceDaoImpl extends BaseServiceDao implements IDictV1ServiceDao {
    private static Logger logger = LoggerFactory.getLogger(DictV1ServiceDaoImpl.class);
    /**
     * 保存字典表信息 到 instance
     * @param info   bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public int saveDictInfo(Map info) throws DAOException {
        logger.debug("保存 saveDictInfo 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.insert("dictV1ServiceDaoImpl.saveDictInfo",info);
        return saveFlag;
    }
    /**
     * 查询字典表信息(instance)
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getDictInfo(Map info) throws DAOException {
        logger.debug("查询 getDictInfo 入参 info : {}",info);
        List<Map> businessDictInfos = sqlSessionTemplate.selectList("dictV1ServiceDaoImpl.getDictInfo",info);
        return businessDictInfos;
    }
    /**
     * 修改字典表信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public int updateDictInfo(Map info) throws DAOException {
        logger.debug("修改 updateDictInfo 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.update("dictV1ServiceDaoImpl.updateDictInfo",info);
        return saveFlag;
    }
    /**
     * 修改字典表信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public int deleteDictInfo(Map info) throws DAOException {
        logger.debug("修改 deleteDictInfo 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.update("dictV1ServiceDaoImpl.deleteDictInfo",info);
        return saveFlag;
    }
     /**
     * 查询字典表数量
     * @param info 字典表信息
     * @return 字典表数量
     */
    @Override
    public int queryDictsCount(Map info) {
        logger.debug("查询 queryDictsCount 入参 info : {}",info);
        List<Map> businessDictInfos = sqlSessionTemplate.selectList("dictV1ServiceDaoImpl.queryDictsCount", info);
        if (businessDictInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessDictInfos.get(0).get("count").toString());
    }
}
service-dev/src/main/java/com/java110/dev/smo/impl/DictV1InnerServiceSMOImpl.java
New file
@@ -0,0 +1,87 @@
/*
 * 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.dev.smo.impl;
import com.java110.dev.dao.IDictV1ServiceDao;
import com.java110.dto.Dict.DictDto;
import com.java110.intf.dev.IDictV1InnerServiceSMO;
import com.java110.po.dict.DictPo;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.core.base.smo.BaseServiceSMO;
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.List;
/**
 * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
 * add by 吴学文 at 2022-07-06 20:03:58 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 DictV1InnerServiceSMOImpl extends BaseServiceSMO implements IDictV1InnerServiceSMO {
    @Autowired
    private IDictV1ServiceDao dictV1ServiceDaoImpl;
    @Override
    public int saveDict(@RequestBody  DictPo dictPo) {
        int saveFlag = dictV1ServiceDaoImpl.saveDictInfo(BeanConvertUtil.beanCovertMap(dictPo));
        return saveFlag;
    }
     @Override
    public int updateDict(@RequestBody  DictPo dictPo) {
        int saveFlag = dictV1ServiceDaoImpl.updateDictInfo(BeanConvertUtil.beanCovertMap(dictPo));
        return saveFlag;
    }
     @Override
    public int deleteDict(@RequestBody  DictPo dictPo) {
       int saveFlag = dictV1ServiceDaoImpl.deleteDictInfo(BeanConvertUtil.beanCovertMap(dictPo));
       return saveFlag;
    }
    @Override
    public List<DictDto> queryDicts(@RequestBody  DictDto dictDto) {
        //校验是否传了 分页信息
        int page = dictDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            dictDto.setPage((page - 1) * dictDto.getRow());
        }
        List<DictDto> dicts = BeanConvertUtil.covertBeanList(dictV1ServiceDaoImpl.getDictInfo(BeanConvertUtil.beanCovertMap(dictDto)), DictDto.class);
        return dicts;
    }
    @Override
    public int queryDictsCount(@RequestBody DictDto dictDto) {
        return dictV1ServiceDaoImpl.queryDictsCount(BeanConvertUtil.beanCovertMap(dictDto));    }
}