package cn.trace.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import cn.trace.common.Constants;
import cn.trace.pojo.Brand;
import cn.trace.pojo.Product;
import cn.trace.pojo.ProducterUser;
import cn.trace.service.brand.BrandService;
import cn.trace.service.product.ProductService;
@Controller
@Scope("prototype")
public class ProducterController {
@Resource
private BrandService brandService;
@Resource
private ProductService productService;
private Logger logger = Logger.getLogger(ProducterController.class);
@RequestMapping(value="brand.html",method={RequestMethod.POST,RequestMethod.GET})
public ModelAndView getBrandList(HttpSession session,HttpServletRequest request,HttpServletResponse response){
int num = 1;
int size = 5;
String pageNum = request.getParameter("pageNum");
String pageSize = request.getParameter("pageSize");
if(pageNum!=null&&!"".equals(pageNum)){
num = Integer.parseInt(pageNum);
}
if(pageSize!=null&&!"".equals(pageSize)){
size = Integer.parseInt(pageSize);
}
PageHelper.startPage(num, size);
String str = "id.desc";
Order.formString(str);
Brand brand = new Brand();
//从登陆用户session中获取公司编号
logger.debug("===========================");
ProducterUser producterUser = (ProducterUser)session.getAttribute("producterUserSession");
logger.debug("========================//从登陆用户session中获取公司编号"+producterUser);
brand.setPronumber(producterUser.getPronumber());
List<Brand> brandList = null;
try {
brandList = brandService.getBrandList(brand);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (Brand brand1 : brandList) {
logger.debug("======================================getBrandList brand是否查到数据"+brand1.getBrandname());
}
ModelAndView model =new ModelAndView();
PageInfo<Brand> pageinfo= new PageInfo<Brand>(brandList);
model.addObject(pageinfo);
model.setViewName("company/brandlist");
return model;
}
@RequestMapping(value="brandcheck.html",method={RequestMethod.POST,RequestMethod.GET})
public ModelAndView BrandCheck(HttpSession session,HttpServletRequest request,HttpServletResponse response,Model model){
String brandnum = request.getParameter("brandnum");
logger.debug("======================================= BrandCheck+request.getParameter brand"+brandnum);
Brand brand = new Brand();
try {
int a = Integer.parseInt(brandnum);
brand.setBrandnum(a);
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
logger.debug("======================================= BrandCheck+Integer.getInteger brand"+brand.getBrandnum());
Brand brand2 = new Brand();
try {
brand2 = brandService.getBrand(brand);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model.addAttribute("brand2", brand2);
logger.debug("=============================================================+brandcheck"+brand2.getBranddes());
return new ModelAndView("company/brandcheck");
}
@RequestMapping(value="brandUpdate.html",method={RequestMethod.POST,RequestMethod.GET})
public ModelAndView BrandUpdate(HttpSession session,HttpServletRequest request,HttpServletResponse response,Model model){
String brandnum = request.getParameter("brandnum");
Brand brand = new Brand();
try {
int a = Integer.parseInt(brandnum);
brand.setBrandnum(a);
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
logger.debug("======================================= BrandUpdate brand"+brand.getBrandnum());
Brand brand2 = new Brand();
try {
brand2 = brandService.getBrand(brand);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
model.addAttribute("brand2", brand2);
logger.debug("=============================================================+BrandUpdate"+brand2.getBranddes());
return new ModelAndView("company/brandUpdate");
}
@RequestMapping(value="brandUpdate",method={RequestMethod.POST,RequestMethod.GET})
public String BrandUpdate(HttpSession session,HttpServletRequest request,HttpServletResponse response){
logger.debug("===============提交表单了");
String brandname = request.getParameter("brandname");
String branddes = request.getParameter("branddes");
String a = request.getParameter("brandnum");
int b = Integer.parseInt(a);
logger.debug("uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuupdatebranddes"+branddes);
Brand brand = new Brand();
brand.setBrandname(brandname);
brand.setBranddes(branddes);
brand.setBrandnum(b);
try {
brandService.updateBrand(brand);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "company/comindex";
}
@RequestMapping(value="addbrand",method={RequestMethod.POST,RequestMethod.GET})
public String AddBrand(HttpSession session,HttpServletRequest request,HttpServletResponse response){
String brandname = request.getParameter("brandname");
String branddes = request.getParameter("branddes");
Brand brand = new Brand();
brand.setBrandname(brandname);
brand.setBranddes(branddes);
ProducterUser producterUser = (ProducterUser)session.getAttribute("producterUserSession");
logger.debug("========================//从登陆用户session中获取公司编号"+producterUser);
brand.setPronumber(producterUser.getPronumber());
try {
brandService.addBrand(brand);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "company/comindex";
}
@RequestMapping(value="delbrand.html",method={RequestMethod.POST,RequestMethod.GET})
public ModelAndView DelBrand(HttpSession session,HttpServletRequest request,HttpServletResponse response){
String brandnum = request.getParameter("brandnum");
int a = Integer.parseInt(brandnum);
Brand brand3 = new Brand();
brand3.setBrandnum(a);
try {
brandService.delBrand(brand3);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int num = 1;
int size = 5;
String pageNum = request.getParameter("pageNum");
String pageSize = request.getParameter("pageSize");
if(pageNum!=null&&!"".equals(pageNum)){
num = Integer.parseInt(pageNum);
}
if(pageSize!=null&&!"".equals(pageSize)){
size = Integer.parseInt(pageSize);
}
PageHelper.startPage(num, size);
String str = "id.desc";
Order.formString(str);
Brand brand = new Brand();
//从登陆用户session中获取公司编号
logger.debug("===========================");
ProducterUser producterUser = (ProducterUser)session.getAttribute("producterUserSession");
logger.debug("========================//从登陆用户session中获取公司编号"+producterUser);
brand.setPronumber(producterUser.getPronumber());
List<Brand> brandList = null;
try {
brandList = brandService.getBrandList(brand);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (Brand brand1 : brandList) {
logger.debug("=================
没有合适的资源?快使用搜索试试~ 我知道了~
农产品溯源信息管理系统系统源代码
共326个文件
java:52个
class:52个
png:43个
5星 · 超过95%的资源 需积分: 49 175 下载量 89 浏览量
2018-08-01
17:21:05
上传
评论 24
收藏 20.07MB ZIP 举报
温馨提示
农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码农产品溯源信息管理系统系统源代码
资源推荐
资源详情
资源评论
收起资源包目录
农产品溯源信息管理系统系统源代码 (326个子文件)
ProducterController.class 11KB
TraceController.class 8KB
ComController.class 7KB
PageController.class 4KB
LoginController.class 3KB
GovLoginController.class 3KB
PageSupport.class 3KB
BrandServiceImpl.class 2KB
Product.class 2KB
CheckDaily.class 2KB
ProductServiceImpl.class 2KB
Brand.class 2KB
BatchServiceImpl.class 2KB
OpareaServiceImpl.class 2KB
Dealer.class 2KB
ProducterUser.class 2KB
ProducterUserServiceImpl.class 1KB
DealerServiceImpl.class 1KB
Batch.class 1KB
Goverment.class 1KB
Oparea.class 1KB
Optype.class 1KB
OptypeServiceImpl.class 1KB
CheckDailyServiceImpl.class 979B
GovermentServiceImpl.class 874B
BrandService.class 799B
BrandMapper.class 793B
CheckDailyMapper.class 583B
ProductService.class 547B
ProductMapper.class 541B
DealerService.class 533B
OpareaService.class 533B
DealerMapper.class 527B
OpareaMapper.class 527B
BatchService.class 519B
BatchMapper.class 513B
Constants.class 445B
OptypeService.class 377B
OptypeMapper.class 371B
CheckDailyService.class 361B
BatchLandServiceImpl.class 339B
GovermentController.class 322B
CustomerController.class 319B
ProducterUserService.class 291B
ProducterUserMapper.class 287B
MarkProduct.class 286B
Producter.class 280B
BatchLand.class 280B
Operation.class 280B
GovermentService.class 266B
GovermentMapper.class 260B
BatchLandService.class 140B
.classpath 3KB
org.eclipse.wst.common.component 523B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap.min.css 120KB
swiper-3.4.2.min.css 17KB
page1.css 16KB
homepagePC.css 14KB
style.css 14KB
govlogin.css 11KB
login.css 11KB
css.css 11KB
base.css 10KB
helpBuy.css 10KB
common.css 9KB
brand.css 5KB
public.css 4KB
component.css 2KB
jquery.selectlist.css 2KB
page.css 2KB
manhuaDate.1.0.css 1KB
jHsDate.css 1KB
brandmain.css 880B
hack.css 814B
reset.css 653B
print.css 133B
haiersoft.css 88B
MyHtml.html 417B
MyHtml.html 417B
aspectjweaver-1.6.9.jar 1.59MB
spring-core-3.2.3.RELEASE.jar 847KB
spring-context-3.2.3.RELEASE.jar 843KB
mybatis-3.2.2.jar 683KB
spring-webmvc-3.2.3.RELEASE.jar 622KB
spring-web-3.2.3.RELEASE.jar 611KB
spring-beans-3.2.3.RELEASE.jar 593KB
commons-collections-3.2.1.jar 562KB
mysql-connector-java-5.1.0-bin.jar 553KB
log4j-1.2.16.jar 470KB
jstl-1.2.jar 405KB
spring-jdbc-3.2.3.RELEASE.jar 396KB
spring-aop-3.2.3.RELEASE.jar 328KB
commons-lang-2.6.jar 278KB
jsqlparser-0.9.1.jar 246KB
spring-tx-3.2.3.RELEASE.jar 237KB
commons-beanutils-1.8.3.jar 227KB
spring-expression-3.2.3.RELEASE.jar 191KB
json-lib-2.4-jdk15.jar 155KB
jedis-2.1.0.jar 136KB
共 326 条
- 1
- 2
- 3
- 4
资源评论
SmileFlyInSky
- 粉丝: 8
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功