|
@@ -193,22 +193,6 @@ public class Store extends Controller {
|
|
long sa_storeid = detailRow.getLong("sa_storeid");
|
|
long sa_storeid = detailRow.getLong("sa_storeid");
|
|
detailRow.put("attinfos", Attachment.get(this, "sa_store", sa_storeid));
|
|
detailRow.put("attinfos", Attachment.get(this, "sa_store", sa_storeid));
|
|
detailRow.put("headpic",getHeadPic(detailRow.getLong("userid")));
|
|
detailRow.put("headpic",getHeadPic(detailRow.getLong("userid")));
|
|
-// Rows adspaceRows = dbConnect.runSqlQuery("SELECT * from sys_adspace WHERE systemclient='wechatsaletool' and isused=1");
|
|
|
|
-
|
|
|
|
-// for (Row adspaceRow : adspaceRows) {
|
|
|
|
-// Long sys_adspaceid = adspaceRow.getLong("sys_adspaceid");
|
|
|
|
-// querySQL = SQLFactory.createQuerySQL(this, "sys_ad")
|
|
|
|
-// .setTableAlias("t1");
|
|
|
|
-// querySQL.setSiteid(siteid);
|
|
|
|
-// querySQL.setWhere("sys_adspaceid", sys_adspaceid);
|
|
|
|
-// querySQL.setDataAuth(true);
|
|
|
|
-// Rows adRows = querySQL.query();
|
|
|
|
-// RowsMap attinfosRowsMap = Attachment.get(this, "sys_ad", adRows.toArrayList("sys_adid", new ArrayList<>()));
|
|
|
|
-// for (Row row : adRows) {
|
|
|
|
-// row.put("attinfos", attinfosRowsMap.getOrDefault(row.getString("sys_adid"), new Rows()));
|
|
|
|
-// }
|
|
|
|
-// detailRow.put("ad_" + adspaceRow.getString("location"), adRows);
|
|
|
|
-// }
|
|
|
|
|
|
|
|
addHistory(sa_storeid);
|
|
addHistory(sa_storeid);
|
|
|
|
|
|
@@ -247,12 +231,15 @@ public class Store extends Controller {
|
|
@API(title = "查询历史足迹", apiversion = R.ID20240416162002.v1.class)
|
|
@API(title = "查询历史足迹", apiversion = R.ID20240416162002.v1.class)
|
|
public String getHistory() throws YosException {
|
|
public String getHistory() throws YosException {
|
|
|
|
|
|
- QuerySQL querySQL = SQLFactory.createQuerySQL(controller, "sa_store"
|
|
|
|
- , "sa_storeid", "storename","longitude","latitude")
|
|
|
|
|
|
+ String longitude = content.getStringValue("longitude");
|
|
|
|
+ String latitude = content.getStringValue("latitude");
|
|
|
|
+
|
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(controller, "sa_store")
|
|
.setTableAlias("t1");
|
|
.setTableAlias("t1");
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise_hr", "t2", "t2.sys_enterprise_hrid=t1.leader_hrid and t2.siteid=t1.siteid"
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise_hr", "t2", "t2.sys_enterprise_hrid=t1.leader_hrid and t2.siteid=t1.siteid"
|
|
- , "name","phonenumber");
|
|
|
|
|
|
+ , "name","phonenumber","userid");
|
|
querySQL.addJoinTable(JOINTYPE.inner, "sa_store_history", "t3", "t3.sa_storeid=t1.sa_storeid and t3.siteid=t1.siteid");
|
|
querySQL.addJoinTable(JOINTYPE.inner, "sa_store_history", "t3", "t3.sa_storeid=t1.sa_storeid and t3.siteid=t1.siteid");
|
|
|
|
+ querySQL.addQueryFields("distance", "st_distance_sphere(point(longitude,latitude),point('" + longitude + "','" + latitude + "'))");
|
|
querySQL.setSiteid(siteid);
|
|
querySQL.setSiteid(siteid);
|
|
querySQL.setWhere("t3.userid",userid);
|
|
querySQL.setWhere("t3.userid",userid);
|
|
querySQL.setPage(pageSize, pageNumber).setOrderBy(pageSorting);
|
|
querySQL.setPage(pageSize, pageNumber).setOrderBy(pageSorting);
|
|
@@ -262,6 +249,8 @@ public class Store extends Controller {
|
|
|
|
|
|
for (Row row:rows) {
|
|
for (Row row:rows) {
|
|
row.put("attinfos", attinfoRows.getOrDefault(row.getString("sa_storeid"), new Rows()));
|
|
row.put("attinfos", attinfoRows.getOrDefault(row.getString("sa_storeid"), new Rows()));
|
|
|
|
+ row.put("distance", String.format("%.2f", row.getDouble("distance")));
|
|
|
|
+ row.put("headpic",getHeadPic(row.getLong("userid")));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|