原代码
publicActionForwardupdateDetailSave(ActionMappingmapping,ActionFormform,HttpServletRequestrequest,HttpServletResponseresponse)
{
JumboPlatesStockInFormoForm=(JumboPlatesStockInForm)form;
StringpageNo=oForm.getPageNo();
StringpageSize=oForm.getPageSize();
IntegerrecordCount=Integer.parseInt(oForm.getRecordCount());//总共有多少条记录
try
{
jumboPlatesStockInService.updateJumboPlatesStockIn(oForm);
}catch(MPIExceptione)
{
e.printStackTrace();
}catch(Exceptione)
{
e.printStackTrace();
//CommonUtil.remoteAlert(response,"操作失败!\\n"+"异常信息:"+e.getClass()+":"+e.getMessage());
CommonUtil.remoteAlert(response,"提示:操作失败!");
returnnull;
}
Mapmap=null;
try
{
map=jumboPlatesStockInService.findJumboPlatesStockIn(null,null,null,null,null,null,null,oForm.getKeyId(),
null,null,null,null,null,null,null,"1","100",null,null,null,null,null,null,null,null);
}catch(MPIExceptione)
{
e.printStackTrace();
}
recordCount=(Integer)map.get("size");
Listlist=(List)map.get("list");
intnum=recordCount/Integer.parseInt(pageSize);
intpageSum=0;
if(recordCount%Integer.parseInt(pageSize)==0)
{
pageSum=num;
}else
{
pageSum=num+1;
}
request.setAttribute("currentPage",newInteger(pageNo));
request.setAttribute("pageSum",newInteger(pageSum));
request.setAttribute("recordCount",recordCount);
request.setAttribute("JumboPlatesStockInForm",oForm);
request.setAttribute("jumboPlatesStockInList",list);
returnmapping.findForward("jumboPlatesStockIn");
}
更改后
publicActionForwardupdateDetailSave(ActionMappingmapping,ActionFormform,HttpServletRequestrequest,HttpServletResponseresponse)
{
JumboPlatesStockInFormoForm=(JumboPlatesStockInForm)form;
StringpageNo=oForm.getPageNo();
StringpageSize=oForm.getPageSize();
//Stringdate=oForm.getJumboPlatesStockInDate();
IntegerrecordCount=Integer.parseInt(oForm.getRecordCount());//总共有多少条记录
SimpleDateFormatsdf=newSimpleDateFormat("yyyy-MM-dd");
StringnowDate=sdf.format(newDate());
//当前年月
StringnowYear=nowDate.substring(0,4);
StringnowMounth=nowDate.substring(5,7);
ListreturnList=newArrayList();
booleanflag=false;
try
{
Stringdate=oForm.getJumboPlatesStockInDate();
//补片单年月
Stringyear=date.substring(0,4);
Stringmounth=date.substring(5,7);
if(!nowYear.equals(year)||!nowMounth.equals(mounth))//补片时间和当前时间不是同月
{
returnList.add("警告:入库时间已跨月,不能修改");
}else{
flag=true;
}
try
{
jumboPlatesStockInService.updateJumboPlatesStockIn(oForm);
}catch(MPIExceptione)
{
e.printStackTrace();
}catch(Exceptione)
{
e.printStackTrace();
//CommonUtil.remoteAlert(response,"操作失败!\\n"+"异常信息:"+e.getClass()+":"+e.getMessage());
CommonUtil.remoteAlert(response,"提示:操作失败!");
returnnull;
}
Mapmap=null;
try
{
map=jumboPlatesStockInService.findJumboPlatesStockIn(null,null,null,null,null,null,null,oForm.getKeyId(),
null,null,null,null,null,null,null,"1","100",null,null,null,null,null,null,null,null);
}catch(MPIExceptione)
{
e.printStackTrace();
}
recordCount=(Integer)map.get("size");
Listlist=(List)map.get("list");
intnum=recordCount/Integer.parseInt(pageSize);
intpageSum=0;
if(recordCount%Integer.parseInt(pageSize)==0)
{
pageSum=num;
}else
{
pageSum=num+1;
}
request.setAttribute("currentPage",newInteger(pageNo));
request.setAttribute("pageSum",newInteger(pageSum));
request.setAttribute("recordCount",recordCount);
request.setAttribute("JumboPlatesStockInForm",oForm);
request.setAttribute("jumboPlatesStockInList",list);
returnmapping.findForward("jumboPlatesStockIn");
}
之后会报错
分 -->
|