|
@@ -11,6 +11,7 @@ import restcontroller.R;
|
|
|
import restcontroller.webmanage.saletool.fad.FadHelper;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.LinkedHashSet;
|
|
|
|
|
|
/**
|
|
|
* 预约报名
|
|
@@ -61,7 +62,7 @@ public class Appointment extends Controller {
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
|
- @API(title = "新增预约单", apiversion = R.ID20240513151902.v1.class)
|
|
|
+ @API(title = "预约单列表", apiversion = R.ID20240513151902.v1.class)
|
|
|
public String list() throws YosException {
|
|
|
|
|
|
/*
|
|
@@ -113,6 +114,48 @@ public class Appointment extends Controller {
|
|
|
Rows rows = querySQL.query();
|
|
|
|
|
|
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ @API(title = "工作台预约列表", apiversion = R.ID20240513154802.v1.class)
|
|
|
+ public String worklist() throws YosException {
|
|
|
+
|
|
|
+ /*
|
|
|
+ 过滤条件设置
|
|
|
+ */
|
|
|
+ StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
+ if (content.containsKey("where")) {
|
|
|
+ JSONObject whereObject = content.getJSONObject("where");
|
|
|
+ if (whereObject.containsKey("type") && !"".equals(whereObject.getString("type"))) {
|
|
|
+ where.append(" and (");
|
|
|
+ where.append("t1.type ='").append(whereObject.getString("type")).append("' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (pageSorting.equals("''")) {
|
|
|
+ pageSorting = "t1.createdate desc";
|
|
|
+ }
|
|
|
+
|
|
|
+ LinkedHashSet<Long> userids = new LinkedHashSet<>();
|
|
|
+ userids.add(userid);
|
|
|
+ if (usertype == 21) {
|
|
|
+ Rows rows = dbConnect.runSqlQuery("SELECT userid from sys_enterprise_hr WHERE sys_enterpriseid=" + sys_enterpriseid + " and siteid='" + siteid + "'");
|
|
|
+ userids.addAll(rows.toArrayList("userid", new ArrayList<>()));
|
|
|
+ }
|
|
|
+
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_appointment")
|
|
|
+ .setTableAlias("t1");
|
|
|
+ querySQL.addQueryFields("addressdetail", "concat(province,city,county,address)");
|
|
|
+ querySQL.setSiteid(siteid);
|
|
|
+ querySQL.setWhere("shareuserid", userids.toArray());
|
|
|
+ querySQL.setWhere(where.toString());
|
|
|
+ querySQL.setOrderBy(pageSorting).setPage(pageSize, pageNumber);
|
|
|
+ Rows rows = querySQL.query();
|
|
|
+
|
|
|
+
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|