|
|
@@ -1,14 +1,20 @@
|
|
|
package restcontroller.webmanage.sale.u8;
|
|
|
|
|
|
+import beans.data.BatchDeleteErr;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
|
import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
|
+import common.annotation.CACHEING_CLEAN;
|
|
|
import common.data.QuerySQL;
|
|
|
import common.data.Rows;
|
|
|
import common.data.SQLFactory;
|
|
|
import restcontroller.R;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+
|
|
|
@API(title = "销售出库U8上传序列号")
|
|
|
public class u8billcodes extends Controller {
|
|
|
public u8billcodes(JSONObject content) throws YosException {
|
|
|
@@ -56,4 +62,28 @@ public class u8billcodes extends Controller {
|
|
|
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
+
|
|
|
+ @API(title = "删除", apiversion = R.ID2025080413532003.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = {u8.class, u8billcodes.class})
|
|
|
+ public String delete() throws YosException {
|
|
|
+ long u8id=content.getLong("u8id");
|
|
|
+ JSONArray u8billcodesids = content.getJSONArray("u8billcodesids");
|
|
|
+ BatchDeleteErr batchDeleteErr = BatchDeleteErr.create(this, u8billcodesids.size());
|
|
|
+ for (Object o : u8billcodesids) {
|
|
|
+ long u8billcodesid = Long.parseLong(o.toString());
|
|
|
+ Rows RowsStatus = dbConnect.runSqlQuery("select u8id,status from u8 where siteid='"
|
|
|
+ + siteid + "' and u8id='" + u8id + "'");
|
|
|
+
|
|
|
+ if (RowsStatus.isNotEmpty()) {
|
|
|
+ if (!RowsStatus.get(0).getString("status").equals("新建")) {
|
|
|
+ batchDeleteErr.addErr(u8id, "非新建状态的销售出库U8上传无法删除");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ArrayList<String> sqllist = new ArrayList<>();
|
|
|
+ sqllist.add("delete from u8billcodes where siteid='" + siteid + "' and u8billcodesid=" + u8billcodesid);
|
|
|
+ dbConnect.runSqlUpdate(sqllist);
|
|
|
+ }
|
|
|
+ return batchDeleteErr.getReturnObject().toString();
|
|
|
+ }
|
|
|
}
|