|
|
@@ -8,6 +8,7 @@ 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.Row;
|
|
|
import common.data.Rows;
|
|
|
@@ -33,6 +34,7 @@ public class LSALogistics extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "新增或更新", apiversion = R.ID20230719165802.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = {LSALogistics.class})
|
|
|
public String insertOrUpdate() throws YosException {
|
|
|
//物流单ID
|
|
|
Long sa_logisticsid = content.getLongValue("sa_logisticsid");
|
|
|
@@ -89,6 +91,7 @@ public class LSALogistics extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "添加送货明细", apiversion = R.ID20230720141602.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = {LSALogistics.class})
|
|
|
public String addMX() throws YosException {
|
|
|
//物流单ID
|
|
|
Long sa_logisticsid = content.getLongValue("sa_logisticsid");
|
|
|
@@ -118,6 +121,7 @@ public class LSALogistics extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "删除送货明细", apiversion = R.ID20230720141902.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = {LSALogistics.class})
|
|
|
public String delete() throws YosException {
|
|
|
Long sa_logisticsid = content.getLongValue("sa_logisticsid");
|
|
|
Rows rows = LSALogisticsHelper.getLogisticsRows(this);
|
|
|
@@ -138,6 +142,7 @@ public class LSALogistics extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "送货明细列表", apiversion = R.ID20230720141702.v1.class)
|
|
|
+ @CACHEING
|
|
|
public String selectMXList() throws YosException {
|
|
|
//物流单ID
|
|
|
Long sa_logisticsid = content.getLongValue("sa_logisticsid");
|
|
|
@@ -192,6 +197,7 @@ public class LSALogistics extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "物流单详情", apiversion = R.ID20230720142002.v1.class)
|
|
|
+ @CACHEING
|
|
|
public String detail() throws YosException {
|
|
|
//物流单ID
|
|
|
Long sa_logisticsid = content.getLongValue("sa_logisticsid");
|
|
|
@@ -217,6 +223,7 @@ public class LSALogistics extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "物流单列表", apiversion = R.ID20230720142102.v1.class)
|
|
|
+ @CACHEING
|
|
|
public String selectList() throws YosException {
|
|
|
|
|
|
StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
@@ -263,4 +270,35 @@ public class LSALogistics extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @API(title = "收货、取消收货", apiversion = R.ID20230721104302.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = {LSALogistics.class})
|
|
|
+ public String receive() throws YosException {
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
+ Long sa_logisticsid = content.getLong("sa_logisticsid");
|
|
|
+ Rows rows = LSALogisticsHelper.getLogisticsRows(this);
|
|
|
+ if (rows.isEmpty()) {
|
|
|
+ return getErrReturnObject().setErrMsg("请选择物流单").toString();
|
|
|
+ }
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "物流单确认收货");
|
|
|
+ if (rows.get(0).getString("status").equals("新建")) {
|
|
|
+ return getErrReturnObject().setErrMsg("该物流单为新建状态,无法确认收货与取消收货").toString();
|
|
|
+ } else if (rows.get(0).getString("status").equals("收货")) {
|
|
|
+ String sql = DataContrlLog.createLog(this, "sa_logistics", sa_logisticsid, "取消收货", "物流单取消收货:" + sa_logisticsid).getSQL();
|
|
|
+ sqlList.add(sql);
|
|
|
+ sqlFactory = new SQLFactory(this, "物流单取消收货");
|
|
|
+ } else {
|
|
|
+ String sql = DataContrlLog.createLog(this, "sa_logistics", sa_logisticsid, "收货", "物流单收货:" + sa_logisticsid).getSQL();
|
|
|
+ sqlList.add(sql);
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ sqlFactory.addParameter("sa_logisticsid", sa_logisticsid);
|
|
|
+ sqlFactory.addParameter("userid", userid);
|
|
|
+ sqlFactory.addParameter("username", username);
|
|
|
+ sqlList.add(sqlFactory.getSQL());
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|