📄 storeformininfo.java
字号:
package com.saas.biz.storeformInMgr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import com.saas.biz.dao.storeformInDAO.StoreformInExt;
import com.saas.sys.buffer.Buffers;
import com.saas.sys.dbm.Dbtable;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import com.saas.biz.commen.commMethodMgr;
import com.saas.biz.dao.storeformInDAO.*;
public class StoreformInInfo {
Dbtable tradeQuery;
Logger log;
Buffers inBuffer;
Buffers outBuffer;
ArrayList queryResult = new ArrayList();
public StoreformInInfo() {
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 addStoreformIn(Buffers inbuffer) {
log.LOG_INFO("进入addStoreformIn方法...");
this.outBuffer = inbuffer;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String form_id = inbuffer.getString("FORM_ID");
String quo_id = inbuffer.getString("QUO_ID");
String link_quo_id = inbuffer.getString("LINK_QUO_ID");
String quo_name = inbuffer.getString("QUO_NAME");
String quo_no = inbuffer.getString("QUO_NO");
String quo_num = inbuffer.getString("QUO_NUM");
String goods_id = inbuffer.getString("GOODS_ID");
String goods_name = inbuffer.getString("GOODS_NAME");
String goods_desc = inbuffer.getString("GOODS_DESC");
String goods_no = inbuffer.getString("GOODS_NO");
String store_no = inbuffer.getString("STORE_NO");
String goods_type = inbuffer.getString("GOODS_TYPE");
String in_reason = inbuffer.getString("IN_REASON");
String store_type = inbuffer.getString("STORE_TYPE");
String fix_tag = inbuffer.getString("FIX_TAG");
String obj_cust = inbuffer.getString("OBJ_CUST");
String src = inbuffer.getString("SRC");
// log.LOG_INFO("===========================================");
String start_date = inbuffer.getString("START_DATE");
String end_date = inbuffer.getString("END_DATE");
String meas_unit = inbuffer.getString("MEAS_UNIT");
String per_unit_num = inbuffer.getString("PER_UNIT_NUM");
String pack_unit = inbuffer.getString("PACK_UNIT");
String lenght = inbuffer.getString("LENGHT");
String width = inbuffer.getString("WIDTH");
String height = inbuffer.getString("HEIGHT");
String volume = inbuffer.getString("VOLUME");
String weight = inbuffer.getString("WEIGHT");
String capacity = inbuffer.getString("CAPACITY");
String ship_type = inbuffer.getString("SHIP_TYPE");
String ship_date = inbuffer.getString("SHIP_DATE");
String oper_user_id = inbuffer.getString("SESSION_USER_ID");
String in_date = inbuffer.getString("IN_DATE");
String remark2 = inbuffer.getString("REMARK2");
// log.LOG_INFO("=================================================");
int iResult = -1;
int i = checkGoods(cust_id, goods_id);
try {
if (i == 0) {
iResult = insertStoreformIn(cust_id, form_id, quo_id, link_quo_id, quo_name, quo_no, quo_num, goods_id, goods_name, goods_desc, goods_no, store_no, goods_type, in_reason, store_type, fix_tag, obj_cust, src, start_date, end_date, meas_unit, per_unit_num, pack_unit, lenght, width, height, volume, weight, capacity, ship_type, ship_date, oper_user_id, in_date, remark2);
}
else {
iResult = updateStoreformIn(cust_id, goods_id, quo_num);
}
}
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("退出addStoreformIn方法...");
}
public int insertStoreformIn(String cust_id, String form_id, String quo_id, String link_quo_id, String quo_name, String quo_no, String quo_num, String goods_id, String goods_name, String goods_desc, String goods_no, String store_no, String goods_type, String in_reason, String store_type, String fix_tag, String obj_cust, String src, String start_date, String end_date, String meas_unit, String per_unit_num, String pack_unit, String lenght, String width, String height, String volume, String weight, String capacity, String ship_type, String ship_date, String oper_user_id, String in_date, String remark2) throws SaasApplicationException {
StoreformInExt storeformInExt = new StoreformInExt();
storeformInExt.setParam(":VCUST_ID", cust_id);
storeformInExt.setParam(":VFORM_ID", form_id);
storeformInExt.setParam(":VQUO_ID", quo_id);
storeformInExt.setParam(":VLINK_QUO_ID", link_quo_id);
storeformInExt.setParam(":VQUO_NAME", quo_name);
storeformInExt.setParam(":VQUO_NO", quo_no);
storeformInExt.setParam(":VQUO_NUM", quo_num);
storeformInExt.setParam(":VGOODS_ID", goods_id);
storeformInExt.setParam(":VGOODS_NAME", goods_name);
storeformInExt.setParam(":VGOODS_DESC", goods_desc);
storeformInExt.setParam(":VGOODS_NO", goods_no);
storeformInExt.setParam(":VSTORE_NO", store_no);
storeformInExt.setParam(":VGOODS_TYPE", goods_type);
storeformInExt.setParam(":VIN_REASON", in_reason);
storeformInExt.setParam(":VSTORE_TYPE", store_type);
storeformInExt.setParam(":VFIX_TAG", fix_tag);
storeformInExt.setParam(":VOBJ_CUST", obj_cust);
storeformInExt.setParam(":VSRC", src);
storeformInExt.setParam(":VSTART_DATE", start_date);
storeformInExt.setParam(":VEND_DATE", end_date);
storeformInExt.setParam(":VMEAS_UNIT", meas_unit);
storeformInExt.setParam(":VPER_UNIT_NUM", per_unit_num);
storeformInExt.setParam(":VPACK_UNIT", pack_unit);
storeformInExt.setParam(":VLENGHT", lenght);
storeformInExt.setParam(":VWIDTH", width);
storeformInExt.setParam(":VHEIGHT", height);
storeformInExt.setParam(":VVOLUME", volume);
storeformInExt.setParam(":VWEIGHT", weight);
storeformInExt.setParam(":VCAPACITY", capacity);
storeformInExt.setParam(":VSHIP_TYPE", ship_type);
storeformInExt.setParam(":VSHIP_DATE", ship_date);
storeformInExt.setParam(":VOPER_USER_ID", oper_user_id);
storeformInExt.setParam(":VIN_DATE", in_date);
storeformInExt.setParam(":VREMARK2", remark2);
tradeQuery.executeBy(storeformInExt.insBy("INS_STOREFORM_IN_ALL"));
return 0;
}
public int updateStoreformIn(String cust_id, String goods_id, String quo_num) throws SaasApplicationException {
StoreformInExt storeformInExt = new StoreformInExt();
storeformInExt.setParam(":VCUST_ID", cust_id);
storeformInExt.setParam(":VGOODS_ID", goods_id);
storeformInExt.setParam(":VQUO_NUM", quo_num);
tradeQuery.executeBy(storeformInExt.insBy("UPDATE_STOREFORM_IN_ALL"));
return 0;
}
public HashMap getOneStoreformIn(String cust_id, String goods_id) {
StoreformInExt storeformInExt = new StoreformInExt();
ArrayList list = new ArrayList();
HashMap map = new HashMap();
storeformInExt.setParam(":VCUST_ID", cust_id);
storeformInExt.setParam(":VGOODS_ID", goods_id);
list = storeformInExt.selByList("SEL_GOODS_BY_ID");
if (list != null && list.size() > 0) {
map = (HashMap) list.get(0);
}
return map;
}
public int checkGoods(String cust_id, String goods_id) {
ArrayList list = new ArrayList();
StoreformInExt storeformInExt = new StoreformInExt();
storeformInExt.setParam(":VCUST_ID", cust_id);
storeformInExt.setParam(":VGOODS_ID", goods_id);
list = storeformInExt.selByList("SEL_GOODS_BY_ID");
if (list != null && list.size() > 0) {
return 1;
}
else {
return 0;
}
}
// 找入库单
public ArrayList getGoodsListByCust(int iStart, String cust_id) throws SaasApplicationException {
ArrayList list = new ArrayList();
if (iStart > 1) {
iStart = (iStart - 1) * 20;
}
else {
iStart = 0;
}
StoreformInExt storeExt = new StoreformInExt();
storeExt.setParam(":VCUST_ID", cust_id);
list = storeExt.selByList("SEL_BY_CUST", iStart, 20);
return list;
}
// 入库单统计
public int getGoodsCountByCust(String cust_id) throws SaasApplicationException {
int size = 0;
ArrayList list = new ArrayList();
StoreformInExt storeExt = new StoreformInExt();
storeExt.setParam(":VCUST_ID", cust_id);
list = storeExt.selByList("SEL_BY_COUNT");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
size = Integer.parseInt(map.get("ct").toString());
}
return size;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -