📄 queryinformationmanagementaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package cn.bway.foreigntrade.information.action;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import cn.bway.common.BwayHibernateException;
import cn.bway.common.WebConstant;
import cn.bway.common.action.BaseAction;
import cn.bway.common.code.codeDao;
import cn.bway.common.vo.PageListVO;
import cn.bway.common.vo.QueryVO;
import cn.bway.foreigntrade.auditmanagement.audittable.form.AudittableForm;
import cn.bway.foreigntrade.information.form.InformationForm;
import cn.bway.foreigntrade.information.impl.InformationManagerFactory;
import cn.bway.foreigntrade.order.exportclient.form.ExportclientForm;
import cn.bway.foreigntrade.order.exportclient.impl.ExportclientManagerFactory;
import cn.bway.foreigntrade.order.exportclient.model.Exportclient;
import cn.bway.foreigntrade.order.exportproduct.impl.ExportproductManagerFactory;
import cn.bway.foreigntrade.order.producenote.impl.ProducenoteManagerFactory;
import cn.bway.foreigntrade.order.producenote.model.Producenote;
import cn.bway.foreigntrade.order.produceproduct.impl.ProduceproductManagerFactory;
import cn.bway.foreigntrade.order.produceproduct.model.Produceproduct;
import cn.bway.foreigntrade.reperstory.product.impl.ProductManagerFactory;
import cn.bway.foreigntrade.reperstory.product.model.Product;
import cn.bway.foreigntrade.repertory.buyproduct.impl.BuyproductManagerFactory;
import cn.bway.foreigntrade.repertory.outstore.document.impl.OutstoredocumentManagerFactory;
/**
* MyEclipse Struts
* Creation date: 03-17-2008
*
* XDoclet definition:
* @struts.action path="/queryInformationmanagement" name="informationForm" scope="request" validate="true"
*/
public class QueryInformationmanagementAction extends BaseAction {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) { InformationForm eForm=new InformationForm();
eForm = (InformationForm) form;// TODO Auto-generated method stub
String returnStr = WebConstant.FORWARD_INITPAGE;
String mername = null;
PageListVO rvo = null;
try {
String tablename=request.getParameter("tablename");
String inforid=request.getParameter("inforid");
String inforcontent=request.getParameter("inforcontent");
request.setAttribute("inforid", inforid);//返回form及ListResult数据集
request.setAttribute("inforcontent", inforcontent);//返回form及ListResult数据集
System.out.println(inforid+"-----------------"+inforcontent);
System.out.println();
List document=new ArrayList();
List product=new ArrayList();
if("Exportclient".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Exportproduct", "*", "id", Integer.parseInt(inforid));
}
if("Guestorder".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Orderproduct", "*", "id", Integer.parseInt(inforid));
}
if("Producenote".equals(tablename)){
String isaudit=request.getParameter("isaudit");
if("1".equals(isaudit)){
Product productmanager=new Product();
//得到生产单
Producenote docu=(Producenote) ProducenoteManagerFactory.getProducenoteManager().getProducenote(inforid);
//得到生产单产品
rvo=(PageListVO)ProduceproductManagerFactory.getProduceproductManager().getAllProducenoteproduct(inforid);
ArrayList produ = (ArrayList) rvo.getretVO();
for(int i=0;i<produ.size();i++){
Produceproduct produceproduct=(Produceproduct) produ.get(i);
// 判断库存是否存在该产品
rvo=(PageListVO) ProductManagerFactory.getProductManager().queryProduct("成品仓库",produceproduct.getProductcode());
ArrayList ListResult= (ArrayList) rvo.getretVO();
if(ListResult.size()>0){//如果存在
for(int y=0;y<ListResult.size();y++){
productmanager=(Product) ListResult.get(y);
Integer pr=Integer.parseInt(productmanager.getNumbers());
System.out.println(pr+"---------------存在的数量");
Integer str=Integer.parseInt(produceproduct.getTotals());
// 判断库存是否大于5
// if(pr<=5){
// rvo=(PageListVO) ProductManagerFactory.getProductManager().queryProduct("成品仓库",produceproduct.getProductcode());
// productcode= (ArrayList) rvo.getretVO();
// }
productmanager.setNumbers(""+(pr-str));
ProductManagerFactory.getProductManager().modfilyProduct(productmanager);
}
// request.setAttribute("productcode",productcode);
}else{
return null;
}
}
rvo=(PageListVO) ProductManagerFactory.getProductManager().findAllProduct();
ArrayList productcode= (ArrayList) rvo.getretVO();
if(productcode.size()>0){
request.setAttribute("productcode",productcode);
}
// request.setAttribute("productcode",productcode);
request.setAttribute("docu", docu);
request.setAttribute("produ",produ);
}
//显示单据与产品
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Produceproduct", "*", "orderid", Integer.parseInt(inforid));
//request.removeAttribute("incaseid");
request.setAttribute("isaudit",isaudit);
System.out.println(isaudit+"--------isaudit------");
request.setAttribute("incasegetid",inforid);
}
if("Buydocument".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Buyproduct", "*", "Buydocumentid", Integer.parseInt(inforid));
}
if("Instoredocument".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Instoreproduct", "*", "documentid", Integer.parseInt(inforid));
}
if("Outstoredocument".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Outstoreproduct", "*", "documentid", Integer.parseInt(inforid));
}
// if("Producenote".equals(tablename)){
// document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
// product=new codeDao().getColumeList("Produceproduct", "*", "id", Integer.parseInt(inforid));
// }
if("Incasementdocument".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Incasementproduct", "*", "documentid", Integer.parseInt(inforid));
System.out.println(inforid+"========inforid=========inforcontent===="+inforcontent);
request.setAttribute("incaseid",inforid);
request.setAttribute("inforcontent",inforcontent);
}
if("Sampledocument".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Sampleproduct", "*", "documentid", Integer.parseInt(inforid));
}
if("Canceldocument".equals(tablename)){
document=new codeDao().getColumeList(tablename, "*", "id", Integer.parseInt(inforid));
product=new codeDao().getColumeList("Cancelproduct", "*", "documentid", Integer.parseInt(inforid));
}
request.setAttribute("document", document);//返回form及ListResult数据集
request.setAttribute("product", product);//返回form及ListResult数据集
} catch (Exception e) {
e.printStackTrace();
return mapping.findForward(WebConstant.FORWARD_FAIL);
}
return mapping.findForward(returnStr);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -