基于ssm物质管理系统源码和论文

基于ssm疫情物质管理系统源码和论文170


 开发工具:idea 或eclipse
 数据库mysql5.7+
 数据库链接工具:navcat,小海豚等
  技术:ssm

1.研究背景

    面对来势汹汹的新型冠状病毒肺炎疫情,我国秉持人类命运共同体理念,既对本国人民生命安全和身体健康负责,也对全球公共安全卫生事业尽责,采取了最全面、最彻底、最严格的防控举措。据不同人群的问卷调查结果显示:绝大多人流密集场所没有疫情物资管理系统,但所有的场所都储备了一定量的疫情防疫物资。

根据调查得知,以前对信息管理的主要方式是基于文本、表格等纸介质的手工处理,对于物资信息等很多信息都是用人工计算、手抄进行。数据信息处理工作量大,容易出错;由于数据繁多,容易丢失,且不易査找。总的来说,缺乏系统,规范的物资管理手段。

2.研究目的

疫情物资管理系统的研究目的主要是建立防疫物资每日消耗报表监控,建立库房防疫物资应急保障机制,使各类防疫物资的数量不低于安全值;物资的流通过程更加简单化与高效化的同时大大的减少了管理人员的人力物力投入;使物资流通管理自动化、智能化。在疫情防疫当下,疫情物资管理系统的开发与设计非常必要,一个完善的、 高效的、准确的物资管理系统可以更好地辅助管理人员对疫情防疫物资的信息化管理。

3.研究意义

本系统主要面向学校、商场、旅游景点、校外图书馆等人流量大的机构,为了实现新冠肺炎疫情下防疫物资的妥善管理与科学分配,疫情物资管理系统能够在疫情环境下,最大程度帮助物资物尽其用,实现反生产行为的最小化;最大程度保障防疫物资供应摆在最突出的位置,建立疫情物资预警机制,随时对防疫物资库存进行管控;建立安全库存管理,有效提高突发公共卫生事件中医用应急物资的使用需求;规律化申领周期,给予医用应急物资的生产调配保有一个缓冲期,减轻应急需求下的压力,使人员密集的区域在应对突发公共卫生事件时得到暂时的保障,便于医疗护理工作的开展;大量减少了管理人员的工作量;使物资流通信息的管 理更加智能化、简单化、信息化;物资流通信息更加的直观,一目了然;实现了传统手工记录到计算机系统记录的重大突破。

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.CaiwurenyuanEntity;
import com.entity.view.CaiwurenyuanView;

import com.service.CaiwurenyuanService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 财务人员
 * 后端接口
 * @author 
 * @email 
 * @date 2021-04-16 18:03:15
 */
@RestController
@RequestMapping("/caiwurenyuan")
public class CaiwurenyuanController {
    @Autowired
    private CaiwurenyuanService caiwurenyuanService;
    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		CaiwurenyuanEntity user = caiwurenyuanService.selectOne(new EntityWrapper<CaiwurenyuanEntity>().eq("caiwurenyuangonghao", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(), username,"caiwurenyuan",  "财务人员" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody CaiwurenyuanEntity caiwurenyuan){
    	//ValidatorUtils.validateEntity(caiwurenyuan);
    	CaiwurenyuanEntity user = caiwurenyuanService.selectOne(new EntityWrapper<CaiwurenyuanEntity>().eq("caiwurenyuangonghao", caiwurenyuan.getCaiwurenyuangonghao()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		caiwurenyuan.setId(uId);
        caiwurenyuanService.insert(caiwurenyuan);
        return R.ok();
    }
	
	/**
	 * 退出
	 */
	@RequestMapping("/logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        CaiwurenyuanEntity user = caiwurenyuanService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	CaiwurenyuanEntity user = caiwurenyuanService.selectOne(new EntityWrapper<CaiwurenyuanEntity>().eq("caiwurenyuangonghao", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
        user.setMima("123456");
        caiwurenyuanService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,CaiwurenyuanEntity caiwurenyuan, 
		HttpServletRequest request){

        EntityWrapper<CaiwurenyuanEntity> ew = new EntityWrapper<CaiwurenyuanEntity>();
    	PageUtils page = caiwurenyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caiwurenyuan), params), params));
		request.setAttribute("data", page);
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,CaiwurenyuanEntity caiwurenyuan, HttpServletRequest request){
        EntityWrapper<CaiwurenyuanEntity> ew = new EntityWrapper<CaiwurenyuanEntity>();
    	PageUtils page = caiwurenyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caiwurenyuan), params), params));
		request.setAttribute("data", page);
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( CaiwurenyuanEntity caiwurenyuan){
       	EntityWrapper<CaiwurenyuanEntity> ew = new EntityWrapper<CaiwurenyuanEntity>();
      	ew.allEq(MPUtil.allEQMapPre( caiwurenyuan, "caiwurenyuan")); 
        return R.ok().put("data", caiwurenyuanService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(CaiwurenyuanEntity caiwurenyuan){
        EntityWrapper< CaiwurenyuanEntity> ew = new EntityWrapper< CaiwurenyuanEntity>();
 		ew.allEq(MPUtil.allEQMapPre( caiwurenyuan, "caiwurenyuan")); 
		CaiwurenyuanView caiwurenyuanView =  caiwurenyuanService.selectView(ew);
		return R.ok("查询财务人员成功").put("data", caiwurenyuanView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        CaiwurenyuanEntity caiwurenyuan = caiwurenyuanService.selectById(id);
        return R.ok().put("data", caiwurenyuan);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        CaiwurenyuanEntity caiwurenyuan = caiwurenyuanService.selectById(id);
        return R.ok().put("data", caiwurenyuan);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody CaiwurenyuanEntity caiwurenyuan, HttpServletRequest request){
    	caiwurenyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(caiwurenyuan);
    	CaiwurenyuanEntity user = caiwurenyuanService.selectOne(new EntityWrapper<CaiwurenyuanEntity>().eq("caiwurenyuangonghao", caiwurenyuan.getCaiwurenyuangonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		caiwurenyuan.setId(new Date().getTime());
        caiwurenyuanService.insert(caiwurenyuan);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody CaiwurenyuanEntity caiwurenyuan, HttpServletRequest request){
    	caiwurenyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(caiwurenyuan);
    	CaiwurenyuanEntity user = caiwurenyuanService.selectOne(new EntityWrapper<CaiwurenyuanEntity>().eq("caiwurenyuangonghao", caiwurenyuan.getCaiwurenyuangonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		caiwurenyuan.setId(new Date().getTime());
        caiwurenyuanService.insert(caiwurenyuan);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody CaiwurenyuanEntity caiwurenyuan, HttpServletRequest request){
        //ValidatorUtils.validateEntity(caiwurenyuan);
        caiwurenyuanService.updateById(caiwurenyuan);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        caiwurenyuanService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<CaiwurenyuanEntity> wrapper = new EntityWrapper<CaiwurenyuanEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = caiwurenyuanService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	


}
package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.HouqinrenyuanEntity;
import com.entity.view.HouqinrenyuanView;

import com.service.HouqinrenyuanService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 后勤人员
 * 后端接口
 * @author 
 * @email 
 * @date 2021-04-16 18:03:15
 */
@RestController
@RequestMapping("/houqinrenyuan")
public class HouqinrenyuanController {
    @Autowired
    private HouqinrenyuanService houqinrenyuanService;
    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		HouqinrenyuanEntity user = houqinrenyuanService.selectOne(new EntityWrapper<HouqinrenyuanEntity>().eq("houqinrenyuangonghao", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(), username,"houqinrenyuan",  "后勤人员" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody HouqinrenyuanEntity houqinrenyuan){
    	//ValidatorUtils.validateEntity(houqinrenyuan);
    	HouqinrenyuanEntity user = houqinrenyuanService.selectOne(new EntityWrapper<HouqinrenyuanEntity>().eq("houqinrenyuangonghao", houqinrenyuan.getHouqinrenyuangonghao()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		houqinrenyuan.setId(uId);
        houqinrenyuanService.insert(houqinrenyuan);
        return R.ok();
    }
	
	/**
	 * 退出
	 */
	@RequestMapping("/logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        HouqinrenyuanEntity user = houqinrenyuanService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	HouqinrenyuanEntity user = houqinrenyuanService.selectOne(new EntityWrapper<HouqinrenyuanEntity>().eq("houqinrenyuangonghao", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
        user.setMima("123456");
        houqinrenyuanService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,HouqinrenyuanEntity houqinrenyuan, 
		HttpServletRequest request){

        EntityWrapper<HouqinrenyuanEntity> ew = new EntityWrapper<HouqinrenyuanEntity>();
    	PageUtils page = houqinrenyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, houqinrenyuan), params), params));
		request.setAttribute("data", page);
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,HouqinrenyuanEntity houqinrenyuan, HttpServletRequest request){
        EntityWrapper<HouqinrenyuanEntity> ew = new EntityWrapper<HouqinrenyuanEntity>();
    	PageUtils page = houqinrenyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, houqinrenyuan), params), params));
		request.setAttribute("data", page);
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( HouqinrenyuanEntity houqinrenyuan){
       	EntityWrapper<HouqinrenyuanEntity> ew = new EntityWrapper<HouqinrenyuanEntity>();
      	ew.allEq(MPUtil.allEQMapPre( houqinrenyuan, "houqinrenyuan")); 
        return R.ok().put("data", houqinrenyuanService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(HouqinrenyuanEntity houqinrenyuan){
        EntityWrapper< HouqinrenyuanEntity> ew = new EntityWrapper< HouqinrenyuanEntity>();
 		ew.allEq(MPUtil.allEQMapPre( houqinrenyuan, "houqinrenyuan")); 
		HouqinrenyuanView houqinrenyuanView =  houqinrenyuanService.selectView(ew);
		return R.ok("查询后勤人员成功").put("data", houqinrenyuanView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        HouqinrenyuanEntity houqinrenyuan = houqinrenyuanService.selectById(id);
        return R.ok().put("data", houqinrenyuan);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        HouqinrenyuanEntity houqinrenyuan = houqinrenyuanService.selectById(id);
        return R.ok().put("data", houqinrenyuan);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody HouqinrenyuanEntity houqinrenyuan, HttpServletRequest request){
    	houqinrenyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(houqinrenyuan);
    	HouqinrenyuanEntity user = houqinrenyuanService.selectOne(new EntityWrapper<HouqinrenyuanEntity>().eq("houqinrenyuangonghao", houqinrenyuan.getHouqinrenyuangonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		houqinrenyuan.setId(new Date().getTime());
        houqinrenyuanService.insert(houqinrenyuan);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody HouqinrenyuanEntity houqinrenyuan, HttpServletRequest request){
    	houqinrenyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(houqinrenyuan);
    	HouqinrenyuanEntity user = houqinrenyuanService.selectOne(new EntityWrapper<HouqinrenyuanEntity>().eq("houqinrenyuangonghao", houqinrenyuan.getHouqinrenyuangonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		houqinrenyuan.setId(new Date().getTime());
        houqinrenyuanService.insert(houqinrenyuan);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody HouqinrenyuanEntity houqinrenyuan, HttpServletRequest request){
        //ValidatorUtils.validateEntity(houqinrenyuan);
        houqinrenyuanService.updateById(houqinrenyuan);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        houqinrenyuanService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<HouqinrenyuanEntity> wrapper = new EntityWrapper<HouqinrenyuanEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = houqinrenyuanService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	


}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值