欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Java實(shí)戰(zhàn)之在線寄查快遞系統(tǒng)的實(shí)現(xiàn)

 更新時間:2022年02月26日 10:03:50   作者:qq1334611189  
這篇文章主要介紹了如何利用Java制作一個在線寄查快遞系統(tǒng),文中采用的技術(shù)有java、SpringBoot、FreeMarker、Mysql,需要的可以參考一下

介紹

超級管理員:系統(tǒng)管理、用戶管理、網(wǎng)點(diǎn)管理、運(yùn)輸點(diǎn)管理、快遞員管理、網(wǎng)點(diǎn)申請管理(審核)、報價管理(時效報價)等。

普通用戶:注冊登錄、個人信息管理(個人資料、密碼修改等)、地址管理、實(shí)名認(rèn)證、在線寄件(單件寄件、批量導(dǎo)入寄件)、訂單查詢(物流信息查詢)、在線申請網(wǎng)點(diǎn)、投訴建議等。

網(wǎng)點(diǎn)管理員:攬收負(fù)責(zé)區(qū)域的快遞,進(jìn)行快遞快遞運(yùn)輸,確認(rèn)到達(dá)快遞,快遞到達(dá)后指派網(wǎng)點(diǎn)下快遞員進(jìn)行派送。

運(yùn)輸點(diǎn)管理員:負(fù)責(zé)運(yùn)輸至該運(yùn)輸點(diǎn)的快遞再次運(yùn)輸。

運(yùn)行環(huán)境:windows/Linux均可、jdk1.8、mysql5.7、idea/eclipse均可。

效果圖

核心代碼

后臺角色管理控制器

/**
 * 后臺角色管理控制器
 * @author yy
 *
 */
@RequestMapping("/admin/role")
@Controller
public class RoleController {
 
	
	private Logger log = LoggerFactory.getLogger(RoleController.class);
	
	@Autowired
	private MenuService menuService;
	
	@Autowired
	private OperaterLogService operaterLogService;
	
	@Autowired
	private RoleService roleService;
	
	/**
	 * 分頁搜索角色列表
	 * @param model
	 * @param role
	 * @param pageBean
	 * @return
	 */
	@RequestMapping(value="/list")
	public String list(Model model,Role role,PageBean<Role> pageBean){
		model.addAttribute("title", "角色列表");
		model.addAttribute("name", role.getName());
		model.addAttribute("pageBean", roleService.findByName(role, pageBean));
		return "admin/role/list";
	}
	
	/**
	 * 角色添加頁面
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/add",method=RequestMethod.GET)
	public String add(Model model){
		List<Menu> findAll = menuService.findAll();
		model.addAttribute("roleTypes", UserRoleTypeEnum.values());
		model.addAttribute("topMenus",MenuUtil.getTopMenus(findAll));
		model.addAttribute("secondMenus",MenuUtil.getSecondMenus(findAll));
		model.addAttribute("thirdMenus",MenuUtil.getThirdMenus(findAll));
		return "admin/role/add";
	}
	
	/**
	 * 角色添加表單提交處理
	 * @param role
	 * @return
	 */
	@RequestMapping(value="/add",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> add(Role role){
		Role top1ByRoleType = roleService.findTop1ByRoleTypeAndRoleTypeNot(role.getRoleType());
		if (top1ByRoleType != null){
			return Result.error(CodeMsg.ADMIN_ROLE_EXIST);
		}
		//用統(tǒng)一驗(yàn)證實(shí)體方法驗(yàn)證是否合法
		CodeMsg validate = ValidateEntityUtil.validate(role);
		if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
			return Result.error(validate);
		}
		if(roleService.save(role) == null){
			return Result.error(CodeMsg.ADMIN_ROLE_ADD_ERROR);
		}
		log.info("添加角色【"+role+"】");
		operaterLogService.add("添加角色【"+role.getName()+"】");
		return Result.success(true);
	}
	
	/**
	 * 角色編輯頁面
	 * @param id
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.GET)
	public String edit(@RequestParam(name="id",required=true)Long id,Model model){
		List<Menu> findAll = menuService.findAll();
		model.addAttribute("topMenus",MenuUtil.getTopMenus(findAll));
		model.addAttribute("secondMenus",MenuUtil.getSecondMenus(findAll));
		model.addAttribute("thirdMenus",MenuUtil.getThirdMenus(findAll));
		Role role = roleService.find(id);
		model.addAttribute("role", role);
		model.addAttribute("authorities",JSONArray.toJSON(role.getAuthorities()).toString());
		model.addAttribute("roleTypes", UserRoleTypeEnum.values());
		return "admin/role/edit";
	}
	
	/**
	 * 角色修改表單提交處理
	 * @param request
	 * @param role
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> edit(Role role){
		//用統(tǒng)一驗(yàn)證實(shí)體方法驗(yàn)證是否合法
		CodeMsg validate = ValidateEntityUtil.validate(role);
		if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
			return Result.error(validate);
		}
		Role existRole = roleService.find(role.getId());
		if(existRole == null){
			return Result.error(CodeMsg.ADMIN_ROLE_NO_EXIST);
		}
		existRole.setName(role.getName());
		existRole.setRemark(role.getRemark());
		existRole.setStatus(role.getStatus());
		existRole.setAuthorities(role.getAuthorities());
		if(roleService.save(existRole) == null){
			return Result.error(CodeMsg.ADMIN_ROLE_EDIT_ERROR);
		}
		log.info("編輯角色【"+role+"】");
		operaterLogService.add("編輯角色【"+role.getName()+"】");
		return Result.success(true);
	}
	
	/**
	 * 刪除角色
	 * @param request
	 * @param id
	 * @return
	 */
	@RequestMapping(value="delete",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
		try {
			roleService.delete(id);
		} catch (Exception e) {
			// TODO: handle exception
			return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);
		}
		log.info("編輯角色I(xiàn)D【"+id+"】");
		operaterLogService.add("刪除角色I(xiàn)D【"+id+"】");
		return Result.success(true);
	}
}

后臺管理員管理控制器

/**
 * 后臺管理員管理控制器
 * @author yy
 *
 */
@RequestMapping("/admin/user")
@Controller
public class UserController {
 
	@Autowired
	private UserService userService;
	@Autowired
	private RoleService roleService;
	@Autowired
	private OperaterLogService operaterLogService;
	/**
	 * 管理員列表頁面
	 * @param model
	 * @param user
	 * @param pageBean
	 * @return
	 */
	@RequestMapping(value="/list")
	public String list(Model model,User user,PageBean<User> pageBean){
		model.addAttribute("title", "管理員列表");
		model.addAttribute("username", user.getUsername());
		model.addAttribute("pageBean", userService.findList(pageBean,user.getUsername(), UserRoleTypeEnum.ADMIN));
		return "admin/user/list";
	}
	
	/**
	 * 新增管理員頁面
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/add",method=RequestMethod.GET)
	public String add(Model model){
		model.addAttribute("roles", roleService.findAllByRoleType(UserRoleTypeEnum.ADMIN));
		return "admin/user/add";
	}
	
	/**
	 * 管理員添加表單提交處理
	 * @param user
	 * @return
	 */
	@RequestMapping(value="/add",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> add(User user){
		//用統(tǒng)一驗(yàn)證實(shí)體方法驗(yàn)證是否合法
		CodeMsg validate = ValidateEntityUtil.validate(user);
		if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
			return Result.error(validate);
		}
		if(user.getRole() == null || user.getRole().getId() == null){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);
		}
		//判斷管理員名是否存在
		if(userService.isExistUsername(user.getUsername(), 0L)){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
		user.setUserType(UserRoleTypeEnum.ADMIN);
		//到這說明一切符合條件,進(jìn)行數(shù)據(jù)庫新增
		if(userService.save(user) == null){
			return Result.error(CodeMsg.ADMIN_USE_ADD_ERROR);
		}
		operaterLogService.add("添加管理員,管理員名:" + user.getUsername());
		return Result.success(true);
	}
	
	/**
	 * 管理員編輯頁面
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.GET)
	public String edit(Model model,@RequestParam(name="id",required=true)Long id){
		model.addAttribute("roles", roleService.findAllByRoleType(UserRoleTypeEnum.ADMIN));
		model.addAttribute("user", userService.find(id));
		return "admin/user/edit";
	}
	
	/**
	 * 編輯管理員信息表單提交處理
	 * @param user
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> edit(User user){
		//用統(tǒng)一驗(yàn)證實(shí)體方法驗(yàn)證是否合法
		CodeMsg validate = ValidateEntityUtil.validate(user);
		if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
			return Result.error(validate);
		}
		if(user.getRole() == null || user.getRole().getId() == null){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);
		}
		if(user.getId() == null || user.getId().longValue() <= 0){
			return Result.error(CodeMsg.ADMIN_USE_NO_EXIST);
		}
		if(userService.isExistUsername(user.getUsername(), user.getId())){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
		//到這說明一切符合條件,進(jìn)行數(shù)據(jù)庫保存
		User findById = userService.find(user.getId());
		//講提交的管理員信息指定字段復(fù)制到已存在的user對象中,該方法會覆蓋新字段內(nèi)容
		BeanUtils.copyProperties(user, findById, "id","createTime","updateTime","userType");
		if(userService.save(findById) == null){
			return Result.error(CodeMsg.ADMIN_USE_EDIT_ERROR);
		}
		operaterLogService.add("編輯管理員,管理員名:" + user.getUsername());
		return Result.success(true);
	}
	
	/**
	 * 刪除管理員
	 * @param id
	 * @return
	 */
	@RequestMapping(value="/delete",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
		try {
			userService.delete(id);
		} catch (Exception e) {
			return Result.error(CodeMsg.ADMIN_USE_DELETE_ERROR);
		}
		operaterLogService.add("刪除管理員,管理員ID:" + id);
		return Result.success(true);
	}
}

投訴控制層

/**
 * @info : 投訴控制層
 * @author: yy
 */
@RequestMapping("/admin/complaint")
@Controller
public class ComplaintController {
 
    @Autowired
    private ComplaintService complaintService;
 
 
 
    /**
     * 分頁搜索投訴列表
     * @param model
     * @param complaint
     * @param pageBean
     * @return
     */
    @RequestMapping(value="/list")
    public String list(Model model, Complaint complaint, PageBean<Complaint> pageBean){
        model.addAttribute("title", "投訴列表");
        model.addAttribute("waybillNumber", complaint.getWaybillNumber());
        model.addAttribute("pageBean", complaintService.findList(complaint, pageBean));
        return "admin/complaint/list";
    }
 
 
    @RequestMapping(value="/accepted",method= RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> accepted(@RequestParam(name="id")Long id){
        Complaint complaint = complaintService.find(id);
        complaint.setStatus(Complaint.ACCEPTED);
        if (complaintService.save(complaint) == null){
            return Result.error(CodeMsg.COMPLAINT_ACCEPTED_ERROR);
        }
        return Result.success(true);
    }
 
 
 
 
}

前臺申請地點(diǎn)申請控制層

/**
 * @info : 前臺網(wǎng)點(diǎn)申請網(wǎng)點(diǎn)申請控制層
 * @author: yy
 */
 
@RequestMapping("/admin/branchApplyFor")
@Controller
public class BranchApplyForController {
 
 
    @Autowired
    private BranchApplyForService branchApplyForService;
    @Autowired
    private UserService userService;
    @Autowired
    private RoleService roleService;
 
    /**
     * 網(wǎng)點(diǎn)申請列表頁面
     * @param model
     * @param branchApplyFor
     * @param pageBean
     * @return
     */
    @RequestMapping(value="/list")
    public String list(Model model, BranchApplyFor branchApplyFor, PageBean<BranchApplyFor> pageBean){
        model.addAttribute("title", "網(wǎng)點(diǎn)申請列表");
        model.addAttribute("branchName", branchApplyFor.getBranchName());
        model.addAttribute("pageBean", branchApplyForService.findList(pageBean,branchApplyFor.getBranchName(), null));
        return "admin/branch_apply_for/list";
    }
 
    /**
     * 通過申請
     * @param id
     * @return
     */
    @RequestMapping(value="/agree",method=RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> agree(@RequestParam(name="id")Long id){
        Role role = roleService.findTop1ByRoleType(UserRoleTypeEnum.BRANCHES);
        if (role == null){
            return Result.error(CodeMsg.BRANCHAPPLYFOR_ROLE_NO_EXIST);
        }
        Integer integer = branchApplyForService.agreeBranchApplyFor(id, role);
        if (1 == integer){
            return Result.error(CodeMsg.BRANCHAPPLYFOR_THROUGH_ERROR);
        }
        return Result.success(true);
    }
 
    /**
     * 駁回申請
     * @param id
     * @return
     */
    @RequestMapping(value="/rejected",method=RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> rejected(@RequestParam(name="id")Long id,@RequestParam(name = "rejectReason")String rejectReason){
        BranchApplyFor branchApplyFor = branchApplyForService.find(id);
        branchApplyFor.setBranchApplyForStatus(BranchApplyForStatusEnum.NOTTHROUGH);
        if (StringUtils.isEmpty(rejectReason)){
            return  Result.error(CodeMsg.BRANCHAPPLYFOR_NOTTHROUGH_NULL);
        }
        if (rejectReason.length() >= 188){
            return  Result.error(CodeMsg.BRANCHAPPLYFOR_NOTTHROUGH_LENGTH);
        }
        branchApplyFor.setRejectReason(rejectReason);
        if (branchApplyForService.save(branchApplyFor) == null){
            return  Result.error(CodeMsg.BRANCHAPPLYFOR_NOTTHROUGH_ERROR);
        }
        return Result.success(true);
    }
 
    
}

以上就是Java實(shí)戰(zhàn)之在線寄查快遞系統(tǒng)的實(shí)現(xiàn)的詳細(xì)內(nèi)容,更多關(guān)于Java寄查快遞系統(tǒng)的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • java發(fā)起http請求調(diào)用post與get接口的方法實(shí)例

    java發(fā)起http請求調(diào)用post與get接口的方法實(shí)例

    在實(shí)際開發(fā)過程中,我們經(jīng)常需要調(diào)用對方提供的接口或測試自己寫的接口是否合適,下面這篇文章主要給大家介紹了關(guān)于java發(fā)起http請求調(diào)用post與get接口的相關(guān)資料,需要的朋友可以參考下
    2022-08-08
  • 把Jar文件轉(zhuǎn)成exe安裝文件的實(shí)現(xiàn)方法

    把Jar文件轉(zhuǎn)成exe安裝文件的實(shí)現(xiàn)方法

    下面小編就為大家?guī)硪黄袹ar文件轉(zhuǎn)成exe安裝文件的實(shí)現(xiàn)方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2016-11-11
  • Spring JdbcTemplate執(zhí)行數(shù)據(jù)庫操作詳解

    Spring JdbcTemplate執(zhí)行數(shù)據(jù)庫操作詳解

    JdbcTemplate是Spring框架自帶的對JDBC操作的封裝,目的是提供統(tǒng)一的模板方法使對數(shù)據(jù)庫的操作更加方便、友好,效率也不錯,這篇文章主要介紹了Spring JdbcTemplate執(zhí)行數(shù)據(jù)庫操作,需要的朋友可以參考下
    2022-10-10
  • 解讀Java中打印輸出對象內(nèi)容為什么可以不寫.toString()

    解讀Java中打印輸出對象內(nèi)容為什么可以不寫.toString()

    這篇文章主要介紹了解讀Java中打印輸出對象內(nèi)容為什么可以不寫.toString()問題,具有很的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2023-09-09
  • Sentinel源碼解析入口類和SlotChain構(gòu)建過程詳解

    Sentinel源碼解析入口類和SlotChain構(gòu)建過程詳解

    這篇文章主要為大家介紹了Sentinel源碼解析入口類和SlotChain構(gòu)建過程詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-09-09
  • 淺談Spring @Async異步線程池用法總結(jié)

    淺談Spring @Async異步線程池用法總結(jié)

    本篇文章主要介紹了淺談Spring @Async異步線程池用法總結(jié),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-07-07
  • Java中不可或缺的關(guān)鍵字volatile詳析

    Java中不可或缺的關(guān)鍵字volatile詳析

    volatile是Java提供的一種輕量級的同步機(jī)制,下面這篇文章主要給大家介紹了關(guān)于Java中不可或缺的關(guān)鍵字volatile的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-12-12
  • java基于UDP實(shí)現(xiàn)在線聊天功能

    java基于UDP實(shí)現(xiàn)在線聊天功能

    這篇文章主要為大家詳細(xì)介紹了java基于UDP實(shí)現(xiàn)在線聊天功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-09-09
  • java實(shí)現(xiàn)注冊登錄系統(tǒng)

    java實(shí)現(xiàn)注冊登錄系統(tǒng)

    這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)注冊登錄系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-04-04
  • 關(guān)于SpringBoot的熱部署方案

    關(guān)于SpringBoot的熱部署方案

    這篇文章主要介紹了關(guān)于SpringBoot的熱部署方案,每次修改代碼就得將項(xiàng)目重啟,重新部署,對于一些大型應(yīng)用來說,重啟時間需要花費(fèi)大量的時間成本,本文就來詳解熱部署方案,需要的朋友可以參考下
    2023-05-05

最新評論