|
|
@@ -65,6 +65,7 @@ public class serviceorder extends Controller {
|
|
|
String begdate = content.getStringValue("begdate");
|
|
|
String enddate = content.getStringValue("enddate");
|
|
|
long saler_hrid = content.getLongValue("saler_hrid");
|
|
|
+ long sa_customersid = content.getLongValue("sa_customersid");
|
|
|
|
|
|
String sku= content.getStringValue("sku");
|
|
|
String cardno= content.getStringValue("cardno");
|
|
|
@@ -147,6 +148,8 @@ public class serviceorder extends Controller {
|
|
|
|
|
|
sqlFactory.addParameter("name", content.getStringValue("name"));
|
|
|
sqlFactory.addParameter("phonenumber", content.getStringValue("phonenumber"));
|
|
|
+ sqlFactory.addParameter("sa_customersid", content.getStringValue("sa_customersid"));
|
|
|
+
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sa_serviceorderitems");
|
|
|
@@ -189,6 +192,60 @@ public class serviceorder extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ @API(title = "可选择序列号列表查询", apiversion = R.ID2025082210142103.v1.class)
|
|
|
+ @CACHEING
|
|
|
+ public String queryskuList() throws YosException {
|
|
|
+
|
|
|
+ if (content.containsKey("sys_enterpriseid")) {
|
|
|
+ sys_enterpriseid = content.getLong("sys_enterpriseid");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 过滤条件设置
|
|
|
+ */
|
|
|
+ StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
+
|
|
|
+ if (content.containsKey("where")) {
|
|
|
+ JSONObject whereObject = content.getJSONObject("where");
|
|
|
+ if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
+ where.append(" and(");
|
|
|
+ where.append("t2.itemname like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t2.itemno like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t1.sku like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ }
|
|
|
+// String hrid = content.getString("hrid");
|
|
|
+// SQLFactory sqlFactory = new SQLFactory(this, "审核订单列表查询", pageSize, pageNumber, pageSorting);
|
|
|
+// sqlFactory.addParameter_SQL("where", where);
|
|
|
+// sqlFactory.addParameter("siteid", siteid);
|
|
|
+// sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
+// Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL(false));
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_itemsku ", "sku");
|
|
|
+ querySQL.setTableAlias("t1");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t2", "t1.itemid=t2.itemid and t1.siteid=t2.siteid","itemid","itemno","itemname","model","spec");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "plm_unit", "t3", "t3.unitid=t2.unitid and t3.siteid=t2.siteid","unitname");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sa_agents", "t4", "t4.sa_agentsid=t1.sa_agentsid and t4.siteid=t1.siteid","agentnum");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t5", "t5.sys_enterpriseid=t4.sys_enterpriseid and t5.siteid=t4.siteid","contact","phonenumber","address");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sa_warrantycard", "t6", "t6.sku=t1.sku and t6.siteid=t1.siteid","cardno","begdate","enddate");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sa_customers", "t7", "t6.sa_customersid=t7.sa_customersid and t6.siteid=t7.siteid","sa_customersid");
|
|
|
+ querySQL.addQueryFields("customername","t7.name");
|
|
|
+ querySQL.addQueryFields("customerphonenumber","t7.phonenumber");
|
|
|
+
|
|
|
+ querySQL.setSiteid(siteid);
|
|
|
+ querySQL.setWhere("t1.sa_agentsid in (select sa_agentsid from sa_agents where sys_enterpriseid="+sys_enterpriseid+")");
|
|
|
+ querySQL.setWhere(where.toString());
|
|
|
+ querySQL.setDistinct(true);
|
|
|
+ querySQL.setPage(pageSize, pageNumber);
|
|
|
+ querySQL.setOrderBy(pageSorting);
|
|
|
+ Rows rows = querySQL.query();
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
@API(title = "可选择订单列表查询", apiversion = R.ID20230206091503.v1.class)
|
|
|
@CACHEING
|
|
|
public String queryCheckOrderList() throws YosException {
|