基于javaweb+mysql的ssm物流快递管理系统(java+ssm+js+jsp+mysql)

基于javaweb+mysql的ssm物流快递管理系统(java+ssm+js+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb+mysql的SSM物流快递管理系统(java+ssm+js+jsp+mysql)

项目介绍

仓库管理员角色包含以下功能: 仓库管理员操作,入库操作,员工查看,揽收快件,新建员工等功能。

快递员角色包含以下功能: 员工操作,员工登录,操作成功等功能。

用户角色包含以下功能: 发快递成功,发送快递,查看快递等功能。

管理员角色包含以下功能: 管理员查看全局快递信息等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
		log.setType("0");
		logBiz.insertSelective(log);
		expressBiz.updateByPrimaryKeySelective(express);
		return "redirect:showexp.do?expid="+expid;
	}
	
	//仓库管理员工操作:
	@RequestMapping(value="addstaff")
	public String addstaff(User user,HttpSession session) {
		user.setId(DateUtil.getStaffId());
		user.setType("员工");
		userBiz.insertSelective(user);
		session.setAttribute("addstaffmsg", "创建成功,员工号为:"+user.getId());
		return "newstaff";
	}
	
	@RequestMapping(value="showstaff")
	public String showstaff(HttpSession session) {
		User user = (User) session.getAttribute("loginUser");
		List<User> staffList = userBiz.selectbypt(user.getType());
		session.setAttribute("staffList", staffList);
		return "staff";
	}
	
	@RequestMapping(value="allorder")
	public String allorder(HttpSession session) {
		User user = (User) session.getAttribute("loginUser");
		String location = user.getType().substring(0, user.getType().length()-1);
		List<Express> orderList = expressBiz.selectall(location);
		session.setAttribute("orderList", orderList);
		return "allorder";
	}

}
package com.dzx.express.biz.impl;

@Service(value="ExpressBiz")
public class ExpressBizImpl implements ExpressBiz{
	@Autowired
	ExpressMapper expressMapper;
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPt() {
		return pt;
	}

	public void setPt(String pt) {
		this.pt = pt;
	}
}
package com.dzx.express.entity;

public class Log {
    private Integer logid;

    private String expressid;

    private String context;

    private Date time;

    private String type;

    public Integer getLogid() {
        return logid;
    }

    public void setLogid(Integer logid) {
        this.logid = logid;
    }

    public String getExpressid() {
        return expressid;
    }

    public void setExpressid(String expressid) {
        this.expressid = expressid == null ? null : expressid.trim();
    }
    public void setFromlocation(String fromlocation) {
        this.fromlocation = fromlocation == null ? null : fromlocation.trim();
    }

    public String getTolocation() {
        return tolocation;
    }

    public void setTolocation(String tolocation) {
        this.tolocation = tolocation == null ? null : tolocation.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public Date getPosttime() {
        return posttime;
    }

    public void setPosttime(Date posttime) {
        this.posttime = posttime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }
}
package com.dzx.express.entity;

public class User {
    private String id;
	}

	@Override
	public int insertSelective(Log record) {
		// TODO Auto-generated method stub
		return logMapper.insertSelective(record);
	}

	@Override
	public Log selectByPrimaryKey(Integer logid) {
		// TODO Auto-generated method stub
		return logMapper.selectByPrimaryKey(logid);
	}

	@Override
	public int updateByPrimaryKeySelective(Log record) {
		// TODO Auto-generated method stub
		return logMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Log record) {
		// TODO Auto-generated method stub
		return logMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Log> selectlog(String expressid) {
		// TODO Auto-generated method stub
		return logMapper.selectlog(expressid);
	}

}
package com.dzx.express.biz.impl;

			$("#rtolocation").val(rtolocation);
			$("#fm1").submit();
		}
	</script>

	<div style="text-align: center;"></div>

</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrapValidator.css">
<body><table class="table">
<thead>
					<tr>
						<th>
							快递单号
						</th>
						<th>
							寄发地
						</th>
						<th>
							收件地
						</th>
						<th>
							当前状态
						</th>
						<th>
							下单时间
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
		log.setExpressid(expid);
		log.setTime(new Date());
		if(express.getType().equals("等待揽收")&&user.getType().equals("快递员")) {
		
		session.setAttribute("msg", "操作有误请确认快递单号!");
		}else if(user.getType()!=null&&user.getType().equals("员工")){
			log.setContext("派件中,快递员:"+user.getName()+",电话:"+user.getPhone()+",请确保电话畅通!");
			express.setType("派件中,快递员:"+user.getName()+"电话:"+user.getPhone());
			session.setAttribute("msg", "操作成功!单号"+expid+"已经准备派件");
		}else {
			log.setContext(user.getType()+"已出库,发往下一目的地");
			express.setType("正在运输,之前位置:"+user.getType());
			session.setAttribute("msg", "操作成功!单号"+expid+"已经出库");
		}
		expressBiz.updateByPrimaryKeySelective(express);
		logBiz.insert(log);
		
		return "orderin";
	}
	
	@RequestMapping(value="order")
	public void order(String expid,String staffid,HttpServletResponse res) throws IOException {
		res.setCharacterEncoding("utf-8");
		PrintWriter pw = res.getWriter();
		User user = userBiz.selectByPrimaryKey(staffid);
		if(user==null) {
			pw.write("0");
			return;
		}
		Log log = new Log();
		log.setContext("快递员:"+user.getName()+"已出发,联系电话"+user.getPhone());
		log.setExpressid(expid);
		log.setTime(new Date());
		Express express = expressBiz.selectByPrimaryKey(expid);
		express.setType("正在揽收,快递员:"+user.getName()+",电话:"+user.getPhone());
		logBiz.insert(log);
		expressBiz.updateByPrimaryKeySelective(express);
		pw.write("已发出揽收通知!");
	}
	
	@RequestMapping(value="orderremove")
	public void orderremove(String expid) {
		expressBiz.deleteByPrimaryKey(expid);
	}
	
	@RequestMapping(value="confimorder")
	public String confimorder(String expid) {
		Express express = expressBiz.selectByPrimaryKey(expid);
		express.setType("已确认收货,感谢您的使用!");
		Log log = new Log();
		log.setContext("已确认收货,感谢您的使用!");
		log.setExpressid(expid);
		log.setTime(new Date());
		log.setType("0");

public interface LogBiz {
	  int deleteByPrimaryKey(Integer logid);

	    int insert(Log record);

	    int insertSelective(Log record);

	    Log selectByPrimaryKey(Integer logid);

	    int updateByPrimaryKeySelective(Log record);

	    int updateByPrimaryKey(Log record);
	    
	    List<Log> selectlog(String expressid);
}
package com.dzx.express.mapper;

public interface LogMapper {
	List<Log> selectlog(String expressid);
	
    int deleteByPrimaryKey(Integer logid);

    int insert(Log record);

    int insertSelective(Log record);

    Log selectByPrimaryKey(Integer logid);

    int updateByPrimaryKeySelective(Log record);

    int updateByPrimaryKey(Log record);
}
package com.dzx.express.mapper;

		log.setTime(new Date());
		if(express.getType().equals("等待揽收")&&user.getType().equals("快递员")) {
		
		session.setAttribute("msg", "操作有误请确认快递单号!");
		}else if(user.getType()!=null&&user.getType().equals("员工")){
			log.setContext("派件中,快递员:"+user.getName()+",电话:"+user.getPhone()+",请确保电话畅通!");
			express.setType("派件中,快递员:"+user.getName()+"电话:"+user.getPhone());
			session.setAttribute("msg", "操作成功!单号"+expid+"已经准备派件");
		}else {
			log.setContext(user.getType()+"已出库,发往下一目的地");
			express.setType("正在运输,之前位置:"+user.getType());
			session.setAttribute("msg", "操作成功!单号"+expid+"已经出库");
		}
		expressBiz.updateByPrimaryKeySelective(express);
		logBiz.insert(log);
		
		return "orderin";
	}
	
	@RequestMapping(value="order")
	public void order(String expid,String staffid,HttpServletResponse res) throws IOException {
		res.setCharacterEncoding("utf-8");
		PrintWriter pw = res.getWriter();
		User user = userBiz.selectByPrimaryKey(staffid);
		if(user==null) {
			pw.write("0");
			return;
		}
		Log log = new Log();
		log.setContext("快递员:"+user.getName()+"已出发,联系电话"+user.getPhone());
		log.setExpressid(expid);
		log.setTime(new Date());
		Express express = expressBiz.selectByPrimaryKey(expid);
		express.setType("正在揽收,快递员:"+user.getName()+",电话:"+user.getPhone());
		logBiz.insert(log);
		expressBiz.updateByPrimaryKeySelective(express);
		pw.write("已发出揽收通知!");
	}
	
	@RequestMapping(value="orderremove")
	public void orderremove(String expid) {
		expressBiz.deleteByPrimaryKey(expid);
	}
	
	@RequestMapping(value="confimorder")
	public String confimorder(String expid) {
		Express express = expressBiz.selectByPrimaryKey(expid);
		express.setType("已确认收货,感谢您的使用!");
		Log log = new Log();
		log.setContext("已确认收货,感谢您的使用!");
		url : "orderout.do",
		data : {
			"expid" : id
		},
		async : true,
		dataType : 'text',
		success : function(data) {
			alert("出库成功!");
			location.reload(true);
		},
		error : function(data) {
			alert("出错!请联系管理员");
		}
	});
}
function orderin(id){
	$.ajax({
		type : "post",
		url : "orderin.do",
		data : {
			"expid" : id
		},
		async : true,
		dataType : 'text',
		success : function(data) {
			alert("入库成功!");
			location.reload(true);
		},
		error : function(data) {
			alert("出错!请联系管理员");
		}
	});
}
function order(id){
	var staffid=prompt("请输入揽收员工号","");
	$.ajax({
		type : "post",
		url : "order.do",
		data : {
			"expid" : id,
			"staffid": staffid
		},
    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context == null ? null : context.trim();
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }
}
package com.dzx.express.util;

public class DateUtil {
	private static SimpleDateFormat sdf=new  SimpleDateFormat("yyyyMMddHHmmss");
public static String getId(){
	Random random=new Random();
	Date date=new Date();
	String resu=sdf.format(date)+(random.nextInt(1000)+1000);
	return resu;
	
	
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPt() {
		return pt;
	}

	public void setPt(String pt) {
		this.pt = pt;
	}
}
package com.dzx.express.entity;

public class Log {
    private Integer logid;

    private String expressid;

    private String context;

    private Date time;

    private String type;

    public Integer getLogid() {
        return logid;
    }

    public void setLogid(Integer logid) {
        this.logid = logid;
    }

    public String getExpressid() {
        return expressid;
    }

    public void setExpressid(String expressid) {
        this.expressid = expressid == null ? null : expressid.trim();
	
	@RequestMapping(value="addorder")
	public String addorder(Express express,HttpSession session) {
		express.setId(DateUtil.getId());
		express.setPosttime(new Date());
		express.setType("等待揽收");
		expressBiz.insertSelective(express);
		session.setAttribute("expid", express.getId());
		return "success";
	}
	
	@RequestMapping(value="showexp")
	public String showexp(String expid,HttpSession session) {
		Express express = expressBiz.selectByPrimaryKey(expid);
		if(express==null) {
			List<Express> expressList = expressBiz.selectbyphone(expid);
			if(expressList.size()==0) {
				session.setAttribute("msg", "没有此快递单号或手机号的记录,请核对后再次查询!");
				return "index";
			}
			session.setAttribute("expressList", expressList);
			return "success";
		}
		List<Log> logList = logBiz.selectlog(expid);
		session.setAttribute("express", express);
		session.setAttribute("logList", logList);
		return "orderinfo";
	}
	
	
	
	@RequestMapping(value="staff")
	public String staff() {
		return "login";
	}
	
	@RequestMapping(value="login")
	public String login(String username,String password,HttpSession session) {
		User user = userBiz.selectByPrimaryKey(username);
		if(!user.getPassword().equals(password)) {
			session.setAttribute("error", "工号或密码错误!");
			return "login";
		}
		session.setAttribute("loginUser", user);
		expressBiz.insertSelective(express);
		session.setAttribute("expid", express.getId());
		return "success";
	}
	
	@RequestMapping(value="showexp")
	public String showexp(String expid,HttpSession session) {
		Express express = expressBiz.selectByPrimaryKey(expid);
		if(express==null) {
			List<Express> expressList = expressBiz.selectbyphone(expid);
			if(expressList.size()==0) {
				session.setAttribute("msg", "没有此快递单号或手机号的记录,请核对后再次查询!");
				return "index";
			}
			session.setAttribute("expressList", expressList);
			return "success";
		}
		List<Log> logList = logBiz.selectlog(expid);
		session.setAttribute("express", express);
		session.setAttribute("logList", logList);
		return "orderinfo";
	}
	
	
	
	@RequestMapping(value="staff")
	public String staff() {
		return "login";
	}
	
	@RequestMapping(value="login")
	public String login(String username,String password,HttpSession session) {
		User user = userBiz.selectByPrimaryKey(username);
		if(!user.getPassword().equals(password)) {
			session.setAttribute("error", "工号或密码错误!");
			return "login";
		}
		session.setAttribute("loginUser", user);
		session.removeAttribute("msg");
		String lastname = user.getType().substring(user.getType().length()-1, user.getType().length());
		if(lastname.equals("仓")) {
			return "cangadmin";
		}
		if(user.getType().equals("admin")) {
			List<Express> orderList = expressBiz.selectall("");
			session.setAttribute("orderList", orderList);
			return "admin";
		}
		return "orderin";
	}
        this.type = type == null ? null : type.trim();
    }

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPt() {
		return pt;
	}

	public void setPt(String pt) {
		this.pt = pt;
	}
}
package com.dzx.express.entity;

public class Log {
    private Integer logid;

    private String expressid;

    private String context;

    private Date time;

    private String type;

    public Integer getLogid() {
        return logid;
    }

    public void setLogid(Integer logid) {
        this.logid = logid;
	public int updateByPrimaryKeySelective(Express record) {
		// TODO Auto-generated method stub
		return expressMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Express record) {
		// TODO Auto-generated method stub
		return expressMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Express> selectbyphone(String phone) {
		// TODO Auto-generated method stub
		return expressMapper.selectbyphone(phone);
	}

	@Override
	public List<Express> selectall(String location) {
		// TODO Auto-generated method stub
		return expressMapper.selectall(location);
	}

}
package com.dzx.express.biz.impl;

@Service(value="LogBiz")
public class LogBizImpl implements LogBiz{
	@Autowired
	LogMapper logMapper;

	@Override
	public int deleteByPrimaryKey(Integer logid) {
		// TODO Auto-generated method stub
		return logMapper.deleteByPrimaryKey(logid);
	}

	@Override
	public int insert(Log record) {
		// TODO Auto-generated method stub
		return logMapper.insert(record);
public class ExpressBizImpl implements ExpressBiz{
	@Autowired
	ExpressMapper expressMapper;

	@Override
	public int deleteByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return expressMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Express record) {
		// TODO Auto-generated method stub
		return expressMapper.insert(record);
	}

	@Override
	public int insertSelective(Express record) {
		// TODO Auto-generated method stub
		return expressMapper.insertSelective(record);
	}

	@Override
	public Express selectByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return expressMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Express record) {
		// TODO Auto-generated method stub
		return expressMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Express record) {
		// TODO Auto-generated method stub
		return expressMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Express> selectbyphone(String phone) {
}
public static String getStaffId(){
	Random random=new Random();
	Date date=new Date();
	String resu=sdf.format(date)+(random.nextInt(10)+10);
	return resu;
	
	
}
public static void main(String args[]){
	System.out.println(DateUtil.getId());
}

}
package com.dzx.express.mapper;

public interface ExpressMapper {
	List<Express> selectall(String location);
	
	List<Express> selectbyphone(String phone);
	
    int deleteByPrimaryKey(String id);

    int insert(Express record);

    int insertSelective(Express record);

    Express selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(Express record);

    int updateByPrimaryKey(Express record);
}
package com.dzx.express.biz;

public interface ExpressBiz {
	List<Express> selectall(String location);
	
	List<Express> selectbyphone(String phone);
    }

    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPt() {
		return pt;
	}

	public void setPt(String pt) {
		this.pt = pt;
	}
}
package com.dzx.express.entity;

public class Log {
    private Integer logid;

    private String expressid;

    private String context;

    private Date time;

    private String type;

    public Integer getLogid() {
        return logid;
    }

    public void setLogid(Integer logid) {
        this.logid = logid;
    }

      <if test="fromlocation != null" >
        #{fromlocation,jdbcType=VARCHAR},
      </if>
      <if test="tolocation != null" >
        #{tolocation,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="posttime != null" >
        #{posttime,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null" >
        #{type,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dzx.express.entity.Express" >
    update express
    <set >
      <if test="fromlocation != null" >
        fromlocation = #{fromlocation,jdbcType=VARCHAR},
      </if>
      <if test="tolocation != null" >
        tolocation = #{tolocation,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="posttime != null" >
        posttime = #{posttime,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null" >
        type = #{type,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dzx.express.entity.Express" >
    update express
    set fromlocation = #{fromlocation,jdbcType=VARCHAR},
      tolocation = #{tolocation,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      posttime = #{posttime,jdbcType=TIMESTAMP},
      type = #{type,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>
	
	@RequestMapping(value="showexp")
	public String showexp(String expid,HttpSession session) {
		Express express = expressBiz.selectByPrimaryKey(expid);
		if(express==null) {
			List<Express> expressList = expressBiz.selectbyphone(expid);
			if(expressList.size()==0) {
				session.setAttribute("msg", "没有此快递单号或手机号的记录,请核对后再次查询!");
				return "index";
			}
			session.setAttribute("expressList", expressList);
			return "success";
		}
		List<Log> logList = logBiz.selectlog(expid);
		session.setAttribute("express", express);
		session.setAttribute("logList", logList);
		return "orderinfo";
	}
	
	
	
	@RequestMapping(value="staff")
	public String staff() {
		return "login";
	}
	
	@RequestMapping(value="login")
	public String login(String username,String password,HttpSession session) {
		User user = userBiz.selectByPrimaryKey(username);
		if(!user.getPassword().equals(password)) {
			session.setAttribute("error", "工号或密码错误!");
			return "login";
		}
		session.setAttribute("loginUser", user);
		session.removeAttribute("msg");
		String lastname = user.getType().substring(user.getType().length()-1, user.getType().length());
		if(lastname.equals("仓")) {
			return "cangadmin";
		}
		if(user.getType().equals("admin")) {
			List<Express> orderList = expressBiz.selectall("");
			session.setAttribute("orderList", orderList);

public interface ExpressBiz {
	List<Express> selectall(String location);
	
	List<Express> selectbyphone(String phone);
	
	int deleteByPrimaryKey(String id);

    int insert(Express record);

    int insertSelective(Express record);

    Express selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(Express record);

    int updateByPrimaryKey(Express record);
}
package com.dzx.express.biz;

public interface LogBiz {
	  int deleteByPrimaryKey(Integer logid);

	    int insert(Log record);

	    int insertSelective(Log record);

	    Log selectByPrimaryKey(Integer logid);

	    int updateByPrimaryKeySelective(Log record);

	    int updateByPrimaryKey(Log record);
	    
	    List<Log> selectlog(String expressid);
}
package com.dzx.express.mapper;


	    int insert(Log record);

	    int insertSelective(Log record);

	    Log selectByPrimaryKey(Integer logid);

	    int updateByPrimaryKeySelective(Log record);

	    int updateByPrimaryKey(Log record);
	    
	    List<Log> selectlog(String expressid);
}
package com.dzx.express.mapper;

public interface LogMapper {
	List<Log> selectlog(String expressid);
	
    int deleteByPrimaryKey(Integer logid);

    int insert(Log record);

    int insertSelective(Log record);

    Log selectByPrimaryKey(Integer logid);

    int updateByPrimaryKeySelective(Log record);

    int updateByPrimaryKey(Log record);
}
package com.dzx.express.mapper;

public interface UserMapper {
	List<User> selectbypt(String pt);
	}

	@Override
	public List<User> selectbypt(String pt) {
		// TODO Auto-generated method stub
		return userMapper.selectbypt(pt);
	}

}
package com.dzx.express.util;

public class MyBatisXmlGenerator {
	public static void main(String[] args) {
		try {
			List<String> warnings = new ArrayList<String>();
			boolean overwrite = true;
			// 读取配置文件
			InputStream configFile = MyBatisXmlGenerator.class.getClassLoader()
					.getResourceAsStream("MyBatisGeneratorConfig.xml");
			ConfigurationParser cp = new ConfigurationParser(warnings);
			Configuration config;

			config = cp.parseConfiguration(configFile);

			DefaultShellCallback callback = new DefaultShellCallback(overwrite);
			MyBatisGenerator myBatisGenerator;

			myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
			myBatisGenerator.generate(null);
			System.out.println("Generator job done!");
			// 打印结果
			for (String str : warnings) {
				System.out.println(str);
			} 
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
package com.dzx.express.entity;
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>寄发快递</title>
<link rel="stylesheet" href="css/cityselect.css">
<style type="text/css">
.demo {
	width: 670px;
	margin: 100px auto;
	
}

.demo input {
	padding: 12px 18px;
}
</style>

</head>
<body style="background-image: url(image/background.jpg);-moz-background-size:100% 100%; background-size:100% 100%;">
	<div style="background-color: rgba(246,246,246,0.9);">
	<h3 style="text-align: center; margin-top: 15px;">请认真填写快递单:</h3>
	<form id="fm1" action="addorder.do" method="post">
	<div class="demo">
		<!-- 在输入框加入id -->
		<input type="hidden" name="fromlocation" id="rfromlocation">
		<label for="fromlocation">寄发城市</label> 
		<input type="text"
			class="cityinput"  id="fromlocation"
			placeholder="请输入寄发地"> <label for="fromlocation">寄发详细地址</label>
		<input type="text" class="cityinput" name="fromdetal" id="fromdetal"
			style="width: 300px;" placeholder="请输入详细地址"><br><span id="fromlabel" style="color: red;"></span>
		<br><span id="fromlabel1" style="color: red;"></span>
		<br> <label for="fromlocation">寄发人</label> 
		<input type="text"
			class="cityinput" name="fromname" id="fromname" placeholder="请输入寄发人"> <label
			for="fromlocation">寄发人电话</label> 
			<input type="text" class="cityinput"
			name="phone" id="fromphone" style="width: 300px;" placeholder="请输入寄发人电话">
	</div>
	<div class="demo" style="text-align: center;">
		<span style=""><br>
		<br></span>
	</div>
	<div class="demo">
		<!-- 在输入框加入id -->
		<input type="hidden" name="tolocation" id="rtolocation">
		<label for="tolocation">收件城市</label> <input type="text"
	}

	@Override
	public int insertSelective(User record) {
		// TODO Auto-generated method stub
		return userMapper.insertSelective(record);
	}

	@Override
	public User selectByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return userMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(User record) {
		// TODO Auto-generated method stub
		return userMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(User record) {
		// TODO Auto-generated method stub
		return userMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<User> selectbypt(String pt) {
		// TODO Auto-generated method stub
		return userMapper.selectbypt(pt);
	}

}
package com.dzx.express.util;

        this.fromlocation = fromlocation == null ? null : fromlocation.trim();
    }

    public String getTolocation() {
        return tolocation;
    }

    public void setTolocation(String tolocation) {
        this.tolocation = tolocation == null ? null : tolocation.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public Date getPosttime() {
        return posttime;
    }

    public void setPosttime(Date posttime) {
        this.posttime = posttime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }
}
package com.dzx.express.entity;

public class User {
    private String id;

			return "cangadmin";
		}
		if(user.getType().equals("admin")) {
			List<Express> orderList = expressBiz.selectall("");
			session.setAttribute("orderList", orderList);
			return "admin";
		}
		return "orderin";
	}
	
	@RequestMapping(value="orderin")
	public String orderin(String expid,HttpSession session) {
		session.removeAttribute("msg");
		Express express = expressBiz.selectByPrimaryKey(expid);
		if(express==null) {
			session.setAttribute("msg", "没有此快递单号的记录,请核对后再次操作!");
			return "orderin";
		}
		User user = (User) session.getAttribute("loginUser");
		Log log = new Log();
		log.setExpressid(expid);
		log.setTime(new Date());
		String type = express.getType().substring(0, 4);
		//System.out.println(type);
		if(type.equals("正在揽收")&&user.getType().equals("员工")) {
		log.setContext("揽收成功!");
		express.setType("已经揽收等待运输");
		session.setAttribute("msg", "操作成功!单号"+expid+"已经揽收");
		}else if(user.getType().equals("员工")){
			log.setContext("已签收");
			express.setType("已签收,请确认收货");
			session.setAttribute("msg", "操作成功!单号"+expid+"已经完成签收");
		}else {
			log.setContext(user.getType()+"已入库");
			express.setType("正在运输,当前位置:"+user.getType());
			session.setAttribute("msg", "操作成功!单号"+expid+"已经入库");
		}
		expressBiz.updateByPrimaryKeySelective(express);
		logBiz.insert(log);
		
		return "orderin";
	}
	@RequestMapping(value="orderout")
	public String orderout(String expid,HttpSession session) {
		Express express = expressBiz.selectByPrimaryKey(expid);
		if(express==null) {
			session.setAttribute("msg", "没有此快递单号的记录,请核对后再次操作!");
			return "orderin";
		}
		User user = (User) session.getAttribute("loginUser");
		Log log = new Log();
		log.setExpressid(expid);
		log.setTime(new Date());
		if(express.getType().equals("等待揽收")&&user.getType().equals("快递员")) {

请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值