基于javaweb+jsp的客户关系管理系统CRM(带报告文档)

基于javaweb+jsp的客户关系管理系统CRM(带报告文档)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping
public class NoticeController {

    @Autowired
    private NoticeService noticeService;

    /**
     * 增加公告
        let id = button.data('id');
        let modal = $(this);
        $.ajax({
            url: 'userGet?id=' + id,
            type: "get",
            success: function (voString) {
                let vo = eval('(' + voString + ')');
                modal.find('#info-username').text(vo.username);
                modal.find('#info-password').text(vo.password);
                modal.find('#info-realName').text(vo.realName);
                modal.find('#info-userSex').text(vo.userSex);
                modal.find('#info-userPhone').text(vo.userPhone);
                modal.find('#info-userText').text(vo.userText);
                modal.find('#info-userType').text(vo.userType);
            }
        })
    })
    function searchList() {
        window.location.href = "userList?searchColumn="+document.getElementById("searchColumn").value+"&keyword=" + document.getElementById("search_keyword").value;
    }
    //增加表单提交之前进行检查,如果return false,则不允许提交
    function addCheck() {
        //根据ID获取值
        if (document.getElementById("add-username").value.trim().length == 0) {
            alert("用户名不能为空");
            return false;
        }
                        <tr>
                            <td style="width: 15%;">客户:</td>
                            <td><b id="info-kehuName"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">来源:</td>
                            <td><b id="info-kehuLaiyuan"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">联系人:</td>
                            <td><b id="info-kehuMan"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">电话:</td>
                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">增加公告</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group hidden">
                        <label class="control-label">(hidden)</label>
                        <input type="text" class="form-control" name="action" value="add">
                    </div>
                    <div class="form-group">
                        <label for="add-noticeName" class="control-label">标题:</label>
                        <input type="text" class="form-control" name="noticeName" id="add-noticeName">
                    </div>
                    <div class="form-group">
                        <label for="add-noticeText" class="control-label">内容:</label>
                        <textarea style="height: 100px;" class="form-control" name="noticeText" id="add-noticeText"></textarea>
                    </div>
                    <div class="form-group">
                        <label for="add-noticeType" class="control-label">类型:</label>
                        <input type="text" class="form-control" name="noticeType" id="add-noticeType">
                    </div>
                    <div class="form-group">
                        <label for="add-createDate" class="control-label">创建时间:</label>
                        <input type="text" class="form-control" name="createDate" id="add-createDate">
        WHERE `id` = #{id}
    </update>

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_user` WHERE `id` = #{id}
    </select>

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_user`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1
        </where>
        ORDER BY id ASC
        <if test="startIndex != null and pageSize != null">
            LIMIT #{startIndex},#{pageSize};
        </if>
    </select>
    <!--数量-->
    <select id="getAllCount" parameterType="java.util.Map" resultType="Integer">
        SELECT COUNT(*) FROM `t_user`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
    @RequestMapping("userDelete")
    public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");
        userService.delete(Arrays.asList(id));
        this.redirectList(request, response);
    }

    /**
     * 编辑用户
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("userEdit")
    public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
        User vo = new User();
        vo.setId(Long.valueOf(Util.decode(request, "id")));
        vo.setUsername(Util.decode(request, "username"));
        vo.setPassword(Util.decode(request, "password"));
        vo.setRealName(Util.decode(request, "realName"));
                <td>${vo.kehuTel}</td>
                <td>${vo.kehuSex}</td>
                <td>${vo.kehuZhiwei}</td>
                <td title="${vo.kehuText}">
                <c:choose>
                    <c:when test="${fn:length(vo.kehuText) > 19}">
                        <c:out value="${fn:substring(vo.kehuText, 0, 19)}..."/>
                    </c:when>
                    <c:otherwise>
                        <c:out value="${vo.kehuText}"/>
                    </c:otherwise>
                </c:choose>
                </td>
                            <th style="text-align: center;">
                                <button class="btn btn-line btn-primary btn-sm" data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-info">详情
                                </button>
                                <button class="btn btn-line btn-info btn-sm"
                                                <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>
                                        data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-edit">编辑
                                </button>
            return false;
        }
        return true;
    }
    //编辑表单提交之前进行检查,如果return false,则不允许提交
    function editCheck() {
        //根据ID获取值
        if (document.getElementById("edit-kehuName").value.trim().length == 0) {
            alert("客户不能为空");
            return false;
        }
        if (document.getElementById("edit-kehuLaiyuan").value.trim().length == 0) {
            alert("来源不能为空");
            return false;
        }
        if (document.getElementById("edit-kehuMan").value.trim().length == 0) {
            alert("联系人不能为空");
            return false;
        }
        if (document.getElementById("edit-kehuTel").value.trim().length == 0) {
            alert("电话不能为空");
                <if test ='daibanClient != null'>`daiban_client` = #{daibanClient},</if>
                <if test ='daibanText != null'>`daiban_text` = #{daibanText},</if>
                <if test ='daibanRen != null'>`daiban_ren` = #{daibanRen},</if>
                <if test ='daibanShi != null'>`daiban_shi` = #{daibanShi}</if>
        </set>
        WHERE `id` = #{id}
    </update>

    <!--获取-->
    <select id="findById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_daiban` WHERE `id` = #{id}
    </select>

    <!--列表-->
    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_daiban`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、待办模块、客户模块的增删改查管理

20220319000710

20220319000711

20220319000712

20220319000713

20220319000714

20220319000715

20220319000716

20220319000717

20220319000718

document

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值