?? stockmanagementdata.java
字號:
//更新商品分拆調出單數組,9表示調出單
orderOutLedger[0] = stockLedger[2];
orderOutLedger[1] = "9";
orderOutLedger[2] = stockLedger[0]; //調出單的關聯標識
orderOutLedger[4] = stockLedger[8]; //調入倉庫
orderOutLedger[8] = stockLedger[4]; //調出倉庫
//更新商品分拆調出單
stockManagementData.updateStockLedgerAndSub(ledgerDate, orderOutLedger, stockSubLedgerOut);
result = 1;
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//撤消或者恢復商品分拆或者組合單的方法
public int cancelOrRestoreRearrangeOrder(String ledgerDate, String inOrderId,
String outOrderId, String userName,
int onProcess, String remark) {
int result = 0;
try{
if(onProcess == 2){
//恢復調入單
stockManagementData.signStockLedgerAndSubForFinish(ledgerDate,
"submitUser", userName, inOrderId, 2, remark);
//恢復調出單
stockManagementData.signStockLedgerAndSubForFinish(ledgerDate,
"submitUser", userName, outOrderId, 2, remark);
}else{
//取消調入單
stockManagementData.cancelStockLedgerAndSub(ledgerDate, inOrderId, remark);
//取消調出單
stockManagementData.cancelStockLedgerAndSub(ledgerDate, outOrderId, remark);
}
result = 1;
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//創建商品組合單的方法
public int createCombineOrder(String ledgerDate, String[] stockLedger,
String[][] stockSubLedgerOut, String[][] stockSubLedgerIn){
int result = 0;
try{
//創建商品組合調入單數組
String[] orderInLedger = new String[stockLedger.length];
System.arraycopy(stockLedger, 0, orderInLedger, 0, stockLedger.length);
//創建商品組合調入單
stockManagementData.createStockLedgerAndSub(ledgerDate,
orderInLedger, stockSubLedgerIn);
//根據商品組合管理用戶名字取得商品組合調入單,12表示商品組合調入單
String[][] orderInLedgers = stockManagementData.
getStockLedgerByStringField(ledgerDate, "submitUser", stockLedger[3], 12);
//取得商品組合調入單標識,最后一條記錄便是新創建的商品組合調入單
String orderInId = orderInLedgers[orderInLedgers.length -1][0];
//創建商品組合調出單數組
String[] orderOutLedger = new String[stockLedger.length];
System.arraycopy(stockLedger, 0, orderOutLedger, 0, stockLedger.length);
//更新商品組合調出單數組,將商品調入單標識放在供貨商字段,11表示商品組合調出單
orderOutLedger[2] = orderInId;
orderOutLedger[1] = "11";
orderOutLedger[4] = stockLedger[8]; //調入倉庫
orderOutLedger[8] = stockLedger[4]; //調出倉庫
//創建商品組合調出單
stockManagementData.createStockLedgerAndSub(ledgerDate,
orderOutLedger, stockSubLedgerOut);
//根據商品組合管理用戶名字取得商品組合調出單
String[][] orderOutLedgers = stockManagementData.
getStockLedgerByStringField(ledgerDate, "submitUser", orderOutLedger[3], 11);
//取得商品組合調出單標識,最后一條記錄便是新創建的商品組合調出單
String orderOutId = orderOutLedgers[orderOutLedgers.length -1][0];
//更新商品組合調入單數組的標識和關聯標識
orderInLedger[0] = orderInId;
orderInLedger[2] = orderOutId;
//根據標識重新取得商品組合調入單明細數組
String[][] orderInSubLedger = stockManagementData.getStockSubLedgerByOrderId(
ledgerDate, orderInLedger[0]);
//更新商品組合調入單,將調出單的關聯標識寫入調入單
stockManagementData.updateStockLedgerAndSub(ledgerDate,
orderInLedger, orderInSubLedger);
result = 1;
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//更新商品組合單的方法
public int updateCombineOrder(String ledgerDate, String[] stockLedger,
String[][] stockSubLedgerOut, String[][] stockSubLedgerIn){
int result = 0;
try{
//更新商品組合調入單
stockManagementData.updateStockLedgerAndSub(ledgerDate,
stockLedger, stockSubLedgerIn);
//創建商品組合調出單數組
String[] orderOutLedger = new String[stockLedger.length];
System.arraycopy(stockLedger, 0, orderOutLedger, 0, stockLedger.length);
//更新商品組合調出單數組,11表示調出單
orderOutLedger[0] = stockLedger[2];
orderOutLedger[1] = "11";
orderOutLedger[2] = stockLedger[0]; //調出單的關聯標識
orderOutLedger[4] = stockLedger[8]; //調入倉庫
orderOutLedger[8] = stockLedger[4]; //調出倉庫
//更新商品組合調出單
stockManagementData.updateStockLedgerAndSub(ledgerDate,
orderOutLedger, stockSubLedgerOut);
result = 1;
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//根據倉庫名字取得盤點數據的方法
public String[][] getStocktakeQuantityByWarehouse(String ledgerDate, String warehouse, int onProcess) {
String[][] data = new String[0][2];
try {
data = stockManagementData.getStocktakeQuantityByWarehouse(ledgerDate,
warehouse, onProcess);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//根據倉庫名字匯總顯示商品數量和金額的方法
public String[][] getStockByWarehouse(String ledgerDate, String warehouse, int onProcess) {
String[][] data = new String[0][5];
try {
data = stockManagementData.getStockByWarehouse(ledgerDate, warehouse, onProcess);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//根據商品條形碼匯總顯示商品在各個倉庫的數量和金額的方法
public String[][] getStockByGoodsBarcode(String ledgerDate, String goodsBarcode, int onProcess) {
String[][] data = new String[0][5];
try {
data = stockManagementData.getStockByGoodsBarcode(ledgerDate, goodsBarcode, onProcess);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//查詢過期商品的方法
public String[][] getStockByUsefulLife(String ledgerDate, String usefulLife, int onProcess) {
String[][] data = new String[0][6];
try {
data = stockManagementData.getStockByUsefulLife(ledgerDate, usefulLife, onProcess);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//創建銷售賬套數據表和銷售賬套明細數據表記錄的方法
public int createSaleLedgerAndSub(String ledgerDate, String[] saleLedger,
String[][] saleSubLedger) {
int result = 0;
try{
result = stockManagementData.createSaleLedgerAndSub(ledgerDate,
saleLedger, saleSubLedger);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//更新銷售賬套數據表和銷售賬套明細數據表記錄的方法
public int updateSaleLedgerAndSub(String ledgerDate, String[] saleLedger,
String[][] saleSubLedger) {
int result = 0;
try{
result = stockManagementData.updateSaleLedgerAndSub(ledgerDate,
saleLedger, saleSubLedger);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//銷售賬套數據表電子簽名和更新完成狀態的方法
public int signSaleLedgerAndSub(String ledgerDate, String fieldName,
String userName, String saleId, int onProcess,
String remark) {
int result = 0;
try{
result = stockManagementData.signSaleLedgerAndSub(ledgerDate, fieldName,
userName, saleId, onProcess, remark);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//根據單據編號取得銷售賬套明細數據表的記錄
public String[][] getSaleSubLedgerBySaleId(String ledgerDate, String saleId) {
String[][] data = new String[0][5];
try {
data = stockManagementData.getSaleSubLedgerBySaleId(ledgerDate, saleId);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//根據字符串字段取得銷售賬套數據表記錄的方法
public String[][] getSaleLedgerByStringField(String ledgerDate,
String fieldName,
String fieldValue, int saleType) {
String[][] data = new String[0][11];
try {
data = stockManagementData.getSaleLedgerByStringField(ledgerDate,
fieldName, fieldValue, saleType);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//根據完成狀態取得銷售賬套數據表記錄的方法
public String[][] getSaleLedgerByOnProcess(String ledgerDate, int saleType,
int onProcess) {
String[][] data = new String[0][11];
try {
data = stockManagementData.getSaleLedgerByOnProcess(ledgerDate, saleType,
onProcess);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//根據訂單日期取得銷售賬套數據表記錄的方法
public String[][] getSaleLedgerByOrderDate(String ledgerDate,
java.sql.Timestamp startDate,
java.sql.Timestamp endDate,
int saleType) {
String[][] data = new String[0][11];
try {
data = stockManagementData.getSaleLedgerByOrderDate(ledgerDate, startDate,
endDate, saleType);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//前臺銷售員進行銷售賬套數據表電子簽名的方法
public int counterUserSignSaleLedgerAndSub(String ledgerDate, String userName,
String remark, String warehouse) {
int result = 0;
try{
result = stockManagementData.counterUserSignSaleLedgerAndSub(ledgerDate,
userName, remark, warehouse);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//根據商品的條形碼取得銷售價和折扣
public double[] getGoodsPriceAndDiscount(String goodsBarcode){
double[] data = new double[2];
data[0] = 0;
data[1] = 0;
try{
//取得商品數據
String[][] goods = stockManagementData.getGoodsByGoodsBarCode(
goodsBarcode);
if(goods.length == 1){
data[0] = Double.parseDouble(goods[0][11]);
data[1] = Double.parseDouble(goods[0][12]);
}
}catch(Exception ex){
ex.printStackTrace();
}
return data;
}
//根據條形碼、倉庫取得商品的數量,然后檢查賣出商品的數量是否足夠
public int checkGoodsSaleQuantity(String ledgerDate, String goodsBarcode,
int saleQuantity, String warehouse) {
int result = 0;
try{
//取得商品的庫存數組
String[][] data = stockManagementData.getStocktakeQuantityByWarehouse(ledgerDate, warehouse, 2);
int stockQuantity = 0;
for(int i = 0; i < data.length; i++){
if(data[i][0].equals(goodsBarcode)){
stockQuantity = Integer.parseInt(data[i][1]);
break;
}
}
//如果庫存數大于等于銷售數返回1,否則返回0
if(stockQuantity >= saleQuantity){
result = 1;
}
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//信用銷售用戶進行銷售賬套數據表電子簽名的方法
public int creditUserSignSaleLedgerAndSub(String ledgerDate, String userName,
String remark, String warehouse,
String saleId, String customerName) {
int result = 0;
try{
result = stockManagementData.creditUserSignSaleLedgerAndSub(ledgerDate,
userName, remark, warehouse, saleId, customerName);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//檢查客戶的方法
public int checkCustomer(String customerName){
int result = 0;
String[][] detail = this.getCustomersByCustomerName(customerName);
for(int i = 0; i < detail.length; i++){
if(detail[i][0].equals(customerName)){
result = 1;
break;
}
}
return result;
}
//檢查客戶信用限額的方法
public int checkCustomerCreditLimit(String customerName, double amount){
int result = 0;
double creditLimit = 0;
String[][] detail = this.getCustomersByCustomerName(customerName);
for(int i = 0; i < detail.length; i++){
if(detail[i][0].equals(customerName)){
creditLimit = Double.parseDouble(detail[i][15]);
//如果客戶信用限額大于或者等于客戶單次購買的金額,通過測試
if(creditLimit >= amount){
result = 1;
}
break;
}
}
return result;
}
//現金管理員對應收票據進行電子簽名的方法
public int cashUserSignAccountReceivable(String ledgerDate, String userName,
String[] currentAccountLedger) {
int result = 0;
try{
result = stockManagementData.cashUserSignAccountReceivable(ledgerDate,
userName, currentAccountLedger);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//根據關聯標識、退貨單的商品條形碼取得庫存賬套的銷售出庫單明細賬的數據
public String[][] getStockSaleOutBySaleOrderLink(String ledgerDate,
String saleOrderLink, String saleId) {
String[][] data = new String[0][4];
try {
data = stockManagementData.getStockSaleOutBySaleOrderLink(ledgerDate,
saleOrderLink, saleId);
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}
//前臺銷售員進行銷售退貨單電子簽名的方法
public int counterUserSignSaleReturn(String ledgerDate, String saleId,
String userName, String remark,
String warehouse,
String[][] stockSubLedger) {
int result = 0;
try{
result = stockManagementData.counterUserSignSaleReturn(ledgerDate, saleId,
userName, remark, warehouse, stockSubLedger);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
//信用銷售員進行信用銷售退貨單電子簽名的方法
public int creditUserSignSaleReturn(String ledgerDate, String saleId,
String userName, String remark,
String warehouse, String customerName,
String[][] stockSubLedger, boolean isPay) {
int result = 0;
try{
result = stockManagementData.creditUserSignSaleReturn(ledgerDate, saleId,
userName, remark, warehouse, customerName, stockSubLedger, isPay);
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -