📄 goodsoutbusiness.java
字号:
package com.business;
import java.util.HashMap;
import java.util.List;
import com.business.vo.GoodsOut;
import com.dao.util.DaoImp;
import com.web.util.WebTools;
/**
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class GoodsOutBusiness {
public String getGoodsIdById(String id) throws Exception{
try{
String str = "select goodsId from GoodsOut where id = "+id;
DaoImp dao = new DaoImp();
return WebTools.showEx(dao.find(str).get("GOODSID"));
}catch(Exception e){
return "";
}
}
public void add(GoodsOut vo) throws Exception{
try{
String str = "insert into GoodsOut(goodsId,outDate,outNum,clientId) values('"+vo.getGoodsId()+"','"+vo.getOutDate()+"','"+vo.getOutNum()+"','"+vo.getClientId()+"')";
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public void edit(GoodsOut vo) throws Exception{
try{
String str = "update goodsOut set goodsId = '"+vo.getGoodsId()+"',outDate = '"+vo.getOutDate()+"',outNum = '"+vo.getOutNum()+"',clientId = '"+vo.getClientId()+"' where Id = "+vo.getId();
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public void remove(GoodsOut vo) throws Exception{
try{
String str = "delete from GoodsOut where Id = "+vo.getId();
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public HashMap find(String key) throws Exception{
try{
String str = "select * from GoodsOut where Id = "+key+"";
DaoImp dao = new DaoImp();
return dao.find(str);
}catch(Exception e){
return null;
}
}
public String getGoodsMemo(String id) throws Exception{
try{
String result = "";
String str = "select a.*,b.* from GoodsOut a ,goods b where a.goodsid=b.id and a.goodsid = "+id;
DaoImp dao = new DaoImp();
List list = dao.select(str);
result += "<table width=100% border=0 cellpadding=0 cellspacing=0>";
result += "<tr>";
result += "<td class=min-td01>";
result += "出库数量";
result += "</td>";
result += "<td class=min-td01>";
result += "出库日期";
result += "</td>";
result += "<td class=min-td01>";
result += "商品单价";
result += "</td>";
result += "</tr>";
for(int i=0;i<list.size();i++){
HashMap map = (HashMap)list.get(i);
result += "<tr>";
result += "<td class=min-td02>";
result += WebTools.showEx(map.get("OUTNUM"));
result += "</td>";
result += "<td class=min-td02>";
result += WebTools.showEx(map.get("OUTDATE"));
result += "</td>";
result += "<td class=min-td02>";
result += WebTools.showEx(map.get("PRICE"));
result += "</td>";
result += "</tr>";
}
result += "</table>";
return result;
}catch(Exception e){
return "";
}
}
public String getClientMemo(String id) throws Exception{
try{
String result = "";
String str = "select a.*,b.* from GoodsOut a ,goods b where a.goodsid=b.id and a.clientid = "+id;
DaoImp dao = new DaoImp();
List list = dao.select(str);
result += "<table width=100% border=0 cellpadding=0 cellspacing=0>";
result += "<tr>";
result += "<td class=min-td01>";
result += "购买数量";
result += "</td>";
result += "<td class=min-td01>";
result += "购买日期";
result += "</td>";
result += "<td class=min-td01>";
result += "商品单价";
result += "</td>";
result += "</tr>";
for(int i=0;i<list.size();i++){
HashMap map = (HashMap)list.get(i);
result += "<tr>";
result += "<td class=min-td02>";
result += WebTools.showEx(map.get("OUTNUM"));
result += "</td>";
result += "<td class=min-td02>";
result += WebTools.showEx(map.get("OUTDATE"));
result += "</td>";
result += "<td class=min-td02>";
result += WebTools.showEx(map.get("PRICE"));
result += "</td>";
result += "</tr>";
}
result += "</table>";
return result;
}catch(Exception e){
return "";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -