首页>代码>ssm整合easyui实现简单的进销存管理系统(适合新手学习easyui)>/phoneInventory/src/main/java/com/chen/controller/SupplierController.java
package com.chen.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.chen.entity.Page;
import com.chen.entity.Supplier;
import com.chen.service.SupplierService;

/**
 * 供应商管理
 * @author chenguoji
 *
 */
@Controller
@RequestMapping(value="/supplier")
public class SupplierController extends BaseController{

	@Resource
	private SupplierService supplierService;
	
	/**
	 * 插入供应商
	 * @param supplier
	 * @return
	 */
	@RequestMapping(value="/insert")
	@ResponseBody 	//如果返回json格式,需要这个注解
	public Object insert(Supplier supplier) {
		int i = 0;
		try {
			i = supplierService.insert(supplier);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return i;
	}
	
	/**
	 * 根据主键更改供应商的信息
	 * @param supplier
	 * @return
	 */
	@RequestMapping(value="/update")
	@ResponseBody 	//如果返回json格式,需要这个注解
	public Object update(Supplier supplier) {
		int i =0;
		try {
			i = supplierService.update(supplier);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return i;
	}
	
	/**
	 * 删除供应商
	 * @param pks
	 * @return
	 */
	@RequestMapping("/deleteList")
	@ResponseBody //如果返回json格式,需要这个注解,这里用来测试环境
	public Object deleteList(String[] pks){
		int i = 0;
		try {
			i = supplierService.deleteList(pks);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return i;
	}
	
	/**
	 * 查询列表
	 * @param page
	 * @param supplier
	 * @return
	 */
	@RequestMapping("/selectPageUseDyc")
	@ResponseBody //如果返回json格式,需要这个注解,这里用来测试环境
	public Object selectPageDyc(Page<Supplier> page,Supplier supplier){
		page.setParamEntity(supplier);
		Page<Supplier> p = supplierService.selectPageUseDyc(page);
		return p.getPageMap();
	}
	
	/**
	 * 供应商采购统计
	 * @param start
	 * @param end
	 * @return
	 */
	@RequestMapping("/selectsupplier")
	@ResponseBody
	public Object selectSupplier(String start,String end){
		System.out.println("start:"+ start+"||end:"+end);
		Map<String, String> paramMap =new HashMap<String, String>();
		paramMap.put("start", start);
		paramMap.put("end", end);
		return supplierService.selectSupplier(paramMap);
	}

}
最近下载更多
weilaizhisheng  LV21 2024年3月21日
oldfox  LV19 2023年7月28日
cunbie  LV4 2023年6月13日
yeyuuu  LV6 2023年5月18日
微信网友_6481263246938112  LV2 2023年5月18日
2102565387  LV1 2022年12月17日
184445428  LV6 2022年11月28日
计算机暴龙战士  LV19 2022年11月27日
lwp011  LV27 2022年9月19日
13645180698  LV4 2022年8月4日
最近浏览更多
可是不知道么  LV23 3月29日
七梦辞  LV2 2月5日
xiaoaitx  LV8 1月1日
1185595019  LV1 2024年12月2日
yayacui  LV2 2024年10月28日
bluerstar  LV1 2024年10月21日
lz88888  LV12 2024年10月18日
微信网友_7134912998903808  LV15 2024年8月29日
893269222 2024年7月6日
暂无贡献等级
微信网友_5986558820093952  LV4 2024年6月20日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友