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






運(yùn)輸點(diǎn)管理控制層代碼:
/**
* 運(yùn)輸點(diǎn)管理控制層
*/
@RequestMapping("/admin/transport")
@Controller
public class TransportController {
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
@Autowired
private OperaterLogService operaterLogService;
/**
* 運(yùn)輸點(diǎn)列表頁面
* @param model
* @param user
* @param pageBean
* @return
*/
@RequestMapping(value="/list")
public String list(Model model, User user, PageBean<User> pageBean){
model.addAttribute("title", "運(yùn)輸點(diǎn)列表");
model.addAttribute("username", user.getUsername());
model.addAttribute("pageBean", userService.findList(pageBean,user.getUsername(), UserRoleTypeEnum.TRANSPORT));
return "admin/transport/list";
}
/**
* 新增運(yùn)輸點(diǎn)頁面
* @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";
}
/**
* 運(yùn)輸點(diǎn)添加表單提交處理
* @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.getAddress() == null){
return Result.error(CodeMsg.ADDRESS_ERROR);
}
if(user.getRole() == null || user.getRole().getId() == null){
return Result.error(CodeMsg.TRANSPORT_USER_ROLE_EMPTY);
}
//判斷運(yùn)輸點(diǎn)名是否存在
if(userService.isExistUsername(user.getUsername(), 0L)){
return Result.error(CodeMsg.TRANSPORT_USERNAME_EXIST);
}
user.setUserType(UserRoleTypeEnum.TRANSPORT);
//到這說明一切符合條件,進(jìn)行數(shù)據(jù)庫新增
if(userService.save(user) == null){
return Result.error(CodeMsg.TRANSPORT_USE_ADD_ERROR);
}
operaterLogService.add("添加運(yùn)輸點(diǎn),運(yùn)輸點(diǎn)名:" + user.getUsername());
return Result.success(true);
}
/**
* 運(yùn)輸點(diǎn)編輯頁面
* @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";
}
/**
* 編輯運(yùn)輸點(diǎn)信息表單提交處理
* @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.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);
}
//到這說明一切符合條件,進(jìn)行數(shù)據(jù)庫保存
User findById = userService.find(user.getId());
//講提交的運(yùn)輸點(diǎn)信息指定字段復(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("編輯運(yùn)輸點(diǎn),運(yùn)輸點(diǎn)名:" + user.getUsername());
return Result.success(true);
}
/**
* 刪除運(yùn)輸點(diǎn)
* @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("刪除運(yùn)輸點(diǎn),運(yùn)輸點(diǎn)ID:" + id);
return Result.success(true);
}
}
到此這篇關(guān)于Java 實(shí)戰(zhàn)項(xiàng)目之精美物流管理系統(tǒng)的實(shí)現(xiàn)流程的文章就介紹到這了,更多相關(guān)Java 物流管理系統(tǒng)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
使用JAR包中MANIFEST.MF的注意事項(xiàng)
這篇文章主要介紹了使用JAR包中MANIFEST.MF的注意事項(xiàng),具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-07-07
Spring Boot結(jié)合IDEA自帶Maven插件如何快速切換profile
IDEA是目前 Java 開發(fā)者中使用最多的開發(fā)工具,它有著簡約的設(shè)計(jì)風(fēng)格,強(qiáng)大的集成工具,便利的快捷鍵,這篇文章主要介紹了Spring Boot結(jié)合IDEA自帶Maven插件快速切換profile,需要的朋友可以參考下2023-03-03
java編程調(diào)用存儲過程中得到新增記錄id號的實(shí)現(xiàn)方法
這篇文章主要介紹了java編程調(diào)用存儲過程中得到新增記錄id號的實(shí)現(xiàn)方法,涉及Java數(shù)據(jù)庫操作中存儲過程的相關(guān)使用技巧,需要的朋友可以參考下2015-10-10
Java使用Iterator迭代器遍歷集合數(shù)據(jù)的方法小結(jié)
這篇文章主要介紹了Java使用Iterator迭代器遍歷集合數(shù)據(jù)的方法,結(jié)合實(shí)例形式分析了java迭代器進(jìn)行集合數(shù)據(jù)遍歷的常見操作技巧,需要的朋友可以參考下2019-11-11
Java畢業(yè)設(shè)計(jì)實(shí)戰(zhàn)之教室預(yù)訂管理系統(tǒng)的實(shí)現(xiàn)
這是一個(gè)使用了java+SpringBoot+Maven+Vue+mysql開發(fā)的教室預(yù)訂管理系統(tǒng),是一個(gè)畢業(yè)設(shè)計(jì)的實(shí)戰(zhàn)練習(xí),具有教室預(yù)訂管理該有的所有功能,感興趣的朋友快來看看吧2022-02-02

