基于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">×</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…均可修改
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、待办模块、客户模块的增删改查管理