项目描述:
一个完整的农资采购销售系统,系统分为前台会员注册登陆,农资信息浏览,农资详情信息查看,加入购物车,提交订单,付款购买农资等;后台管理员对人员信息的管理,首页图片管理(系统可配置化),农资订单管理,图标统计,农资信息管理
运行环境:
jdk8+tomca8+mysql+IntelliJ IDEA+maven
项目技术:
spring+spring mvc+mybatis+jquery+jquery.easyui.min.js
前端登录:http://localhost:8080/snack/shop/index
后台登录:http://localhost:8080/snack//admin/login/adminLogin
商品参数管理代码:/**
-
Item Controller
*/
@Controller
@RequestMapping("/item")
public class ItemController extends BaseController {
@Autowired
private ItemService itemService;
@Autowired
private ItemCategoryService itemCategoryService;@RequestMapping("/findbysql")
public String findBySql(Model model, Item item) {
String sql = “select * from item where 1=1 and isDelete = 0”;
if (!isEmpty(item.getName())) {
sql += " and name like ‘%" + item.getName() + "%’ “;
}
sql += " order by id”;
Pager itemList = itemService.findBySqlRerturnEntity(sql);
model.addAttribute(“pagers”, itemList);
model.addAttribute(“obj”, item);
return “item/itemList”;
}/**
- 转到添加商品页面
- @param model
- @return
*/
@RequestMapping("/add")
public String addItem(Model model) {
String sql = “select * from item_category where isDelete = 0 and pid is not null order by id”;
Pager pagers = itemCategoryService.findBySqlRerturnEntity(sql);
model.addAttribute(“types”, pagers);
return “item/addItem”;
}
/**
-
执行添加操作
-
@param item
-
@param files CommonsMultipartFile用于文件上传
-
@return
*/
@RequestMapping("/exadd")
public String exaddItem(Item item, @RequestParam(“file”) CommonsMultipartFile[] files, HttpServletRequest request) throws IOException {
itemCommon(item, files, request);
item.setGmNum(0);
item.setIsDelete(0);
item.setScNum(0);
itemService.insert(item);return “redirect:/item/findbysql.action”;
}