網(wǎng)上購(gòu)物系統(tǒng)源碼seo診斷a5
ssm亞盛汽車(chē)配件銷(xiāo)售業(yè)績(jī)管理統(tǒng)源碼和論文PPT007
開(kāi)發(fā)工具:idea?
?數(shù)據(jù)庫(kù)mysql5.7+(mysql5.7最佳)
?數(shù)據(jù)庫(kù)鏈接工具:navcat,小海豚等
開(kāi)發(fā)技術(shù):java ?ssm tomcat8.5
研究的意義
汽車(chē)配件銷(xiāo)售類(lèi)企業(yè)近年來(lái)得到長(zhǎng)足發(fā)展,在市場(chǎng)份額不斷擴(kuò)大同時(shí),如何更好地管理企業(yè)現(xiàn)有銷(xiāo)售項(xiàng)目資源成為擺在該類(lèi)企業(yè)面前的重要課題之一。本次打算開(kāi)發(fā)的亞盛汽車(chē)配件銷(xiāo)售業(yè)績(jī)管理系統(tǒng)的開(kāi)發(fā)過(guò)程引用 J2EE平臺(tái)技術(shù),該平臺(tái)中所包含的JDBC、JNDI等組件,規(guī)定訪問(wèn)數(shù)據(jù)庫(kù)的形式。MVC設(shè)計(jì)模式以分層作為基本思想,可降低組件間的耦合性。
亞盛汽車(chē)配件銷(xiāo)售業(yè)績(jī)管理系統(tǒng)服務(wù)于汽車(chē)配件公司業(yè)務(wù),實(shí)現(xiàn)了客戶(hù)管理,主要負(fù)責(zé)對(duì)客戶(hù)相關(guān)數(shù)據(jù)的增刪改查方面、渠道管理,主要對(duì)渠道信息也就是設(shè)備的供應(yīng)商渠道信息進(jìn)行管理、項(xiàng)目管理,主要是一些項(xiàng)目信息的記錄與整理、銷(xiāo)售數(shù)據(jù)管理,主要對(duì)相關(guān)的汽車(chē)配件相關(guān)的銷(xiāo)售記錄作為一個(gè)存檔,方便汽車(chē)配件銷(xiāo)售分析等功能。
此系統(tǒng)面向汽車(chē)配件類(lèi)企業(yè)的銷(xiāo)售項(xiàng)目管理工作,實(shí)際應(yīng)用后有助于管理層掌握下屬機(jī)構(gòu)的銷(xiāo)售數(shù)據(jù)業(yè)績(jī),便于其制定具有前瞻性的銷(xiāo)售計(jì)劃;同時(shí)對(duì)企業(yè)的銷(xiāo)售行為起到規(guī)范作用,確保企業(yè)銷(xiāo)售工作基于本企業(yè)實(shí)際利益開(kāi)展。
研究思路和方法
(1)調(diào)查法:從實(shí)際的系統(tǒng)開(kāi)發(fā)目的出發(fā),結(jié)合系統(tǒng)需求調(diào)研,得出本系統(tǒng)的功能結(jié)構(gòu)模塊。
(2)文獻(xiàn)研究法:通過(guò)大量查閱有關(guān)本系統(tǒng)的相關(guān)技術(shù)書(shū)籍,更詳盡地了解網(wǎng)上有關(guān)系統(tǒng)的現(xiàn)狀及相關(guān)技術(shù)。
(3)經(jīng)驗(yàn)總結(jié)法:經(jīng)過(guò)網(wǎng)絡(luò)搜索、老師指導(dǎo)以及自己的開(kāi)發(fā)經(jīng)驗(yàn)結(jié)合,對(duì)系統(tǒng)開(kāi)發(fā)具體情況,進(jìn)行歸納與分析,使之系統(tǒng)化、理論化。
(4)實(shí)證研究法:自己進(jìn)行大量的編碼測(cè)試,一切從動(dòng)手編碼出發(fā),結(jié)合自己以前的編程基礎(chǔ),實(shí)現(xiàn)系統(tǒng)所需要的功能。
?
package com.controller;import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;import com.annotation.IgnoreAuth;
import com.entity.YonghuxinxiEntity;
import com.service.TokenService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;import com.entity.YonghuxinxiEntity;import com.service.YonghuxinxiService;
import com.utils.PageUtils;
import com.utils.R;/*** 員工信息* 后端接口* @author* @email* @date 2024-02-02
*/
@RestController
@Controller
@RequestMapping("/yonghuxinxi")
public class YonghuxinxiController {private static final Logger logger = LoggerFactory.getLogger(YonghuxinxiController.class);@Autowiredprivate YonghuxinxiService yonghuxinxiService;@Autowiredprivate TokenService tokenService;/*** 登錄*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String role, HttpServletRequest request) {YonghuxinxiEntity user = yonghuxinxiService.selectOne(new EntityWrapper<YonghuxinxiEntity>().eq("account", username));if(user != null){if(!user.getRole().equals(role)){return R.error("權(quán)限不正常");}if(user==null || !user.getPassword().equals(password)) {return R.error("賬號(hào)或密碼不正確");}String token = tokenService.generateToken(user.getId(),user.getName(), "users", user.getRole());return R.ok().put("token", token);}else{return R.error("賬號(hào)或密碼或權(quán)限不對(duì)");}}/*** 注冊(cè)*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody YonghuxinxiEntity user){
// ValidatorUtils.validateEntity(user);if(yonghuxinxiService.selectOne(new EntityWrapper<YonghuxinxiEntity>().eq("username", user.getAccount())) !=null) {return R.error("用戶(hù)已存在");}yonghuxinxiService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 獲取用戶(hù)的session用戶(hù)信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Integer id = (Integer)request.getSession().getAttribute("userId");YonghuxinxiEntity user = yonghuxinxiService.selectById(id);return R.ok().put("data", user);}/*** 密碼重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){YonghuxinxiEntity user = yonghuxinxiService.selectOne(new EntityWrapper<YonghuxinxiEntity>().eq("username", username));if(user==null) {return R.error("賬號(hào)不存在");}user.setPassword("123456");yonghuxinxiService.update(user,null);return R.ok("密碼已重置為:123456");}/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("Controller:"+this.getClass().getName()+",page方法");Object role = request.getSession().getAttribute("role");PageUtils page = null;if(role.equals("員工")){params.put("yh",request.getSession().getAttribute("userId"));page = yonghuxinxiService.queryPage(params);}else{page = yonghuxinxiService.queryPage(params);}return R.ok().put("data", page);}/*** 后端詳情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){logger.debug("Controller:"+this.getClass().getName()+",info方法");YonghuxinxiEntity yonghuxinxi = yonghuxinxiService.selectById(id);if(yonghuxinxi!=null){return R.ok().put("data", yonghuxinxi);}else {return R.error(511,"查不到數(shù)據(jù)");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody YonghuxinxiEntity yonghuxinxi, HttpServletRequest request){logger.debug("Controller:"+this.getClass().getName()+",save");Wrapper<YonghuxinxiEntity> queryWrapper = new EntityWrapper<YonghuxinxiEntity>().eq("name", yonghuxinxi.getName()).in("account",yonghuxinxi.getAccount());logger.info("sql語(yǔ)句:"+queryWrapper.getSqlSegment());YonghuxinxiEntity yonghuxinxiEntity = yonghuxinxiService.selectOne(queryWrapper);if("".equals(yonghuxinxi.getImgPhoto()) || "null".equals(yonghuxinxi.getImgPhoto())){yonghuxinxi.setImgPhoto(null);}yonghuxinxi.setRole("員工");if(yonghuxinxiEntity==null){yonghuxinxiService.insert(yonghuxinxi);return R.ok();}else {return R.error(511,"表中有相同數(shù)據(jù)");}}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody YonghuxinxiEntity yonghuxinxi, HttpServletRequest request){logger.debug("Controller:"+this.getClass().getName()+",update");//根據(jù)字段查詢(xún)是否有相同數(shù)據(jù)Wrapper<YonghuxinxiEntity> queryWrapper = new EntityWrapper<YonghuxinxiEntity>().notIn("id",yonghuxinxi.getId()).in("name",yonghuxinxi.getName()).in("account",yonghuxinxi.getAccount());logger.info("sql語(yǔ)句:"+queryWrapper.getSqlSegment());YonghuxinxiEntity yonghuxinxiEntity = yonghuxinxiService.selectOne(queryWrapper);if("".equals(yonghuxinxi.getImgPhoto()) || "null".equals(yonghuxinxi.getImgPhoto())){yonghuxinxi.setImgPhoto(null);}if(yonghuxinxiEntity==null){yonghuxinxiService.updateById(yonghuxinxi);//根據(jù)id更新return R.ok();}else {return R.error(511,"表中有相同數(shù)據(jù)");}}/*** 刪除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){logger.debug("Controller:"+this.getClass().getName()+",delete");yonghuxinxiService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}