Java 實戰(zhàn)項目之精美物流管理系統(tǒng)的實現(xiàn)流程
一、項目簡述
本系統(tǒng)功能包括:
數(shù)據(jù)統(tǒng)計、收件錄入、發(fā)件錄入、到件錄入、派件錄入、問題件錄入、退件錄入、留倉錄入、裝車錄入、發(fā)車錄入、到車錄入、卸車錄入、運單錄入、運單編輯、運單查詢、數(shù)據(jù)導(dǎo)入、簽收錄入、簽收查詢、快件跟蹤、自定義跟蹤、問題件跟蹤、預(yù)付款管理、財務(wù)報表明細(xì)、現(xiàn)金賬單、月結(jié)賬單、代收貨款、業(yè)務(wù)員提成、訂單分配、訂單查詢、物品名維護、入庫、出庫、庫存、物料、角色管理、用戶管理、系統(tǒng)設(shè)置、員工維護、客戶維護、網(wǎng)點維護、報價維護、其他維護、收發(fā)記錄、到件預(yù)報。
二、項目運行
環(huán)境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。
項目技術(shù): Springboot + Maven + mybatis+ Vue 等等組成,B/S模式 + Maven管理等等。






運輸點管理控制層代碼:
/**
* 運輸點管理控制層
*/
@RequestMapping("/admin/transport")
@Controller
public class TransportController {
@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.TRANSPORT));
return "admin/transport/list";
}
/**
* 新增運輸點頁面
* @param model
* @return
*/
@RequestMapping(value="/add",method= RequestMethod.GET)
public String add(Model model){
model.addAttribute("roles", roleService.findAllByRoleType(UserRoleTypeEnum.TRANSPORT));
return "admin/transport/add";
}
/**
* 運輸點添加表單提交處理
* @param user
* @return
*/
@RequestMapping(value="/add",method= RequestMethod.POST)
@ResponseBody
public Result<Boolean> add(User user){
//用統(tǒng)一驗證實體方法驗證是否合法
CodeMsg validate = ValidateEntityUtil.validate(user);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}
if(user.getAddress() == null){
return Result.error(CodeMsg.ADDRESS_ERROR);
}
if(user.getRole() == null || user.getRole().getId() == null){
return Result.error(CodeMsg.TRANSPORT_USER_ROLE_EMPTY);
}
//判斷運輸點名是否存在
if(userService.isExistUsername(user.getUsername(), 0L)){
return Result.error(CodeMsg.TRANSPORT_USERNAME_EXIST);
}
user.setUserType(UserRoleTypeEnum.TRANSPORT);
//到這說明一切符合條件,進行數(shù)據(jù)庫新增
if(userService.save(user) == null){
return Result.error(CodeMsg.TRANSPORT_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")Long id){
model.addAttribute("roles", roleService.findAllByRoleType(UserRoleTypeEnum.TRANSPORT));
model.addAttribute("user", userService.find(id));
return "admin/transport/edit";
}
/**
* 編輯運輸點信息表單提交處理
* @param user
* @return
*/
@RequestMapping(value="/edit",method= RequestMethod.POST)
@ResponseBody
public Result<Boolean> edit(User user){
//用統(tǒng)一驗證實體方法驗證是否合法
CodeMsg validate = ValidateEntityUtil.validate(user);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}
if(user.getAddress() == null){
return Result.error(CodeMsg.ADDRESS_ERROR);
}
if(user.getRole() == null || user.getRole().getId() == null){
return Result.error(CodeMsg.TRANSPORT_USER_ROLE_EMPTY);
}
if(user.getId() == null || user.getId().longValue() <= 0){
return Result.error(CodeMsg.TRANSPORT_USE_NO_EXIST);
}
if(userService.isExistUsername(user.getUsername(), user.getId())){
return Result.error(CodeMsg.TRANSPORT_USERNAME_EXIST);
}
//到這說明一切符合條件,進行數(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.TRANSPORT_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")Long id){
try {
userService.delete(id);
} catch (Exception e) {
return Result.error(CodeMsg.TRANSPORT_USE_DELETE_ERROR);
}
operaterLogService.add("刪除運輸點,運輸點ID:" + id);
return Result.success(true);
}
}
到此這篇關(guān)于Java 實戰(zhàn)項目之精美物流管理系統(tǒng)的實現(xiàn)流程的文章就介紹到這了,更多相關(guān)Java 物流管理系統(tǒng)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
java線程池ExecutorService超時處理小結(jié)
使用ExecutorService時,設(shè)置子線程執(zhí)行超時是一個常見需求,本文就來詳細(xì)的介紹一下ExecutorService超時的三種方法,感興趣的可以了解一下2024-09-09
Spring boot 實現(xiàn)單個或批量文件上傳功能
這篇文章主要介紹了Spring boot 實現(xiàn)單個或批量文件上傳功能,非常不錯,具有一定的參考借鑒價值,需要的朋友參考下吧2018-08-08
Spring Boot實現(xiàn)通用的接口參數(shù)校驗
本文介紹基于 Spring Boot 和 JDK8 編寫一個 AOP ,結(jié)合自定義注解實現(xiàn)通用的接口參數(shù)校驗。具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-05-05
Springboot詳解實現(xiàn)食品倉庫管理系統(tǒng)流程
這是一個使用Springboot開發(fā)的食品倉庫管理系統(tǒng),是為商家提供商品貨物進銷存的信息化管理系統(tǒng),具有一個倉庫管理系統(tǒng)該有的所有功能,感興趣的朋友快來看看吧2022-06-06

