Commit 0b646031 authored by wangyihao's avatar wangyihao

修改

parent 04001f88
......@@ -219,12 +219,39 @@ public class IndexController {
*/
@RequestMapping("searchWorkerResult")
@ResponseBody
public ResultInfo<List<Worker>> searchWorkerResult(Worker worker) {
public ResultInfo<List<Worker>> searchWorkerResult(Worker worker,String cityId) {
ResultInfo<List<Worker>> resultInfo = new ResultInfo<>();
// List<Worker> listQuery1 = new ArrayList<>();
List<Worker> listQuery = new ArrayList<>();
worker.setIsDeleted(0); // 未删除
worker.setIsShopping(1); // 员工展示状态
worker.setIsAuditing(1);
List<String> stoListQuery = new ArrayList<>();
if (cityId == null || "".equals(cityId)) {
resultInfo.setCode("0");
resultInfo.setMsg("市 ID 参数为空");
return resultInfo;
}
Store store = new Store();
store.setCityId(cityId);
// 通过城市ID查询返回店铺ID
List<Store> stoList = storeService.getStoreList(new Query(store));
if (stoList != null && stoList.size() > 0) {
for (Store list : stoList) {
stoListQuery.add(list.getStoreId());
}
} else {
resultInfo.setCode(Constant.FAIL);
resultInfo.setMsg("暂无数据");
return resultInfo;
}
// 将storeId的集合转换数组
String[] strArray = stoListQuery.toArray(new String[stoListQuery.size()]);
// worker.setIsDeleted(0); // 未删除
// worker.setIsShopping(1); // 员工展示状态
// worker.setIsAuditing(1);
int firstNumber = 0;
int lastNUmber = 0;
int firstNumber1 = 0;
......@@ -248,10 +275,11 @@ public class IndexController {
worker.setWorkerAge(null);
}
List<Worker> workerlist = workerService.getWorkerList(new Query(worker));
if (workerlist.size() > 0 && workerlist != null) {
for (Worker list : workerlist) {
// 通过storeId查询返回员工列表
List<Worker> workerList = workerService.getWorkerSByIds(strArray);
// List<Worker> workerlist = workerService.getWorkerList(new Query(worker));
if (workerList.size() > 0 && workerList != null) {
for (Worker list : workerList) {
if (firstNumber != 0 || lastNUmber != 0) {
int hegit = Integer.valueOf(list.getWorkerHeight());
if (hegit < firstNumber || hegit > lastNUmber) {
......@@ -279,4 +307,29 @@ public class IndexController {
}
return resultInfo;
}
/**
* 店铺在线员工
*/
@RequestMapping("workers")
@ResponseBody
public ResultInfo<List<Worker>> workers(String storeId){
ResultInfo<List<Worker>> resultInfo = new ResultInfo<>();
if(storeId == null || "".equals(storeId)) {
resultInfo.setCode("0");
resultInfo.setMsg("店铺ID参数为空");
return resultInfo;
}
Worker worker = new Worker();
worker.setStoreId(storeId);
List<Worker> workerList = workerService.getWorkerList(new Query(worker));
if (null != workerList && workerList.size()>0) {
resultInfo.setCode("1");
resultInfo.setData(workerList);
}else {
resultInfo.setCode("0");
resultInfo.setMsg("员工信息丢失");
}
return resultInfo;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment