|  | @@ -274,10 +274,10 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |          Long sa_sendrepairid = content.getLong("sa_sendrepairid");
 | 
	
		
			
				|  |  |          boolean isinstock = content.getBooleanValue("isinstock");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        Rows rows = dbConnect.runSqlQuery("select t1.sys_enterpriseid,t1.remarks,t1.billno,t1.status,t2.qty,t2.sa_sendrepair_detailid,t2.reason,t2.disposition,t2.newitemno,t2.newsku,t2.newitemid,t2.sku,t2.name,t2.phonenumber,t2.address,t3.itemno,t2.itemid,t3.itemname,t3.model,t4.model newmodel,t4.skucontrol from sa_sendrepair t1 " +
 | 
	
		
			
				|  |  | -                "inner join sa_sendrepair_detail t2  on t1.sa_sendrepairid=t2.sa_sendrepairid" +
 | 
	
		
			
				|  |  | -                "left join plm_item t3 on t3.itemid=t2.itemid" +
 | 
	
		
			
				|  |  | -                "left join plm_item t4 on t4.itemid=t2.newitemid" +
 | 
	
		
			
				|  |  | +        Rows rows = dbConnect.runSqlQuery("select t1.sa_sendrepairid,t1.sys_enterpriseid,t1.remarks,t1.billno,t1.status,t2.qty,t2.sa_sendrepair_detailid,t2.reason,t2.disposition,t2.newitemno,t2.newsku,t2.newitemid,t2.sku,t2.name,t2.phonenumber,t2.address,t3.itemno,t2.itemid,t3.itemname,t3.model,t4.model newmodel,t4.skucontrol from sa_sendrepair t1 " +
 | 
	
		
			
				|  |  | +                "inner join sa_sendrepair_detail t2  on t1.sa_sendrepairid=t2.sa_sendrepairid " +
 | 
	
		
			
				|  |  | +                "left join plm_item t3 on t3.itemid=t2.itemid " +
 | 
	
		
			
				|  |  | +                "left join plm_item t4 on t4.itemid=t2.newitemid " +
 | 
	
		
			
				|  |  |                  " where t1.sa_sendrepairid ='"
 | 
	
		
			
				|  |  |                  + sa_sendrepairid + "' and  t1.siteid='" + siteid + "'");
 | 
	
		
			
				|  |  |          if(rows.isEmpty()){
 | 
	
	
		
			
				|  | @@ -290,11 +290,30 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |                  return getErrReturnObject().setErrMsg("单号为:【" + row.getString("billno") + "】的送修单为非确认状态,无法进仓")
 | 
	
		
			
				|  |  |                          .toString();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            if (row.getString("disposition").equalsIgnoreCase(
 | 
	
		
			
				|  |  | +                    "翻新")) {
 | 
	
		
			
				|  |  | +                if (row.getString("newitemno").equalsIgnoreCase(
 | 
	
		
			
				|  |  | +                        "")
 | 
	
		
			
				|  |  | +                        || row.getString("newsku")
 | 
	
		
			
				|  |  | +                        .equalsIgnoreCase("")) {
 | 
	
		
			
				|  |  | +                    return getErrReturnObject().setErrMsg("处理意见为翻新时应填写新的品号与新的序列号").toString();
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                if (row.getString("newitemid").equals(
 | 
	
		
			
				|  |  | +                        row.getString("itemid"))
 | 
	
		
			
				|  |  | +                        && row.getString("newsku")
 | 
	
		
			
				|  |  | +                        .equals(row
 | 
	
		
			
				|  |  | +                                .getString("sku"))) {
 | 
	
		
			
				|  |  | +                    return getErrReturnObject().setErrMsg("翻新前后序列号和品号不能相同").toString();
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              if (row.getString("disposition").equals("待修")) {
 | 
	
		
			
				|  |  |                  return getErrReturnObject().setErrMsg("待修不可进仓")
 | 
	
		
			
				|  |  |                          .toString();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              if (!row.getString("status").equals("进仓")) {
 | 
	
		
			
				|  |  |                  return getErrReturnObject().setErrMsg("单号为:【" + row.getString("billno") + "】的送修单为非进仓状态,无法反进仓")
 | 
	
	
		
			
				|  | @@ -332,13 +351,13 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |              updateSQL.setValue("instockby",username);
 | 
	
		
			
				|  |  |              updateSQL.setDateValue("instockdate");
 | 
	
		
			
				|  |  |              sqlList.add(
 | 
	
		
			
				|  |  | -                    DataContrlLog.createLog(this, "sa_sendrepair", sa_sendrepairid, "确认", "送修单确认成功").getSQL());
 | 
	
		
			
				|  |  | +                    DataContrlLog.createLog(this, "sa_sendrepair", sa_sendrepairid, "进仓", "送修单进仓成功").getSQL());
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              updateSQL.setValue("status","确认");
 | 
	
		
			
				|  |  |              updateSQL.setValue("instockby","");
 | 
	
		
			
				|  |  |              updateSQL.setValue("instockdate","null");
 | 
	
		
			
				|  |  |              sqlList.add(
 | 
	
		
			
				|  |  | -                    DataContrlLog.createLog(this, "sa_sendrepair", sa_sendrepairid, "反确认", "送修单反确认成功").getSQL());
 | 
	
		
			
				|  |  | +                    DataContrlLog.createLog(this, "sa_sendrepair", sa_sendrepairid, "反进仓", "送修单反进仓成功").getSQL());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if(row.getString("disposition").equals("返修") || row.getString("disposition").equals("翻新")){
 | 
	
		
			
				|  |  |              if(isinstock){
 | 
	
	
		
			
				|  | @@ -532,6 +551,7 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          sqlList.add(updateSQL.getSQL());
 | 
	
		
			
				|  |  | +        System.err.println(sqlList.toString());
 | 
	
		
			
				|  |  |          dbConnect.runSqlUpdate(sqlList);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          return getSucReturnObject().toString();
 | 
	
	
		
			
				|  | @@ -688,7 +708,7 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |                  sqlList.add(insertSQL.getSQL());
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (!istrue) {
 | 
	
		
			
				|  |  | -                sqlList.add("update sa_itemsku set itemid="+sendrepairdetail.getLong("itemid")+",changenotes='' where sa_itemskuid="+skurow.getLong("sa_itemskuid"));
 | 
	
		
			
				|  |  | +                sqlList.add("update sa_itemsku set itemid="+sendrepairdetail.getLong("itemid")+",changenotes='null' where sa_itemskuid="+skurow.getLong("sa_itemskuid"));
 | 
	
		
			
				|  |  |                  sqlList.add("delete from sa_itemsku_change where changenotes like '%"+sendrepairdetail.getString("billno")+"%'");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -715,7 +735,9 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |                  saItemsku.setDateValue("createdate");
 | 
	
		
			
				|  |  |                  saItemsku.setValue("changeby", username);
 | 
	
		
			
				|  |  |                  saItemsku.setDateValue("changedate");
 | 
	
		
			
				|  |  | -                saItemsku.setWhere("sa_itemskuid", createTableID("sa_itemsku"));
 | 
	
		
			
				|  |  | +                saItemsku.setValue("changenotes", "");
 | 
	
		
			
				|  |  | +                saItemsku.setValue("mono", "");
 | 
	
		
			
				|  |  | +                saItemsku.setValue("sa_itemskuid", createTableID("sa_itemsku"));
 | 
	
		
			
				|  |  |                  saItemsku.setSiteid(siteid);
 | 
	
		
			
				|  |  |                  sqlList.add(saItemsku.getSQL());
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -788,89 +810,72 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |          ArrayList<String> sqlList = new ArrayList<>();
 | 
	
		
			
				|  |  |          Rows departmentRows  =dbConnect.runSqlQuery("select * from sys_department");
 | 
	
		
			
				|  |  |          RowsMap departmentRowsMap = departmentRows.toRowsMap("depno");
 | 
	
		
			
				|  |  | -        String sku = sendrepairdetail.getString("sku");
 | 
	
		
			
				|  |  | -        String newsku = sendrepairdetail.getString("newsku");
 | 
	
		
			
				|  |  |          if (istrue) {
 | 
	
		
			
				|  |  | -            if (!sku.equals(newsku)) {
 | 
	
		
			
				|  |  | -                InsertSQL saItemsku = SQLFactory.createInsertSQL(this,"sa_itemsku");
 | 
	
		
			
				|  |  | -                saItemsku.setValue("sku", newsku);
 | 
	
		
			
				|  |  | -                saItemsku.setValue("itemid", sendrepairdetail.getLong("newitemid"));
 | 
	
		
			
				|  |  | -                saItemsku.setValue("stockid",stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0);
 | 
	
		
			
				|  |  | -                saItemsku.setValue("createby", username);
 | 
	
		
			
				|  |  | -                saItemsku.setDateValue("createdate");
 | 
	
		
			
				|  |  | -                saItemsku.setValue("changeby", username);
 | 
	
		
			
				|  |  | -                saItemsku.setDateValue("changedate");
 | 
	
		
			
				|  |  | -                saItemsku.setWhere("sa_itemskuid", createTableID("sa_itemsku"));
 | 
	
		
			
				|  |  | -                saItemsku.setSiteid(siteid);
 | 
	
		
			
				|  |  | -                sqlList.add(saItemsku.getSQL());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill");
 | 
	
		
			
				|  |  | -                long st_stockbillid = createTableID("st_stockbill");
 | 
	
		
			
				|  |  | -                insertSQL.setUniqueid(st_stockbillid);
 | 
	
		
			
				|  |  | -                insertSQL.setSiteid(siteid);
 | 
	
		
			
				|  |  | -                insertSQL.setValue("billno", createBillCode("STOCKBILL1"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("type", "其他出库");
 | 
	
		
			
				|  |  | -                if (sendrepairdetail.getString("disposition").equalsIgnoreCase("返修")) {
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("typemx", "返修出库");
 | 
	
		
			
				|  |  | -                } else if (sendrepairdetail.getString("disposition").equalsIgnoreCase("翻新")) {
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("typemx", "翻新出库");
 | 
	
		
			
				|  |  | -                } else if (sendrepairdetail.getString("disposition").contains("报废")) {
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("typemx", "报废出库");
 | 
	
		
			
				|  |  | -                } else if (sendrepairdetail.getString("disposition").equalsIgnoreCase("退钱做正品")) {
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("typemx", "退钱做正品出库");
 | 
	
		
			
				|  |  | -                } else if (sendrepairdetail.getString("disposition").equalsIgnoreCase("退钱做试验机")) {
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("typemx", "退钱做试验机出库");
 | 
	
		
			
				|  |  | +            InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill");
 | 
	
		
			
				|  |  | +            long st_stockbillid = createTableID("st_stockbill");
 | 
	
		
			
				|  |  | +            insertSQL.setUniqueid(st_stockbillid);
 | 
	
		
			
				|  |  | +            insertSQL.setSiteid(siteid);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("billno", createBillCode("STOCKBILL1"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("type", "其他出库");
 | 
	
		
			
				|  |  | +            if (sendrepairdetail.getString("disposition").equalsIgnoreCase("返修")) {
 | 
	
		
			
				|  |  | +                insertSQL.setValue("typemx", "返修出库");
 | 
	
		
			
				|  |  | +            } else if (sendrepairdetail.getString("disposition").equalsIgnoreCase("翻新")) {
 | 
	
		
			
				|  |  | +                insertSQL.setValue("typemx", "翻新出库");
 | 
	
		
			
				|  |  | +            } else if (sendrepairdetail.getString("disposition").contains("报废")) {
 | 
	
		
			
				|  |  | +                insertSQL.setValue("typemx", "报废出库");
 | 
	
		
			
				|  |  | +            } else if (sendrepairdetail.getString("disposition").equalsIgnoreCase("退钱做正品")) {
 | 
	
		
			
				|  |  | +                insertSQL.setValue("typemx", "退钱做正品出库");
 | 
	
		
			
				|  |  | +            } else if (sendrepairdetail.getString("disposition").equalsIgnoreCase("退钱做试验机")) {
 | 
	
		
			
				|  |  | +                insertSQL.setValue("typemx", "退钱做试验机出库");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                insertSQL.setValue("sys_enterpriseid",sendrepairdetail.getLong("sys_enterpriseid"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("rb", 1);
 | 
	
		
			
				|  |  | -                insertSQL.setValue("sourceobject", "sa_sendrepair");
 | 
	
		
			
				|  |  | -                insertSQL.setValue("sourceid", sendrepairdetail.getLong("sa_sendrepairid"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("departmentid", departmentRowsMap.containsKey("10106")?departmentRowsMap.get("10106").get(0).getLong("departmentid"):0);
 | 
	
		
			
				|  |  | -                insertSQL.setValue("stockid", stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0);
 | 
	
		
			
				|  |  | -                insertSQL.setValue("remarks",  "送修单出库");
 | 
	
		
			
				|  |  | -                insertSQL.setValue("status", "审核");
 | 
	
		
			
				|  |  | -                insertSQL.setValue("createby", username);
 | 
	
		
			
				|  |  | -                insertSQL.setDateValue("createdate");
 | 
	
		
			
				|  |  | -                insertSQL.setDateValue("billdate");
 | 
	
		
			
				|  |  | -                insertSQL.setValue("checkby", username);
 | 
	
		
			
				|  |  | -                insertSQL.setDateValue("checkdate");
 | 
	
		
			
				|  |  | -                sqlList.add(insertSQL.getSQL());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            insertSQL.setValue("sys_enterpriseid",sendrepairdetail.getLong("sys_enterpriseid"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("rb", 1);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("sourceobject", "sa_sendrepair");
 | 
	
		
			
				|  |  | +            insertSQL.setValue("sourceid", sendrepairdetail.getLong("sa_sendrepairid"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("departmentid", departmentRowsMap.containsKey("10106")?departmentRowsMap.get("10106").get(0).getLong("departmentid"):0);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("stockid", stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("remarks",  "送修单出库");
 | 
	
		
			
				|  |  | +            insertSQL.setValue("status", "审核");
 | 
	
		
			
				|  |  | +            insertSQL.setValue("createby", username);
 | 
	
		
			
				|  |  | +            insertSQL.setDateValue("createdate");
 | 
	
		
			
				|  |  | +            insertSQL.setDateValue("billdate");
 | 
	
		
			
				|  |  | +            insertSQL.setValue("checkby", username);
 | 
	
		
			
				|  |  | +            insertSQL.setDateValue("checkdate");
 | 
	
		
			
				|  |  | +            sqlList.add(insertSQL.getSQL());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill_items");
 | 
	
		
			
				|  |  | -                long st_stockbill_itemsid = createTableID("st_stockbill_items");
 | 
	
		
			
				|  |  | -                insertSQL.setUniqueid(st_stockbill_itemsid);
 | 
	
		
			
				|  |  | +            insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill_items");
 | 
	
		
			
				|  |  | +            long st_stockbill_itemsid = createTableID("st_stockbill_items");
 | 
	
		
			
				|  |  | +            insertSQL.setUniqueid(st_stockbill_itemsid);
 | 
	
		
			
				|  |  | +            insertSQL.setSiteid(siteid);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("rowno", 1);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("sa_dispatch_itemsid", 0);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("sourceobject", "sa_sendrepair_detail");
 | 
	
		
			
				|  |  | +            insertSQL.setValue("sourceid", sendrepairdetail.getLong("sa_sendrepair_detailid"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("stockid",stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0);
 | 
	
		
			
				|  |  | +            insertSQL.setValue("itemid", sendrepairdetail.getLong("itemid"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("itemno", sendrepairdetail.getString("itemno"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("itemname", sendrepairdetail.getString("itemname"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("model", sendrepairdetail.getString("model"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("qty", sendrepairdetail.getBigDecimal("qty"));
 | 
	
		
			
				|  |  | +            insertSQL.setValue("st_stockbillid", st_stockbillid);
 | 
	
		
			
				|  |  | +            sqlList.add(insertSQL.getSQL());
 | 
	
		
			
				|  |  | +            if(StringUtils.isNotBlank(sendrepairdetail.getString("sku"))){
 | 
	
		
			
				|  |  | +                insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill_items_sku");
 | 
	
		
			
				|  |  | +                long st_stockbill_items_skuid = createTableID("st_stockbill_items_sku");
 | 
	
		
			
				|  |  | +                insertSQL.setUniqueid(st_stockbill_items_skuid);
 | 
	
		
			
				|  |  |                  insertSQL.setSiteid(siteid);
 | 
	
		
			
				|  |  | -                insertSQL.setValue("rowno", 1);
 | 
	
		
			
				|  |  | -                insertSQL.setValue("sa_dispatch_itemsid", 0);
 | 
	
		
			
				|  |  | -                insertSQL.setValue("sourceobject", "sa_sendrepair_detail");
 | 
	
		
			
				|  |  | -                insertSQL.setValue("sourceid", sendrepairdetail.getLong("sa_sendrepair_detailid"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("stockid",stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0);
 | 
	
		
			
				|  |  | +                insertSQL.setValue("stockid", stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0);
 | 
	
		
			
				|  |  |                  insertSQL.setValue("itemid", sendrepairdetail.getLong("itemid"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("itemno", sendrepairdetail.getString("itemno"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("itemname", sendrepairdetail.getString("itemname"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("model", sendrepairdetail.getString("model"));
 | 
	
		
			
				|  |  | -                insertSQL.setValue("qty", sendrepairdetail.getBigDecimal("qty"));
 | 
	
		
			
				|  |  | +                insertSQL.setValue("sku", sendrepairdetail.getString("sku"));
 | 
	
		
			
				|  |  |                  insertSQL.setValue("st_stockbillid", st_stockbillid);
 | 
	
		
			
				|  |  | +                insertSQL.setValue("st_stockbill_itemsid", st_stockbill_itemsid);
 | 
	
		
			
				|  |  |                  sqlList.add(insertSQL.getSQL());
 | 
	
		
			
				|  |  | -                if(StringUtils.isNotBlank(sendrepairdetail.getString("sku"))){
 | 
	
		
			
				|  |  | -                    insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill_items_sku");
 | 
	
		
			
				|  |  | -                    long st_stockbill_items_skuid = createTableID("st_stockbill_items_sku");
 | 
	
		
			
				|  |  | -                    insertSQL.setUniqueid(st_stockbill_items_skuid);
 | 
	
		
			
				|  |  | -                    insertSQL.setSiteid(siteid);
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("stockid", stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0);
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("itemid", sendrepairdetail.getLong("itemid"));
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("sku", sendrepairdetail.getString("sku"));
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("st_stockbillid", st_stockbillid);
 | 
	
		
			
				|  |  | -                    insertSQL.setValue("st_stockbill_itemsid", st_stockbill_itemsid);
 | 
	
		
			
				|  |  | -                    sqlList.add(insertSQL.getSQL());
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                sqlList.addAll(sendrepairIcinvbal(isinstock("其他出库","1",istrue),sendrepairdetail, stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0));
 | 
	
		
			
				|  |  | -                sqlList.add("update sa_itemsku set stockid=0 where sku='"+sendrepairdetail.getString("sku")+"'");
 | 
	
		
			
				|  |  | -                if(sendrepairdetail.getString("disposition").equalsIgnoreCase("翻新")  || sendrepairdetail.getString("disposition").equalsIgnoreCase("返修")){
 | 
	
		
			
				|  |  | -                    sqlList.add("update sa_itemsku set status='报废' where sku='"+sendrepairdetail.getString("sku")+"'");
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            sqlList.addAll(sendrepairIcinvbal(isinstock("其他出库","1",istrue),sendrepairdetail, stockRowsMap.containsKey("104")?stockRowsMap.get("104").get(0).getLong("stockid"):0));
 | 
	
		
			
				|  |  | +            sqlList.add("update sa_itemsku set stockid=0 where sku='"+sendrepairdetail.getString("sku")+"'");
 | 
	
		
			
				|  |  | +            if(sendrepairdetail.getString("disposition").equalsIgnoreCase("翻新")  || sendrepairdetail.getString("disposition").equalsIgnoreCase("返修")){
 | 
	
		
			
				|  |  | +                sqlList.add("update sa_itemsku set status='报废' where sku='"+sendrepairdetail.getString("sku")+"'");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (!istrue) {
 | 
	
	
		
			
				|  | @@ -1057,7 +1062,7 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |              sqlList.add(invbalInsert.getSQL());
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              UpdateSQL invbalUpdate = SQLFactory.createUpdateSQL(this, "st_invbal");
 | 
	
		
			
				|  |  | -            invbalUpdate.addValue("qty", invbalsRowsMap.get(String.valueOf(newitemid)).get(0).getBigDecimal("qty").add(qty));
 | 
	
		
			
				|  |  | +            invbalUpdate.addValue("qty",qty);
 | 
	
		
			
				|  |  |              invbalUpdate.setWhere("itemid", newitemid);
 | 
	
		
			
				|  |  |              invbalUpdate.setWhere("stockid", stockid);
 | 
	
		
			
				|  |  |              invbalUpdate.setWhere("siteid", siteid);
 | 
	
	
		
			
				|  | @@ -1084,7 +1089,7 @@ public class sendrepair extends Controller {
 | 
	
		
			
				|  |  |              sqlList.add(invbalInsert.getSQL());
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              UpdateSQL invbalUpdate = SQLFactory.createUpdateSQL(this, "st_invbal");
 | 
	
		
			
				|  |  | -            invbalUpdate.addValue("qty", invbalsRowsMap.get(String.valueOf(itemid)).get(0).getBigDecimal("qty").add(qty));
 | 
	
		
			
				|  |  | +            invbalUpdate.addValue("qty", qty);
 | 
	
		
			
				|  |  |              invbalUpdate.setWhere("itemid", itemid);
 | 
	
		
			
				|  |  |              invbalUpdate.setWhere("stockid", stockid);
 | 
	
		
			
				|  |  |              invbalUpdate.setWhere("siteid", siteid);
 |