package com.ssm.web.warehouse;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpSession;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.ssm.po.Page;
import com.ssm.po.base.AttributeD;
import com.ssm.po.base.Drugs;
import com.ssm.po.base.Maximum;
import com.ssm.po.base.Supplier;
import com.ssm.po.base.Worker;
import com.ssm.po.chargefor.OutpatientchargeD;
import com.ssm.po.user.User;
import com.ssm.po.warehouse.Apply;
import com.ssm.po.warehouse.Applyd;
import com.ssm.po.warehouse.Purchase;
import com.ssm.po.warehouse.Storage;
import com.ssm.service.base.AttributeDService;
import com.ssm.service.base.DrugsService;
import com.ssm.service.base.SupplierService;
import com.ssm.service.base.WorkerService;
import com.ssm.service.warehouse.ApplydService;
import com.ssm.service.warehouse.PurchaseService;
import com.ssm.service.warehouse.StorageService;
import com.ssm.service.warehouse.WarehouseService;
import com.ssm.util.BaseController;
import com.sun.accessibility.internal.resources.accessibility;
@Controller
@RequestMapping("/warehouseController")
public class WarehouseController extends BaseController{
private List<Applyd> listsApplyds;
@Autowired
private DrugsService drugsService;
@Autowired
private AttributeDService attributeDService;
@Autowired
private WarehouseService warehouseService;
@Autowired
private ApplydService applydService;
@Autowired
private WorkerService workerService;
@Autowired
private SupplierService supplierService;
@Autowired
private PurchaseService purchaseService;
@Autowired
private StorageService storageService;
//打开新增请购单页面
@RequestMapping("/applyin")
public String applyin(){
//获取当前时间
Date datetime = new Date();
//设置时间格式
String date = new SimpleDateFormat("yyyy-MM-dd").format(datetime);
String dateText = new SimpleDateFormat("yyMMddhhmmss").format(datetime);
String cNumber = dateText;
request.setAttribute("cNumber", cNumber);
request.setAttribute("date", date);
return "/stock/apply_into";
}
//采购查询
public void selectshop(){
Page page = super.setPage();
page.setTotal(warehouseService.total());
super.setPageTotal(page);
super.request.getSession().setAttribute("page", page);
int start = (page.getCurrentPage() - 1) * page.getPageSize();
List<Purchase> purchases = purchaseService.queryS(start, page.getPageSize());
request.setAttribute("purchases", purchases);
}
//打开采购入库
@RequestMapping("/openShop")
public String openShop(){
this.selectshop();
Date datetime = new Date();
//设置时间格式
String dateText = new SimpleDateFormat("yyMMddhhmmss").format(datetime);
String orderNum = "S" + dateText;
request.setAttribute("orderNum", orderNum);
return "/stock/shopping_plan";
}
//打开入库审核
@RequestMapping("/openRuku")
public String openRuku(){
Page page = super.setPage();
page.setTotal(storageService.totalStorage());
super.setPageTotal(page);
super.request.getSession().setAttribute("page", page);
int start = (page.getCurrentPage() - 1) * page.getPageSize();
List<Storage> storages = storageService.query(start, page.getPageSize());
request.setAttribute("storages", storages);
return "/stock/inspection";
}
//分页查询请购单
public void allotpage() {
Page page = super.setPage();
page.setTotal(warehouseService.total());
super.setPageTotal(page);
super.request.getSession().setAttribute("page", page);
int start = (page.getCurrentPage() - 1) * page.getPageSize();
List<Apply> query = this.warehouseService.query(start, page.getPageSize());
request.setAttribute("query", query);
}
//打开查询请购单页面
@RequestMapping("/checkapply")
public String checkapply(){
this.allotpage();
List<Worker> shoplist = workerService.queryshop();
List<Supplier> supplierlist = supplierService.query();
request.setAttribute("shoplist", shoplist);
request.setAttribute("supplierlist", supplierlist);
return "/stock/check_apply";
}
//打开查询药品页面
@RequestMapping("/opendrug")
public String opendrug(@RequestParam(value="drugsName",required=false) String drugsName){
Page page = super.setPage();
page.setTotal(drugsService.total(drugsName));
super.setPageTotal(page);
super.request.getSession().setAttribute("page", page);
int start = (page.getCurrentPage() - 1) * page.getPageSize();
List<Drugs> drugslist = this.drugsService.query(drugsName, start, page.getPageSize());
request.setAttribute("drugslist", drugslist);
return "/drugsSet/drugs_list";
}
//id查询
@RequestMapping("/findById")
public String findById(int id){
Drugs drugs = new Drugs();
drugs.setId(id);
Drugs druglist = this.drugsService.findById(drugs);
if(druglist != null){
List<AttributeD> types = this.attributeDService.querytype();
List<AttributeD> units = this.attributeDService.queryunit();
request.setAttribute("druglist", druglist);
request.setAttribute("types", types);
request.setAttribute("units", units);
return "/drugsSet/drug_update";
}else {
return "/failed";
}
}
//格式化日期
@InitBinder
public void initBinder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
//修改药品信息
@RequestMapping("/updatedrug")
public String updatedrug(Drugs record,String drugsName){
int id = this.drugsService.updateByPrimaryKeySelective(record);
this.opendrug(null);
if(id > 0){
return "/drugsSet/drugs_list";
}else {
return "/failed";
}
}
//执行模糊条件查询
@RequestMapping("/findByWay")
public String findByWay(Drugs record){
String drugsName = record.getDrugsName();
this.opendrug(drugsName);
if(drugsName != null){
return "/drugsSet/drugs_list";
}else {
return "/failed";
}
}
//分页
@RequestMapping("/page")
public String page(){
return "/page/page";
}
//新增请购单
@RequestMapping("/insert")
public void insert(Apply record,String digital) throws IOException {
if(digital != null){
String[] itemlists = digital.split(",");
int items = itemlists.length/6;
//新增收费单信息
record.setExamine(false);
warehouseService.insertSelective(record);
int applyid = record.getId();
Applyd applydetail;
for(int i = 0;i < items;i++){
applydetail = new Applyd();
applydetail.setDrugsId(Integer.parseInt(itemlists[i * 6 + 0]));
applydetail.setAmount(itemlists[i * 6 + 5]);
applydetail.setApplyId(applyid);
applydService.insertSelective(applydetail);
}
}
}
//查询请购单明细
@RequestMapping("/queryById")
public void queryById(int id) throws IOException{
List<Applyd> list = this.applydService.query(id);
JSONArray json = JSONArray.fromObject(list);
PrintWriter out = response.getWriter();
out.print(json);
out.flush();
}
//新增采购单
@RequestMapping("/savepurchase")
public String savepurchase(Purchase record,int applyId) throws IOExce
没有合适的资源?快使用搜索试试~ 我知道了~
spring+springmvc+mybatis搭建的一个佛山市房地产和建筑行业诚信管理系统附带mysql数据库
共738个文件
svn-base:235个
class:117个
java:117个
2星 需积分: 20 105 下载量 179 浏览量
2017-04-26
16:12:12
上传
评论 7
收藏 19.72MB ZIP 举报
温馨提示
spring+springmvc+mybatis搭建的一个佛山市房地产和建筑行业诚信管理系统附带mysql数据库
资源推荐
资源详情
资源评论
收起资源包目录
spring+springmvc+mybatis搭建的一个佛山市房地产和建筑行业诚信管理系统附带mysql数据库 (738个子文件)
all-wcprops 2KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1010B
all-wcprops 927B
all-wcprops 784B
all-wcprops 776B
all-wcprops 664B
all-wcprops 608B
all-wcprops 574B
all-wcprops 528B
all-wcprops 512B
all-wcprops 456B
all-wcprops 442B
all-wcprops 401B
all-wcprops 333B
all-wcprops 299B
all-wcprops 254B
all-wcprops 232B
all-wcprops 212B
all-wcprops 89B
all-wcprops 88B
all-wcprops 85B
WarehouseController.class 12KB
RegistrationController.class 11KB
PharmacyController.class 10KB
ChargeController.class 5KB
DoctorController.class 5KB
Registration.class 4KB
IllRecord.class 4KB
DrugsServiceimpl.class 4KB
outWarehouse.class 4KB
SecurityImage.class 4KB
IdentityServlet.class 4KB
Storage.class 3KB
Drugs.class 3KB
Applyd.class 3KB
BaseController.class 3KB
Purchase.class 3KB
RequestforD.class 3KB
PharmacyD.class 3KB
UserController.class 3KB
RecordController.class 2KB
Requestfor.class 2KB
Patient.class 2KB
Outpatientcharge.class 2KB
User.class 2KB
Md5.class 2KB
Doctor.class 2KB
Prescription.class 2KB
Pay.class 2KB
outWarehouseServiceImpl.class 2KB
RequestforServiceImpl.class 2KB
Apply.class 2KB
DoctorServiceimpl.class 2KB
PrescriptionD.class 1KB
PurchaseServiceImpl.class 1KB
StorageServiceImpl.class 1KB
RegistrationServiceimpl.class 1KB
WarehouseServiceImpl.class 1KB
PharmacyDServiceImpl.class 1KB
OutpatientchargeD.class 1KB
ApplydServiceImpl.class 1KB
PatientServiceimpl.class 1KB
RequestforDServiceImpl.class 1KB
PayServiceimpl.class 1KB
Pharmacy.class 1KB
PharmacyServiceImpl.class 1KB
AttributeD.class 1KB
RecordServiceimpl.class 1KB
MaximumServiceimpl.class 1KB
Worker.class 1KB
OutPatientDetailServiceImpl.class 1KB
AttributeDServiceimpl.class 1KB
OutPatientChargeServiceImpl.class 1KB
Page.class 1014B
UserServiceimpl.class 1013B
PrescriptionServiceimpl.class 995B
WorkerServiceImpl.class 992B
PrescriptionDServiceimpl.class 987B
DepartmentServiceimpl.class 952B
SupplierServiceImpl.class 910B
Supplier.class 899B
DrugsMapper.class 890B
ApplyMapper.class 882B
Attribute.class 878B
Role.class 875B
outWarehouseMapper.class 861B
PharmacyDMapper.class 838B
Department.class 825B
PayMapper.class 809B
RequestforMapper.class 785B
PurchaseMapper.class 769B
StorageMapper.class 762B
共 738 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
- 回首笑人间2017-12-01是一个医院的系统,能运行,不错,虽说功能少点
- lxts00542017-07-25这个不是建筑行业的,是一个医院的系统
- 易购物云2017-12-20被迅雷给忽悠了
岽仔玖等
- 粉丝: 299
- 资源: 215
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功