package crm.filiale;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import sys.dao.ConnectManager;
import sys.dao.bean.Company;
import sys.dao.bean.Personnel;
public class FCompany extends HttpServlet
{
private static final long serialVersionUID = 1L;
// 部门经理查询员工客户
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
// 参数初始化
boolean p = false;
ConnectManager cm = ConnectManager.newInstance();
RequestDispatcher rd = null;
String dept = request.getParameter("deptid").replace(" ", "");
if (dept.equals(""))
{
request.getSession().setAttribute("dept", "");
}
else
{
request.getSession().setAttribute("dept", dept);
}
String personnelid = request.getParameter("personnelid").replace(" ", "");
if (personnelid.equals(""))
{
request.getSession().setAttribute("personnelid", "");
}
else
{
request.getSession().setAttribute("personnelid", personnelid);
}
Integer stype = Integer.valueOf(request.getParameter("stype").replace(" ", ""));
if (stype.equals(""))
{
request.getSession().setAttribute("stype", "");
}
else
{
request.getSession().setAttribute("stype", stype);
}
String content = request.getParameter("content").replace(" ", "");
if (content.equals(""))
{
request.getSession().setAttribute("content", "");
}
else
{
request.getSession().setAttribute("content", content);
}
String industry = request.getParameter("industry").replace(" ", "");
if (industry.equals(""))
{
request.getSession().setAttribute("industry", "");
}
else
{
request.getSession().setAttribute("industry", industry);
}
String state = request.getParameter("state").replace(" ", "");
if (state.equals(""))
{
request.getSession().setAttribute("state", "");
}
else
{
request.getSession().setAttribute("state", state);
}
String type = request.getParameter("type").replace(" ", "");
if (type.equals(""))
{
request.getSession().setAttribute("type", "");
}
else
{
request.getSession().setAttribute("type", stype);
}
String gotime = request.getParameter("gotime").replace(" ", "");
if (gotime.equals(""))
{
request.getSession().setAttribute("gotime", "");
}
else
{
request.getSession().setAttribute("gotime", gotime);
}
String endtime = request.getParameter("endtime").replace(" ", "");
if (endtime.equals(""))
{
request.getSession().setAttribute("endtime", "");
}
else
{
request.getSession().setAttribute("endtime", endtime);
}
List<Company> companies = null;
ResultSet rs = null;
String sql = "";
List<String> list = new ArrayList<String>();
String str = "";
String temp = "";
String sqltemp = "";
try
{
// 打开数据库
if (cm.getConnection())
{
try
{
// 开始拼装SQL
if (!"".equals(personnelid))
{
request.getSession().setAttribute("perid", personnelid);
// 这一段SQL是统计与查询通用的
str = str + " personnelid in (" + personnelid + ")";
if (!("".equals(gotime) && "".equals(endtime)))
{
temp = temp + " and indate in (select indate from company where indate >= '" + gotime + "' and indate <= '" + endtime + "')";
}
// 开始进行统计
// 统计查询结果的总条数
sql = "select count(*) from company where " + str + temp;
rs = cm.executeQuery(sql);
rs.next();
int i = rs.getInt(1);
// 查询是哪个业务员的记录
sql = "select * from personnel where" + str;
rs = cm.executeQuery(sql);
if (rs.next())
{
list.add(rs.getString("realname") + "已查询到的客户数是:" + i);
String string = "";
string = string + "A库数量:" + rs.getInt(1);
// 统计在查询结是中的B库数据
sql = "select count(*) from company where " + str + temp + "and companystate = 'B'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " B库数量:" + rs.getInt(1);
// 统计在查询结是中的A类客户数据
sql = "select count(*) from company where " + str + temp + "and type = 'A'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " A类客户数量:" + rs.getInt(1);
// 统计在查询结是中的B类客户数据
sql = "select count(*) from company where " + str + temp + "and type = 'B'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " B类客户数量:" + rs.getInt(1);
// 统计在查询结是中的C类客户数据
sql = "select count(*) from company where " + str + temp + "and type = 'C'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " C类客户数量:" + rs.getInt(1);
// 统计在查询结是中的D类客户数据
sql = "select count(*) from company where " + str + temp + "and type = 'D'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " D类客户数量:" + rs.getInt(1);
// 统计在查询结是中的E类客户数据
sql = "select count(*) from company where " + str + temp + "and type = 'E'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " E类客户数量:" + rs.getInt(1);
list.add(string);
request.setAttribute("list", list);
}
}
else
{
// 开始拼装SQL
if (!"".equals(dept))
{
request.getSession().removeAttribute("perid");
// 这一段SQL是统计与查询通用的
str = str + " personnelid in (select personnelid from personnel where outdate is null and deptid = " + dept + ")";
if (!("".equals(gotime) && "".equals(endtime)))
{
temp = temp + " and indate in (select indate from company where indate >= '" + gotime + "' and indate <= '" + endtime + "')";
}
// 开始进行统计
// 统计查询结果的总条数
sql = "select count(*) from company where " + str + temp;
rs = cm.executeQuery(sql);
rs.next();
int i = rs.getInt(1);
// 查询是哪个部门的记录
sql = "select * from dept where deptid = " + dept;
rs = cm.executeQuery(sql);
if (rs.next())
{
list.add(rs.getString("deptname") + "已查询到的客户数是:" + i);
// 统计在查询结是中的A库数据
sql = "select count(*) from company where " + str + temp + "and companystate = 'A'";
rs = cm.executeQuery(sql);
rs.next();
String string = "";
string = string + "A库数量:" + rs.getInt(1);
// 统计在查询结是中的B库数据
sql = "select count(*) from company where " + str + temp + "and companystate = 'B'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " B库数量:" + rs.getInt(1);
// 统计在查询结是中的A类客户数据
sql = "select count(*) from company where " + str + temp + "and type = 'A'";
rs = cm.executeQuery(sql);
rs.next();
string = string + " A类客户数量:" + rs.getInt(1);
// 统计在查询结是中的B类客户数据
sql = "select coun
没有合适的资源?快使用搜索试试~ 我知道了~
ERP管理系统
共312个文件
java:96个
class:96个
jsp:55个
4星 · 超过85%的资源 需积分: 34 23 下载量 92 浏览量
2018-12-26
16:20:35
上传
评论 3
收藏 3.34MB ZIP 举报
温馨提示
主要是使用java为编程语言开发的erp管理系统,jsp+servlet
资源推荐
资源详情
资源评论
收起资源包目录
ERP管理系统 (312个子文件)
changedate.js.bak 24KB
FCompany.class 22KB
Company.class 17KB
Export.class 17KB
Personnel.class 14KB
Statistic.class 12KB
MCompany.class 11KB
VisitList.class 11KB
Export.class 10KB
Bill.class 10KB
SearchC.class 8KB
SearchC.class 8KB
DestineNote.class 8KB
Visit.class 8KB
Search.class 8KB
Login.class 7KB
Industry.class 7KB
Linkman.class 7KB
SelectPersonnel.class 7KB
Dept.class 7KB
CtoA.class 6KB
VisitList.class 6KB
SelectA.class 6KB
Select.class 6KB
AddCompany.class 5KB
AddSort.class 5KB
SelectC.class 5KB
District.class 5KB
DStatistic.class 5KB
SelectC.class 5KB
PersonnelInfo.class 5KB
Bills.class 5KB
DeleteCompany.class 5KB
DeleteCompany.class 5KB
CompanyList.class 5KB
LoginParameter.class 5KB
Info.class 5KB
Info.class 4KB
LoginChickUserName.class 4KB
Attorning.class 4KB
Sort.class 4KB
Keyword.class 4KB
Incepting.class 4KB
SwitchDate.class 4KB
Addlandv.class 4KB
Turn.class 4KB
Addlandv.class 4KB
Info.class 4KB
Info.class 4KB
Attorn.class 4KB
Attorn.class 4KB
Info.class 4KB
AddPersonnel.class 3KB
AddVisit.class 3KB
AddVisit.class 3KB
AtoB.class 3KB
DeleteCompany.class 3KB
Incept.class 3KB
Sorts.class 3KB
UpdatePersonnel.class 3KB
ConnectManager.class 3KB
AdInfo.class 3KB
BillType.class 3KB
AddNarrate.class 3KB
AddNarrate.class 3KB
SAim.class 3KB
DeptAjax.class 3KB
Chick.class 3KB
EditPwd.class 2KB
AddBill.class 2KB
UpdateBill.class 2KB
Destine.class 2KB
Attorn.class 2KB
AttornAll.class 2KB
Aim.class 2KB
DistrictAjax.class 2KB
Update.class 2KB
ComAjax.class 2KB
Update.class 2KB
AddLinkman.class 2KB
AddLinkman.class 2KB
OutPersonnel.class 2KB
Pass.class 2KB
DeleteCompany.class 2KB
Attorn.class 2KB
LoginChickPwd.class 2KB
IndustryAjax.class 2KB
ROutPersonnel.class 2KB
CancelAttorn.class 2KB
UserChickAjax.class 2KB
EncodingFilter.class 1KB
Clear.class 1KB
MD5.class 1KB
Exit.class 1KB
Clear.class 1008B
Position.class 885B
Replace.class 683B
.classpath 2KB
inside.css 2KB
manage.css 1KB
共 312 条
- 1
- 2
- 3
- 4
资源评论
- tower8882020-01-28学习一下,后面有帮助
今夜多云转晴
- 粉丝: 37
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Apache Spark的Spark DistCP重实现设计源码
- 粤港澳大湾区(黄埔)算法算例大赛-工业表面缺陷检测源码+超详细注释
- 在 KolektorSDD 数据上使用分割决策网络进行表面缺陷检测python源码+文档说明
- 操作系统作业:时间片轮转算法的模拟实现C++源码+文档说明
- 基于改进yolov5的金属曲面缺陷检测,使用pyqt5实习了实时视频检测的功能python源码+文档说明
- 基于Qt及OpenCv设计了一个视觉检测系统,实现了米粒的计数、缺陷分析功能+源码+文档说明+效果图
- 基于STM32F1和TB6612芯片的电机驱动板,可以驱动两个电机正反转,具有比L298N更小的体积源码+文档说明
- 基于Javascript的CNN卷积交互式播放器设计源码
- 基于Layui的树表格(treeGrid)前端设计源码
- 基于Vue框架的Node+Vue茶叶商城设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功