|
@@ -16,13 +16,12 @@ import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
public class stockbill extends BaseClass {
|
|
public class stockbill extends BaseClass {
|
|
|
- public static String checkValidate(Controller controller, long st_stockbillid, boolean ischeck) throws YosException {
|
|
|
|
|
|
|
+ private static void checkValidate(Controller controller, long st_stockbillid, boolean ischeck) throws YosException {
|
|
|
Rows rows = controller.dbConnect.runSqlQuery("select * from st_stockbill where st_stockbillid ='"
|
|
Rows rows = controller.dbConnect.runSqlQuery("select * from st_stockbill where st_stockbillid ='"
|
|
|
+ st_stockbillid + "' and siteid='" + controller.siteid + "'");
|
|
+ st_stockbillid + "' and siteid='" + controller.siteid + "'");
|
|
|
Rows rowsdetail = controller.dbConnect.runSqlQuery("select t1.*,t2.skucontrol from st_stockbill_items t1 left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid where t1.st_stockbillid ='"
|
|
Rows rowsdetail = controller.dbConnect.runSqlQuery("select t1.*,t2.skucontrol from st_stockbill_items t1 left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid where t1.st_stockbillid ='"
|
|
|
+ st_stockbillid + "' and t1.siteid='" + controller.siteid + "'");
|
|
+ st_stockbillid + "' and t1.siteid='" + controller.siteid + "'");
|
|
|
String type=rows.get(0).getString("type");
|
|
String type=rows.get(0).getString("type");
|
|
|
- boolean isinstock = isinstock(rows.get(0).getString("type"),rows.get(0).getString("rb"),false);
|
|
|
|
|
String str="success";
|
|
String str="success";
|
|
|
if(type.equals("销售出库")){
|
|
if(type.equals("销售出库")){
|
|
|
if(ischeck){
|
|
if(ischeck){
|
|
@@ -45,16 +44,19 @@ public class stockbill extends BaseClass {
|
|
|
} else if (type.equals("返修出库")) {// 云链
|
|
} else if (type.equals("返修出库")) {// 云链
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- return str;
|
|
|
|
|
|
|
+ if(!str.equals("success")){
|
|
|
|
|
+ throw new YosException(str);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- public static ArrayList<String> check(Controller controller, long st_stockbillid, boolean ischeck) throws YosException {
|
|
|
|
|
|
|
+ public static ArrayList<String> getCheckSql(Controller controller, long st_stockbillid, boolean ischeck) throws YosException {
|
|
|
Rows rows = controller.dbConnect.runSqlQuery("select * from st_stockbill where st_stockbillid ='"
|
|
Rows rows = controller.dbConnect.runSqlQuery("select * from st_stockbill where st_stockbillid ='"
|
|
|
+ st_stockbillid + "' and siteid='" + controller.siteid + "'");
|
|
+ st_stockbillid + "' and siteid='" + controller.siteid + "'");
|
|
|
Rows rowsdetail = controller.dbConnect.runSqlQuery("select t1.*,t2.skucontrol from st_stockbill_items t1 left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid where t1.st_stockbillid ='"
|
|
Rows rowsdetail = controller.dbConnect.runSqlQuery("select t1.*,t2.skucontrol from st_stockbill_items t1 left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid where t1.st_stockbillid ='"
|
|
|
+ st_stockbillid + "' and t1.siteid='" + controller.siteid + "'");
|
|
+ st_stockbillid + "' and t1.siteid='" + controller.siteid + "'");
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
String type=rows.get(0).getString("type");
|
|
String type=rows.get(0).getString("type");
|
|
|
- boolean isinstock = isinstock(type,rows.get(0).getString("rb"),true);
|
|
|
|
|
|
|
+ boolean isinstock = isinstock(type,rows.get(0).getString("rb"),ischeck);
|
|
|
|
|
+ checkValidate(controller,st_stockbillid,ischeck);
|
|
|
if(type.equals("销售出库")){
|
|
if(type.equals("销售出库")){
|
|
|
if(ischeck){
|
|
if(ischeck){
|
|
|
sqlList.addAll(xsckcheck(controller,rows,rowsdetail,isinstock));
|
|
sqlList.addAll(xsckcheck(controller,rows,rowsdetail,isinstock));
|
|
@@ -96,8 +98,8 @@ public class stockbill extends BaseClass {
|
|
|
return sqlList;
|
|
return sqlList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void checkWithoutSQL(Controller controller, long st_stockbillid, boolean ischeck) throws YosException {
|
|
|
|
|
- controller.dbConnect.runSqlUpdate(check(controller,st_stockbillid,ischeck));
|
|
|
|
|
|
|
+ public static void check(Controller controller, long st_stockbillid, boolean ischeck) throws YosException {
|
|
|
|
|
+ controller.dbConnect.runSqlUpdate(getCheckSql(controller,st_stockbillid,ischeck));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|