基于javaweb+jsp的仓库进销存管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
<if test ='chukuName != null'>`chuku_name` = #{chukuName},if>
<if test ='chukuSuliang != null'>`chuku_suliang` = #{chukuSuliang},if>
<if test ='chukuClientname != null'>`chuku_clientname` = #{chukuClientname},if>
<if test ='chukuTel != null'>`chuku_tel` = #{chukuTel},if>
<if test ='chukuMan != null'>`chuku_man` = #{chukuMan},if>
<if test ='chukuText != null'>`chuku_text` = #{chukuText}if>
set>
WHERE `id` = #{id}
update>
<select id="findById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_chuku` WHERE `id` = #{id}
select>
<select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_chuku`
<where>
<if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
${searchColumn} LIKE CONCAT('%',#{keyword},'%') AND
if>
1=1
<label class="col-sm-3 control-label">货号:label>
<div class="col-sm-5">
<input type="text" class="form-control" id="rukuNo" name="rukuNo" value="${vo.rukuNo}">
div>
div>
<div class="form-group">
<label class="col-sm-3 control-label">采购单号:label>
<div class="col-sm-5">
<input type="text" class="form-control" id="rukuDingdanhao" name="rukuDingdanhao" value="${vo.rukuDingdanhao}">
div>
div>
<div class="form-group">
<label class="col-sm-3 control-label">货物名称:label>
<div class="col-sm-5">
import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping
public class ChukuController {
@Autowired
private ChukuService chukuService;
/**
* 增加出库
*
* @param response
* @param request
* @throws IOException
*/
public class Chuku implements Serializable {
private Long id;//主键
private String chukuHuohao;//货号
private String chukuName;//货物名称
private String chukuSuliang;//数量
private String chukuClientname;//客户名
private String chukuTel;//联系方式
private String chukuMan;// *** 作员
private String chukuText;//备注
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
* 根据条件查询入库的列表并跳转回页面
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("rukuList")
public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
this.redirectList(request, response);
}
/**
* 跳转到列表页面
*
* @param request
* @param response
*/
private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
//查询列和关键字
String searchColumn = Util.decode(request, "searchColumn");
String keyword = Util.decode(request, "keyword");
Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
params.put("searchColumn", searchColumn);//要查询的列
params.put("keyword", keyword);//查询的关键字
Map<String, Object> map = rukuService.list(params);
request.getSession().setAttribute("list", map.get("list"));
* 编辑出库
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("chukuEdit")
public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
Chuku vo = new Chuku();
vo.setId(Long.valueOf(Util.decode(request, "id")));
vo.setChukuHuohao(Util.decode(request, "chukuHuohao"));
vo.setChukuName(Util.decode(request, "chukuName"));
vo.setChukuSuliang(Util.decode(request, "chukuSuliang"));
vo.setChukuClientname(Util.decode(request, "chukuClientname"));
vo.setChukuTel(Util.decode(request, "chukuTel"));
vo.setChukuMan(Util.decode(request, "chukuMan"));
div>
div>
<div class="form-group">
<label class="col-sm-3 control-label"> *** 作员:label>
<div class="col-sm-5">
<input type="text" class="form-control" id="rukuRen" name="rukuRen">
div>
div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:label>
<div class="col-sm-5">
<textarea rows="3" class="form-control" id="rukuText" name="rukuText" placeholder="请输入内容......">textarea>
div>
div>
<div class="form-group">
request.getSession().setAttribute("vo", vo);
String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
response.sendRedirect("ruku_" + to + ".jsp");
}
/**
* 根据条件查询入库的列表并跳转回页面
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("rukuList")
public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
this.redirectList(request, response);
}
/**
* 跳转到列表页面
*
alert("采购单号不能为空!");
return false;
}
if (document.getElementById("rukuName").value.trim().length == 0) {
alert("货物名称不能为空!");
return false;
}
if (document.getElementById("rukuSuliang").value.trim().length == 0) {
alert("数量不能为空!");
return false;
}
if (document.getElementById("rukuTime").value.trim().length == 0) {
alert("入库时间不能为空!");
return false;
}
if (document.getElementById("rukuRen").value.trim().length == 0) {
alert(" *** 作员不能为空!");
return false;
}
return true;
}
script>
html>
ImageIO.write(image, "JPEG", os);// 以JPEG格式向客户端发送图形验证码
}
@RequestMapping("authResetPassword")
public void resetPassword(HttpServletResponse response, HttpServletRequest request) throws IOException, ServletException {
String msg;
User loginUser = (User) request.getSession().getAttribute("loginUser");
String oldPassword = Util.decode(request, "oldPassword");
if (!loginUser.getPassword().equals(oldPassword)) {
msg = "原密码错误!";
} else {
String newPassword = Util.decode(request, "newPassword");
loginUser.setPassword(newPassword);
this.userService.update(loginUser);
msg = "修改成功!";
}
request.getSession().setAttribute("alert_msg", msg);
request.getRequestDispatcher("reset_password.jsp").forward(request, response);
}
// 返回一个随机颜色(Color对象)
private Color getRandomColor(int minColor, int maxColor) {
Random random = new Random();
// 保存minColor最大不会超过255
private String servlet;//查询时要请求的接口
private String searchColumn;//待模糊查询的列
private String keyword;//待模糊查询的关键字
//通过pageNum,pageSize,totalRecord计算得来tatalPage和startIndex,构造方法中将pageNum,pageSize,totalRecord获得
public PageBean(int pageNum, int totalRecord) {
this.pageNum = (pageNum = Math.max(pageNum, 1));
this.pageSize = 10;//默认为10
this.totalRecord = totalRecord;
//totalPage 总页数
if (totalRecord % pageSize == 0) {
//说明整除,正好每页显示pageSize条数据,没有多余一页要显示少于pageSize条数据的
this.totalPage = totalRecord / pageSize;
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、出库模块、库存模块、入库模块的增删改查管理
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)