|
@@ -5,13 +5,9 @@ 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.*;
|
|
|
import restcontroller.R;
|
|
|
-import restcontroller.webmanage.sale.item.quarterpricenum;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
@API(title = "发货计划")
|
|
@@ -22,17 +18,16 @@ public class sendplan extends Controller {
|
|
|
|
|
|
@API(title = "发货计划新增更新", apiversion = R.ID2025032708594903.v1.class)
|
|
|
public String insertormodify_sendplan() throws YosException {
|
|
|
-
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
String tableName = "sa_sendplan";
|
|
|
-
|
|
|
- Long sa_sendplanid = 0l;
|
|
|
- String begindate = content.getStringValue("begindate",false,"null");
|
|
|
- String enddate = content.getStringValue("enddate",false,"null");
|
|
|
+ long sa_sendplanid = content.getLongValue("sa_sendplanid");
|
|
|
+ String begindate = content.getStringValue("begindate");
|
|
|
+ String enddate = content.getStringValue("enddate");
|
|
|
Long departmentid = content.getLongValue("departmentid");
|
|
|
- String senddate = content.getStringValue("senddate",false,"null");
|
|
|
+ String senddate = content.getStringValue("senddate");
|
|
|
String type = content.getStringValue("type");
|
|
|
- if (dbConnect.runSqlQuery("select * from sa_sendplan where type='"+type+"' and siteid='"+siteid+"'").isEmpty()) {
|
|
|
+ Rows sendplanRows = dbConnect.runSqlQuery("select * from sa_sendplan where sa_sendplanid='" + sa_sendplanid + "'");
|
|
|
+ if (sa_sendplanid == 0 || sendplanRows.isEmpty()) {
|
|
|
sa_sendplanid = createTableID(tableName);
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, tableName);
|
|
|
insertSQL.setUniqueid(sa_sendplanid).setSiteid(siteid);
|
|
@@ -47,39 +42,34 @@ public class sendplan extends Controller {
|
|
|
insertSQL.setValue("changeby", username);
|
|
|
sqlList.add(insertSQL.getSQL());
|
|
|
sqlList.add(DataContrlLog.createLog(this, tableName, sa_sendplanid, "新增", "发货计划新增成功").getSQL());
|
|
|
- } else{
|
|
|
- Rows rows = dbConnect.runSqlQuery("select * from sa_sendplan where siteid='"+siteid+"'");
|
|
|
- sa_sendplanid =rows.get(0).getLong("sa_sendplanid");
|
|
|
+ } else {
|
|
|
UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, tableName);
|
|
|
- updateSQL.setUniqueid(rows.get(0).getLong("sa_sendplanid")).setSiteid(siteid);
|
|
|
+ updateSQL.setUniqueid(sa_sendplanid).setSiteid(siteid);
|
|
|
updateSQL.setValue("begindate", begindate);
|
|
|
updateSQL.setValue("enddate", enddate);
|
|
|
updateSQL.setValue("departmentid", departmentid);
|
|
|
updateSQL.setValue("senddate", senddate);
|
|
|
- updateSQL.setValue("type", type);
|
|
|
updateSQL.setDateValue("changedate");
|
|
|
updateSQL.setValue("changeby", username);
|
|
|
sqlList.add(updateSQL.getSQL());
|
|
|
sqlList.add(DataContrlLog.createLog(this, tableName, sa_sendplanid, "编辑", "发货计划编辑成功").getSQL());
|
|
|
|
|
|
}
|
|
|
-
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
-
|
|
|
content.put("sa_sendplanid", sa_sendplanid);
|
|
|
-
|
|
|
return querysendplanMain();
|
|
|
}
|
|
|
+
|
|
|
@API(title = "发货计划列表", apiversion = R.ID2025032709040403.v1.class)
|
|
|
public String querysendplanList() throws YosException {
|
|
|
/*
|
|
|
过滤条件设置
|
|
|
*/
|
|
|
- boolean ishuahuo= content.getBooleanValue("ishuahuo");
|
|
|
+ boolean ishuahuo = content.getBooleanValue("ishuahuo");
|
|
|
StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
- if(ishuahuo){
|
|
|
+ if (ishuahuo) {
|
|
|
where.append(" and t1.type!='配件订单' ");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
where.append(" and t1.type='配件订单' ");
|
|
|
}
|
|
|
|
|
@@ -115,7 +105,7 @@ public class sendplan extends Controller {
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_sendplan");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere("sa_sendplanid",content.getLongValue("sa_sendplanid"));
|
|
|
+ querySQL.setWhere("sa_sendplanid", content.getLongValue("sa_sendplanid"));
|
|
|
Rows rows = querySQL.query();
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|