📄 warehouseinfo.java
字号:
package com.saas.biz.wareHouseMgr;
import java.util.*;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.repositoryDAO.RepositoryExt;
import com.saas.biz.dao.storeformInDAO.StoreformInExt;
import com.saas.biz.dao.wareHouseDAO.WareHouseDAO;
import com.saas.biz.dao.wareHouseDAO.WareHouseExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
public class wareHouseInfo {
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public wareHouseInfo()
{
log = new Logger(this);
tradeQuery = new Dbtable();
}
public void setTradeQuery(Dbtable tradeQuery)
{
this.tradeQuery = tradeQuery;
}
public Dbtable getTradeQuery()
{
return this.tradeQuery;
}
public void setOutBuffer(Buffers outBuffer)
{
this.outBuffer = outBuffer;
}
public Buffers getOutBuffer()
{
return this.outBuffer;
}
public ArrayList getQueryResult()
{
return this.queryResult;
}
public void setQueryResult(ArrayList queryResult)
{
this.queryResult = queryResult;
}
public void addWareHouseInfo(Buffers inbuffer)
{
log.LOG_INFO("进入addWareHouseInfo方法...");
this.outBuffer = inbuffer;
String cust_id =inbuffer.getString("SESSION_CUST_ID");
String own_id=inbuffer.getString("SESSION_CUST_ID");
String house_id=inbuffer.getString("HOUSE_ID");
String house_name=inbuffer.getString("HOUSE_NAME");
String house_no=inbuffer.getString("HOUSE_NO");
String province=inbuffer.getString("PROVINCE");
String eparchy_code=inbuffer.getString("EPARCHY_CODE");
String city_code=inbuffer.getString("CITY_CODE");
String last_pos =inbuffer.getString("LAST_POS");
String area_no=inbuffer.getString("AREA_NO");
String capacity=inbuffer.getString("CAPACITY");
String max_capacity=inbuffer.getString("MAX_CAPACITY");
String pos_num=inbuffer.getString("POS_NUM");
String house_type=inbuffer.getString("HOUSE_TYPE");
String state_code=inbuffer.getString("STATE_CODE");
String user_id=inbuffer.getString("SESSION_USER_ID");
String remark=inbuffer.getString("REMARK");
int iResult=-1 ;
try
{
iResult=addWareHouseInfo(cust_id,own_id,house_id,house_name,house_no,province,eparchy_code,city_code,last_pos,area_no,capacity,max_capacity,pos_num,house_type,state_code,user_id,remark);
}
catch(SaasApplicationException e)
{
log.LOG_INFO(e.getMessage());
}
if (iResult != 0)
{
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
}
else
{
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出addWareHouseInfo方法...");
}
public int addWareHouseInfo(String cust_id,String own_id,String house_id,String house_name,String house_no,String province,String eparchy_code,String city_code,String last_pos,String area_no,String capacity,String max_capacity,String pos_num,String house_type,String state_code,String user_id,String remark) throws SaasApplicationException
{
WareHouseExt wareHouseExt = new WareHouseExt();
wareHouseExt.setParam(":VCUST_ID", cust_id);
wareHouseExt.setParam(":VOWN_ID", own_id);
wareHouseExt.setParam(":VHOUSE_ID", house_id);
wareHouseExt.setParam(":VHOUSE_NAME", house_name);
wareHouseExt.setParam(":VHOUSE_NO", house_no);
wareHouseExt.setParam(":VPROVINCE", province);
wareHouseExt.setParam(":VEPARCHY_CODE", eparchy_code);
wareHouseExt.setParam(":VCITY_CODE", city_code);
wareHouseExt.setParam(":VLAST_POS", last_pos);
wareHouseExt.setParam(":VAREA_NO", area_no);
wareHouseExt.setParam(":VCAPACITY", capacity);
wareHouseExt.setParam(":VMAX_CAPACITY", max_capacity);
wareHouseExt.setParam(":VPOS_NUM", pos_num);
wareHouseExt.setParam(":VHOUSE_TYPE", house_type);
wareHouseExt.setParam(":VSTATE_CODE", state_code);
wareHouseExt.setParam(":VUSER_ID", user_id);
wareHouseExt.setParam(":VREMARK", remark);
tradeQuery.executeBy(wareHouseExt.insBy("INS_BY_ALL_AREA_HOUSE"));
return 0;
}
//修改仓库
public void updateWareHouse(Buffers inbuffer)
{
log.LOG_INFO("进入updateWareHouse方法...");
this.outBuffer = inbuffer;
String cust_id =inbuffer.getString("SESSION_CUST_ID");
String house_id=inbuffer.getString("HOUSE_ID");
String house_name=inbuffer.getString("HOUSE_NAME");
String house_no=inbuffer.getString("HOUSE_NO");
String province=inbuffer.getString("PROVINCE");
String eparchy_code=inbuffer.getString("EPARCHY_CODE");
String city_code=inbuffer.getString("CITY_CODE");
String last_pos =inbuffer.getString("LAST_POS");
String area_no=inbuffer.getString("AREA_NO");
String capacity=inbuffer.getString("CAPACITY");
String max_capacity=inbuffer.getString("MAX_CAPACITY");
String pos_num=inbuffer.getString("POS_NUM");
String house_type=inbuffer.getString("HOUSE_TYPE");
String remark=inbuffer.getString("REMARK");
int iResult=-1 ;
try
{
iResult=updateWareHouse(cust_id,house_id,house_name,house_no,province,eparchy_code,city_code,last_pos,area_no,capacity,max_capacity,pos_num,house_type,remark);
}
catch(SaasApplicationException e)
{
log.LOG_INFO(e.getMessage());
}
if (iResult != 0)
{
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
}
else
{
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出updateWareHouse方法...");
}
public int updateWareHouse(String cust_id,String house_id,String house_name,String house_no,String province,String eparchy_code,String city_code,String last_pos,String area_no,String capacity,String max_capacity,String pos_num,String house_type,String remark) throws SaasApplicationException
{
WareHouseExt wareHouseExt = new WareHouseExt();
wareHouseExt.setParam(":VCUST_ID", cust_id);
wareHouseExt.setParam(":VHOUSE_ID", house_id);
wareHouseExt.setParam(":VHOUSE_NAME", house_name);
wareHouseExt.setParam(":VHOUSE_NO", house_no);
wareHouseExt.setParam(":VPROVINCE", province);
wareHouseExt.setParam(":VEPARCHY_CODE", eparchy_code);
wareHouseExt.setParam(":VCITY_CODE", city_code);
wareHouseExt.setParam(":VLAST_POS", last_pos);
wareHouseExt.setParam(":VAREA_NO", area_no);
wareHouseExt.setParam(":VCAPACITY", capacity);
wareHouseExt.setParam(":VMAX_CAPACITY", max_capacity);
wareHouseExt.setParam(":VPOS_NUM", pos_num);
wareHouseExt.setParam(":VHOUSE_TYPE", house_type);
wareHouseExt.setParam(":VREMARK", remark);
tradeQuery.executeBy(wareHouseExt.insBy("UPDATE_AREA_HOUSE"));
return 0;
}
public ArrayList getAllWareHouseByCustId(String cust_id,int iStart) throws SaasApplicationException
{
ArrayList list = new ArrayList();
WareHouseExt wareHouseExt = new WareHouseExt();
try {
iStart = iStart*20;
wareHouseExt.setParam(":VCUST_ID",cust_id);
list = wareHouseExt.selByList("SEL_ALL_BY_CUST_ID",iStart, 20);
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
public int getAllWareHouseByCustId(String cust_id) throws SaasApplicationException
{
int count=0;
ArrayList list = new ArrayList();
WareHouseExt wareHouseExt = new WareHouseExt();
try {
wareHouseExt.setParam(":VCUST_ID",cust_id);
list = wareHouseExt.selByList("SEL_ALL_BY_CUST_ID");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
if(list != null && list.size()>0){
count = list.size();
}
return count;
}
public ArrayList getOneWareHouse(String cust_id,String house_id) throws SaasApplicationException
{
ArrayList list = new ArrayList();
WareHouseExt wareHouseExt = new WareHouseExt();
try {
wareHouseExt.setParam(":VCUST_ID",cust_id);
wareHouseExt.setParam(":VHOUSE_ID",house_id);
list = wareHouseExt.selByList("SEL_ONE_WAREHOUSE");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
public int getOneWareHousePosNum(String cust_id,String house_id) throws SaasApplicationException
{
ArrayList list = new ArrayList();
WareHouseExt wareHouseExt = new WareHouseExt();
try {
wareHouseExt.setParam(":VCUST_ID",cust_id);
wareHouseExt.setParam(":VHOUSE_ID",house_id);
list = wareHouseExt.selByList("SEL_ONE_WAREHOUSE");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
HashMap map = new HashMap();
String pos_num = "";
int pos_num_value = 0;
if(list!=null && list.size()>0){
map = (HashMap)list.get(0);
pos_num = map.get("pos_num").toString();
}
pos_num_value = Integer.parseInt(pos_num);
return pos_num_value;
}
public void delWareHouse(Buffers inbuffer) {
log.LOG_INFO("进入delWareHouse方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
int iResult = -1;
try {
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String house_id = inbuffer.getString("HOUSE_ID");
iResult = delWareHouse(cust_id,house_id);
}
catch (Exception e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
}
else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出delWareHouse方法...");
}
public int delWareHouse(String cust_id, String house_id) throws SaasApplicationException {
WareHouseExt wareHouseExt = new WareHouseExt();
wareHouseExt.setParam(":VCUST_ID", cust_id);
wareHouseExt.setParam(":VHOUSE_ID", house_id);
tradeQuery.executeBy(wareHouseExt.insBy("DEL_WAREHOUSE_BY_HOUSE_ID"));
return 0;
}
public String getHouseNameById(String cust_id, String house_id) throws SaasApplicationException {
WareHouseExt wareHouseExt = new WareHouseExt();
ArrayList list = new ArrayList();
wareHouseExt.setParam(":VCUST_ID", cust_id);
wareHouseExt.setParam(":VHOUSE_ID", house_id);
list = wareHouseExt.selByList("SEL_ONE_WAREHOUSE");
String house_name="";
if(list!=null&&list.size()>0){
HashMap map = (HashMap)list.get(0);
if(map.get("house_name")!=null){
house_name = map.get("house_name").toString();
}
}
return house_name;
}
public String getSelectHouse(String cust_id) throws SaasApplicationException
{
ArrayList list = new ArrayList();
WareHouseExt wareHouseExt = new WareHouseExt();
HashMap map = new HashMap();
try {
wareHouseExt.setParam(":VCUST_ID",cust_id);
list = wareHouseExt.selByList("SEL_ALL_BY_CUST_ID");
}
catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
log.LOG_INFO("===============================");
String house_id="",house_name="",str="";
if(list!=null&&list.size()>0){
for (int i = 0; i < list.size(); i++) {
map = (HashMap)list.get(i);
house_id=map.get("house_id").toString();
house_name=map.get("house_name").toString();
log.LOG_INFO("========"+house_id+"============"+house_name+"==============");
str=str+"<option value="+house_id+">"+house_name+"</option>";
}
}
return str;
}
public ArrayList getWareHouseById(String cust_id) throws SaasApplicationException {
ArrayList relationList = new ArrayList();
WareHouseExt relaExt = new WareHouseExt();
relaExt.setParam(":VCUST_ID", cust_id);
relationList = relaExt.selByList("SEL_WH_BY_ID");
return relationList;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -