天天看點

養老院管理系統設計與實作-計算機畢業設計源碼+LW文檔

開發語言:Java

架構:ssm

JDK版本:JDK1.8

伺服器:tomcat7

資料庫:mysql 5.7(一定要5.7版本)

資料庫工具:Navicat11

開發軟體:eclipse/myeclipse/idea

Maven包:Maven3.3.9

浏覽器:谷歌浏覽器

資料庫腳本:

DROP TABLE IF EXISTS ​

​caiwutongji​

​;

/*!40101 SET @saved_cs_client = @@character_set_client /;

/!40101 SET character_set_client = utf8 /;

CREATE TABLE ​

​caiwutongji​

​​ (

​id​

​ bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主鍵',

​​

​addtime​

​​ timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',

​​

​tongjibianhao​

​​ varchar(200) DEFAULT NULL COMMENT '統計編号',

​​

​dangyueshouru​

​​ float DEFAULT NULL COMMENT '當月收入',

​​

​dangyuezhichu​

​​ float DEFAULT NULL COMMENT '當月支出',

​​

​chunlirun​

​​ float DEFAULT NULL COMMENT '純利潤',

​​

​dengjiriqi​

​​ date DEFAULT NULL COMMENT '登記日期',

PRIMARY KEY (​​

​id​

​​),

UNIQUE KEY ​​

​tongjibianhao​

​​ (​​

​tongjibianhao​

​​)

) ENGINE=InnoDB AUTO_INCREMENT=237 DEFAULT CHARSET=utf8 COMMENT='财務統計';

/!40101 SET character_set_client = @saved_cs_client */;

--

-- Dumping data for table ​

​caiwutongji​

--

LOCK TABLES ​

​caiwutongji​

​ WRITE;

/*!40000 ALTER TABLE ​

​caiwutongji​

​ DISABLE KEYS /;

INSERT INTO ​

​caiwutongji​

​​ VALUES (231,'2022-03-22 14:11:46','1111111111',1,1,1,'2022-03-22'),(232,'2022-03-22 14:11:46','2222222222',2,2,2,'2022-03-22'),(233,'2022-03-22 14:11:46','3333333333',3,3,3,'2022-03-22'),(234,'2022-03-22 14:11:46','4444444444',4,4,4,'2022-03-22'),(235,'2022-03-22 14:11:46','5555555555',5,5,5,'2022-03-22'),(236,'2022-03-22 14:11:46','6666666666',6,6,6,'2022-03-22');

/!40000 ALTER TABLE ​

​caiwutongji​

​ ENABLE KEYS */;

UNLOCK TABLES;

--

-- Table structure for table ​

​chuangwei​

--

DROP TABLE IF EXISTS ​

​chuangwei​

​;

/*!40101 SET @saved_cs_client = @@character_set_client /;

/!40101 SET character_set_client = utf8 /;

CREATE TABLE ​

​chuangwei​

​​ (

​id​

​ bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主鍵',

​​

​addtime​

​​ timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',

​​

​fangjianhao​

​​ varchar(200) DEFAULT NULL COMMENT '房間号',

​​

​loufangmingcheng​

​​ varchar(200) DEFAULT NULL COMMENT '樓房名稱',

​​

​chuangweihao​

​​ varchar(200) NOT NULL COMMENT '床位号',

​​

​chuangweizhuangtai​

​​ varchar(200) DEFAULT NULL COMMENT '床位狀态',

PRIMARY KEY (​​

​id​

​​)

) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8 COMMENT='床位';

/!40101 SET character_set_client = @saved_cs_client */;

--

-- Dumping data for table ​

​chuangwei​

--

LOCK TABLES ​

​chuangwei​

​ WRITE;

/*!40000 ALTER TABLE ​

​chuangwei​

​ DISABLE KEYS /;

INSERT INTO ​

​chuangwei​

​​ VALUES (51,'2022-03-22 14:11:46','房間号1','樓房名稱1','床位号1','已使用'),(52,'2022-03-22 14:11:46','房間号2','樓房名稱2','床位号2','已使用'),(53,'2022-03-22 14:11:46','房間号3','樓房名稱3','床位号3','已使用'),(54,'2022-03-22 14:11:46','房間号4','樓房名稱4','床位号4','已使用'),(55,'2022-03-22 14:11:46','房間号5','樓房名稱5','床位号5','已使用'),(56,'2022-03-22 14:11:46','房間号6','樓房名稱6','床位号6','已使用');

/!40000 ALTER TABLE ​

​chuangwei​

​ ENABLE KEYS */;

UNLOCK TABLES;

--

-- Table structure for table ​

​config​

--

DROP TABLE IF EXISTS ​

​config​

​;

/*!40101 SET @saved_cs_client = @@character_set_client /;

/!40101 SET character_set_client = utf8 /;

CREATE TABLE ​

​config​

​​ (

​id​

​ bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主鍵',

​​

​name​

​​ varchar(100) NOT NULL COMMENT '配置參數名稱',

​​

​value​

​​ varchar(100) DEFAULT NULL COMMENT '配置參數值',

PRIMARY KEY (​​

​id​

​​)

) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置檔案';

/!40101 SET character_set_client = @saved_cs_client */;

--

-- Dumping data for table ​

​config​

--

LOCK TABLES ​

​config​

​ WRITE;

/*!40000 ALTER TABLE ​

​config​

​ DISABLE KEYS /;

INSERT INTO ​

​config​

​​ VALUES (1,'picture1','upload/picture1.jpg'),(2,'picture2','upload/picture2.jpg'),(3,'picture3','upload/picture3.jpg');

/!40000 ALTER TABLE ​

​config​

​ ENABLE KEYS */;

UNLOCK TABLES;

--

-- Table structure for table ​

​fangjianziliao​

--

DROP TABLE IF EXISTS ​

​fangjianziliao​

​;

/*!40101 SET @saved_cs_client = @@character_set_client /;

/!40101 SET character_set_client = utf8 /;

CREATE TABLE ​

​fangjianziliao​

​​ (

​id​

​ bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主鍵',

​​

​addtime​

​​ timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',

​​

​fangjianhao​

​​ varchar(200) DEFAULT NULL COMMENT '房間号',

​​

​loufangmingcheng​

​​ varchar(200) DEFAULT NULL COMMENT '樓房名稱',

​​

​fangjianmianji​

​​ varchar(200) DEFAULT NULL COMMENT '房間面積',

​​

​fangjiansheshi​

​​ longtext COMMENT '房間設施',

PRIMARY KEY (​​

​id​

​​)

) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8 COMMENT='房間資料';

/!40101 SET character_set_client = @saved_cs_client */;

/**
 * 後端清單
 */
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ZhuanfangdengjiEntity zhuanfangdengji, 
    HttpServletRequest request){

    String tableName = request.getSession().getAttribute("tableName").toString();
    if(tableName.equals("jiashu")) {
        zhuanfangdengji.setJiashuzhanghao((String)request.getSession().getAttribute("username"));
    }
    if(tableName.equals("hugong")) {
        zhuanfangdengji.setHugonggonghao((String)request.getSession().getAttribute("username"));
    }
    EntityWrapper<ZhuanfangdengjiEntity> ew = new EntityWrapper<ZhuanfangdengjiEntity>();
    PageUtils page = zhuanfangdengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhuanfangdengji), params), params));
    return R.ok().put("data", page);
}

/**
 * 前端清單
 */
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ZhuanfangdengjiEntity zhuanfangdengji, 
    HttpServletRequest request){
    EntityWrapper<ZhuanfangdengjiEntity> ew = new EntityWrapper<ZhuanfangdengjiEntity>();
    PageUtils page = zhuanfangdengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhuanfangdengji), params), params));
    return R.ok().put("data", page);
}

/**
 * 清單
 */
@RequestMapping("/lists")
public R list( ZhuanfangdengjiEntity zhuanfangdengji){
    EntityWrapper<ZhuanfangdengjiEntity> ew = new EntityWrapper<ZhuanfangdengjiEntity>();
    ew.allEq(MPUtil.allEQMapPre( zhuanfangdengji, "zhuanfangdengji")); 
    return R.ok().put("data", zhuanfangdengjiService.selectListView(ew));
}

 /**
 * 查詢
 */
@RequestMapping("/query")
public R query(ZhuanfangdengjiEntity zhuanfangdengji){
    EntityWrapper< ZhuanfangdengjiEntity> ew = new EntityWrapper< ZhuanfangdengjiEntity>();
    ew.allEq(MPUtil.allEQMapPre( zhuanfangdengji, "zhuanfangdengji")); 
    ZhuanfangdengjiView zhuanfangdengjiView =  zhuanfangdengjiService.selectView(ew);
    return R.ok("查詢轉房登記成功").put("data", zhuanfangdengjiView);
}

/**
 * 後端詳情
 */
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
    ZhuanfangdengjiEntity zhuanfangdengji = zhuanfangdengjiService.selectById(id);
    return R.ok().put("data", zhuanfangdengji);
}

/**
 * 前端詳情
 */
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
    ZhuanfangdengjiEntity zhuanfangdengji = zhuanfangdengjiService.selectById(id);
    return R.ok().put("data", zhuanfangdengji);
}




/**
 * 後端儲存
 */
@RequestMapping("/save")
public R save(@RequestBody ZhuanfangdengjiEntity zhuanfangdengji, HttpServletRequest request){
    zhuanfangdengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    //ValidatorUtils.validateEntity(zhuanfangdengji);

    zhuanfangdengjiService.insert(zhuanfangdengji);
    return R.ok();
}

/**
 * 前端儲存
 */
@RequestMapping("/add")
public R add(@RequestBody ZhuanfangdengjiEntity zhuanfangdengji, HttpServletRequest request){
    zhuanfangdengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    //ValidatorUtils.validateEntity(zhuanfangdengji);

    zhuanfangdengjiService.insert(zhuanfangdengji);
    return R.ok();
}