package medicines.dao.impl;
import medicines.dao.MedicineDao;
import medicines.domain.Medicine;
import medicines.domain.Storage;
import medicines.domain.details.*;
import medicines.utils.JDBCUtiles;
import net.sf.json.JSONArray;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MedicineDaoImpl implements MedicineDao {
// private static SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd");
@Override
public void showMedicineInfo(HttpServletRequest request, HttpServletResponse response) {
List<Medicine> list = new ArrayList<Medicine>();
try{
String sql = "select * from medicine_info";
System.out.println(sql);
ResultSet rs = JDBCUtiles.query(sql);
int pur_price, sale_price, validity;double discount;
while (rs.next()){
Medicine medicine = new Medicine();
medicine.setMed_name(rs.getString("med_name"));
medicine.setMed_id(rs.getString("med_id"));
medicine.setMde_class(rs.getString("class"));
medicine.setFactor(rs.getString("factor"));
pur_price = Integer.parseInt(rs.getString("purchase_price"));
medicine.setPurchase_price(pur_price);
sale_price = Integer.parseInt(rs.getString("sale_price"));
medicine.setSale_price(sale_price);
validity = Integer.parseInt(rs.getString("validity"));
medicine.setValidity(validity);
discount = Double.parseDouble(rs.getString("discount"));
medicine.setDiscount(discount);
medicine.setImg_url(rs.getString("img_url"));
list.add(medicine);
}
request.setAttribute("list",list);
rs.close();
JDBCUtiles.close();
request.getRequestDispatcher("/medicinesM.jsp").forward(request,response);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void showResposity(HttpServletRequest request, HttpServletResponse response) {
List<Storage> list = new ArrayList<Storage>();
try{
String sql = "select * from storage";
System.out.println(sql);
ResultSet rs = JDBCUtiles.query(sql);
int stock_num;
while (rs.next()){
Storage storage = new Storage();
storage.setMed_id(rs.getString("med_id"));
stock_num = Integer.parseInt(rs.getString("stock_num"));
storage.setStock_num(stock_num);
storage.setProduction_date(rs.getString("production_date"));
list.add(storage);
}
request.setAttribute("list",list);
rs.close();
JDBCUtiles.close();
request.getRequestDispatcher("/resposityM.jsp").forward(request,response);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void showFactory(HttpServletRequest request, HttpServletResponse response) {
List<Factory> list = new ArrayList<Factory>();
try{
String sql = "select * from factor";
System.out.println(sql);
ResultSet rs = JDBCUtiles.query(sql);
int stock_num;
while (rs.next()){
Factory factory = new Factory();
factory.setFac_name(rs.getString("fac_name"));
factory.setMed_identify(rs.getString("med_identify"));
String identity = rs.getString("med_identify");
String sql2 = "select purchase_price from medicine_info where med_id ='"+identity+"'";
ResultSet rss = JDBCUtiles.queryTwo(sql2);
while (rss.next()){
factory.setPurchase_price(Integer.parseInt(rss.getString("purchase_price")));
}
factory.setProduction_date(rs.getString("production_date"));
list.add(factory);
}
request.setAttribute("list",list);
rs.close();
JDBCUtiles.close();
request.getRequestDispatcher("/factoryM.jsp").forward(request,response);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void showIn(HttpServletRequest request, HttpServletResponse response) {
List<in> list = new ArrayList<in>();
try{
String sql = "select * from purchase";
System.out.println(sql);
ResultSet rs = JDBCUtiles.query(sql);
while (rs.next()){
in in = new in();
in.setPurchase_id(rs.getString("purchase_id"));
in.setPurchase_date(rs.getString("purchase_date"));
list.add(in);
}
request.setAttribute("list",list);
rs.close();
JDBCUtiles.close();
request.getRequestDispatcher("/inResposity.jsp").forward(request,response);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void showOut(HttpServletRequest request, HttpServletResponse response) {
List<out> list = new ArrayList<out>();
try{
String sql = "select * from sale";
System.out.println(sql);
ResultSet rs = JDBCUtiles.query(sql);
while (rs.next()){
out ou = new out();
ou.setSale_id(rs.getString("sale_id"));
ou.setSale_date(rs.getString("sale_date"));
list.add(ou);
}
request.setAttribute("list",list);
rs.close();
JDBCUtiles.close();
request.getRequestDispatcher("/outResposity.jsp").forward(request,response);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void showInMore(HttpServletRequest request, HttpServletResponse response) {
List<inMore> list = new ArrayList<inMore>();
try{
String sql = "select * from purchase_details";
System.out.println(sql);
ResultSet rs = JDBCUtiles.query(sql);
int purchase_price, purchase_date;
while (rs.next()){
inMore inM = new inMore();
inM.setPurchase_id(rs.getString("purchase_id"));
inM.setFactor_name(rs.getString("factor_name"));
inM.setMed_id(rs.getString("med_id"));
inM.setPurchase_price(Integer.parseInt(rs.getString("purchase_price")));
inM.setPurchase_num(Integer.parseInt(rs.getString("purchase_num")));
inM.setPurchase_date(rs.getString("purchase_date"));
list.add(inM);
}
request.setAttribute("list",list);
rs.close();
JDBCUtiles.close();
request.getRequestDispatcher("/inResposityMore.jsp").forward(request,response);
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void showOutMore(HttpServletRequest request, HttpServletResponse response) {
List<outMore> list = new ArrayList<outMore>();
try{
String sql = "select * from sale_details";
System.out.println(sql);
ResultSet rs = JDBCUtiles.query(sql);
double sale_discount, true_price;int sale_num;
while (rs.next()){
outMore outm = new outMore();
outm.setSale_id(rs.getString("sale_id"));
outm.setUser_id(rs.getString("user_id"));
outm.setMed_id(rs.getString("med_id"));
outm.setMed_name(rs.getString("med_name"));
outm.setTrue_pr
没有合适的资源?快使用搜索试试~ 我知道了~
数据库课设基于java实现的医院药品进销存管理系统源码+项目说明.zip
共223个文件
class:44个
jpg:42个
jar:36个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 7 下载量 27 浏览量
2022-12-21
15:42:25
上传
评论 14
收藏 27.27MB ZIP 举报
温馨提示
数据库课设基于Java实现的医院药品进销存管理系统源码+项目说明.zip 【数据库课设】 (1)了解(需求分析)药品进销存管理系统的功能需求、数据需求及其他需求; (2)分析药品的进货、销售(含折扣)、过期处理、损耗、库存量控制、盘存等相关业务流程及相关实体; (3)对所涉及的各类实体进行抽象,包括:药品的分类、生产厂家、药品销售、药品 销售折扣、*库存量控制与预警*、过期药品、*药品损耗*、药品库存情况等; 【备注】 主要针对计算机相关专业的正在做毕设的学生和需要项目实战的Java学习者。 也可作为课程设计、期末大作业。包含:项目源码、数据库脚本、项目说明等,该项目可以直接作为毕设使用。 也可以用来学习参考借鉴! 【特别强调】 1、csdn上资源保证是完整最新,会不定期更新优化; 2、请用自己的账号在csdn官网下载,若通过第三方代下,博主不对您下载的资源作任何保证,且不提供任何形式的技术支持和答疑!!!
资源推荐
资源详情
资源评论
收起资源包目录
数据库课设基于java实现的医院药品进销存管理系统源码+项目说明.zip (223个子文件)
MedicineDaoImpl.class 8KB
MedicineDaoImpl.class 8KB
MedicineServiceImpl.class 3KB
MedicineServiceImpl.class 3KB
JDBCUtiles.class 3KB
JDBCUtiles.class 3KB
Medicine.class 3KB
Medicine.class 3KB
outMore.class 2KB
outMore.class 2KB
inMore.class 2KB
inMore.class 2KB
Storage.class 1KB
Storage.class 1KB
OutMoreServlet.class 1KB
OutMoreServlet.class 1KB
InMoreServlet.class 1KB
ClientServlet.class 1KB
InMoreServlet.class 1KB
ClientServlet.class 1KB
ResposityServlet.class 1KB
ResposityServlet.class 1KB
Factory.class 1KB
Factory.class 1KB
FactoryServlet.class 1KB
FactoryServlet.class 1KB
OutServlet.class 1KB
OutServlet.class 1KB
InfoServlet.class 1KB
InfoServlet.class 1KB
InServlet.class 1KB
InServlet.class 1KB
LoginServlet.class 1KB
LoginServlet.class 1KB
in.class 1KB
in.class 1KB
Client.class 1KB
Client.class 1KB
out.class 1KB
out.class 1KB
MedicineService.class 402B
MedicineService.class 402B
MedicineDao.class 374B
MedicineDao.class 374B
bootstrap.css 144KB
bootstrap.css 144KB
bootstrap.min.css 120KB
bootstrap.min.css 120KB
bootstrap.min.css 118KB
bootstrap.min.css 118KB
dashboard.css 2KB
dashboard.css 2KB
top.css 1KB
top.css 1KB
item-list.css 1KB
item-list.css 1KB
signin.css 793B
signin.css 793B
bar.css 647B
bar.css 647B
settlement.css 638B
settlement.css 638B
my.css 320B
my.css 320B
bottom.css 196B
bottom.css 196B
w.css 156B
w.css 156B
base.css 85B
base.css 85B
Dashboard Template for Bootstrap.html 9KB
Dashboard Template for Bootstrap.html 9KB
factory.html 5KB
factory.html 5KB
purchase.html 4KB
purchase.html 4KB
Medicines.iml 1KB
druid-1.0.9.jar 1.76MB
druid-1.0.9.jar 1.76MB
spring-core-4.2.4.RELEASE.jar 1.03MB
spring-core-4.2.4.RELEASE.jar 1.03MB
mysql-connector-java-5.1.18-bin.jar 771KB
mysql-connector-java-5.1.18-bin.jar 771KB
spring-beans-4.2.4.RELEASE.jar 714KB
spring-beans-4.2.4.RELEASE.jar 714KB
c3p0-0.9.1.2.jar 596KB
c3p0-0.9.1.2.jar 596KB
commons-collections-3.2.1.jar 562KB
commons-collections-3.2.1.jar 562KB
spring-jdbc-4.2.4.RELEASE.jar 413KB
spring-jdbc-4.2.4.RELEASE.jar 413KB
jstl-impl.jar 379KB
jstl-impl.jar 379KB
commons-httpclient-3.1.jar 298KB
commons-httpclient-3.1.jar 298KB
spring-tx-4.2.4.RELEASE.jar 259KB
spring-tx-4.2.4.RELEASE.jar 259KB
mysql-connector-java-3.0.16-ga-bin.jar 231KB
mysql-connector-java-3.0.16-ga-bin.jar 231KB
commons-beanutils-1.8.3.jar 227KB
共 223 条
- 1
- 2
- 3
onnx
- 粉丝: 9623
- 资源: 5597
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页