Commit 9c5bc464 authored by wyh's avatar wyh

新增 批量

parent 0a146a21
package cn.com.fqy.controller.mapi; package cn.com.fqy.controller.mapi;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.fqy.common.ResultInfo; import cn.com.fqy.common.ResultInfo;
import cn.com.fqy.common.constants.Constant; import cn.com.fqy.common.constants.Constant;
import cn.com.fqy.core.common.PageFinder; import cn.com.fqy.core.common.PageFinder;
import cn.com.fqy.core.model.Advert;
import cn.com.fqy.core.model.Query; import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.model.Store; import cn.com.fqy.core.model.Store;
import cn.com.fqy.core.model.Worker; import cn.com.fqy.core.model.Worker;
...@@ -67,8 +67,9 @@ public class WebWorkerController { ...@@ -67,8 +67,9 @@ public class WebWorkerController {
*/ */
@RequestMapping("workerDetails") @RequestMapping("workerDetails")
@ResponseBody @ResponseBody
public ResultInfo<Worker> workerDetails(String workerId){ public ResultInfo<Map<String,Object>> workerDetails(String workerId){
ResultInfo<Worker> resultInfo = new ResultInfo<>(); ResultInfo<Map<String,Object>> resultInfo = new ResultInfo<>();
Map<String,Object> map = new HashMap<>();
if(workerId == null || "".equals(workerId)) { if(workerId == null || "".equals(workerId)) {
resultInfo.setCode("0"); resultInfo.setCode("0");
resultInfo.setMsg("员工参数为空"); resultInfo.setMsg("员工参数为空");
...@@ -76,8 +77,38 @@ public class WebWorkerController { ...@@ -76,8 +77,38 @@ public class WebWorkerController {
} }
Worker res = workerService.getWorker(workerId); Worker res = workerService.getWorker(workerId);
if (null != res ) { if (null != res ) {
Store store = storeService.getStore(res.getStoreId());
if(null != store) {
map.put("workerId",res.getWorkerId());
map.put("workerName",res.getWorkerName());
map.put("workerAge",res.getWorkerAge());
map.put("workerNumber",res.getWorkerNumber());
map.put("workerBirthday",res.getWorkerBirthday());
map.put("workerAncestral",res.getWorkerAncestral());
map.put("workerBust",res.getWorkerBust());
map.put("workerHeight",res.getWorkerHeight());
map.put("workerHipline",res.getWorkerHipline());
map.put("workerHomePic",res.getWorkerHomePic());
map.put("workerPic",res.getWorkerPic());
map.put("workerResume",res.getWorkerResume());
map.put("workerSex",res.getWorkerSex());
map.put("workerWaist",res.getWorkerWaist());
map.put("workerWeight",res.getWorkerWeight());
map.put("storeId",res.getStoreId());
map.put("brief",res.getBrief());
map.put("clicks",res.getClicks());
map.put("matureTime",res.getMatureTime());
map.put("serialNumber",res.getSerialNumber());
map.put("storeName",res.getStoreName());
map.put("storeBrief",store.getBrief());
map.put("storeCityName",store.getCityName());
map.put("storeProvince",store.getProvince());
map.put("storeCounty",store.getCounty());
map.put("storeHomePic",store.getStoreHomePic());
map.put("storePosition",store.getStorePosition());
}
resultInfo.setCode("1"); resultInfo.setCode("1");
resultInfo.setData(res); resultInfo.setData(map);
}else { }else {
resultInfo.setCode("0"); resultInfo.setCode("0");
resultInfo.setMsg("员工信息丢失"); resultInfo.setMsg("员工信息丢失");
......
...@@ -114,4 +114,25 @@ public class WorkerController extends BaseController { ...@@ -114,4 +114,25 @@ public class WorkerController extends BaseController {
} }
return result; return result;
} }
/**
* 批量审核
* @param workerIds
* @return
*/
@RequestMapping("batchWorkers")
@ResponseBody
public ResultInfo<Worker> batchWorkers(String[] workerIds) {
return workerService.batchWorkerUpdate(workerIds, getOperator());
}
/**
* 批量展示
* @param workerIds
* @return
*/
@RequestMapping("batchWorkerShop")
@ResponseBody
public ResultInfo<Worker> batchWorkerShop(String[] workerIds) {
return workerService.batchWorkerShopping(workerIds, getOperator());
}
} }
...@@ -7,6 +7,7 @@ import cn.com.fqy.common.ResultInfo; ...@@ -7,6 +7,7 @@ import cn.com.fqy.common.ResultInfo;
import cn.com.fqy.core.common.BaseService; import cn.com.fqy.core.common.BaseService;
import cn.com.fqy.core.common.PageFinder; import cn.com.fqy.core.common.PageFinder;
import cn.com.fqy.core.model.Query; import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.model.SysUser;
import cn.com.fqy.core.model.Worker; import cn.com.fqy.core.model.Worker;
/** /**
...@@ -84,5 +85,16 @@ public interface WorkerService extends BaseService { ...@@ -84,5 +85,16 @@ public interface WorkerService extends BaseService {
* @return * @return
*/ */
public List<Worker> getWorkerSByIds(String[] ids); public List<Worker> getWorkerSByIds(String[] ids);
/**
* 根据 一组ID 修改一组数据
* @param workerId
* @return
*/
public ResultInfo<Worker> batchWorkerUpdate(String[] workerIds,Operator operator);
public ResultInfo<Worker> batchWorkerShopping(String[] workerIds,Operator operator);
} }
...@@ -20,6 +20,7 @@ import cn.com.fqy.common.constants.Constant; ...@@ -20,6 +20,7 @@ import cn.com.fqy.common.constants.Constant;
import cn.com.fqy.core.common.PageFinder; import cn.com.fqy.core.common.PageFinder;
import cn.com.fqy.core.dao.WorkerDao; import cn.com.fqy.core.dao.WorkerDao;
import cn.com.fqy.core.model.Query; import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.model.SysUser;
import cn.com.fqy.core.model.Worker; import cn.com.fqy.core.model.Worker;
import cn.com.fqy.core.service.WorkerService; import cn.com.fqy.core.service.WorkerService;
...@@ -320,4 +321,28 @@ public class WorkerServiceImpl implements WorkerService { ...@@ -320,4 +321,28 @@ public class WorkerServiceImpl implements WorkerService {
return list; return list;
} }
@Override
public ResultInfo<Worker> batchWorkerUpdate(String[] workerIds,Operator operator) {
ResultInfo<Worker> resultInfo = new ResultInfo<Worker>();
for (String id : workerIds) {
Worker worker =new Worker();
worker.setWorkerId(id);
worker.setIsAuditing(1);
resultInfo = updateWorker(worker,operator);
}
return resultInfo;
}
@Override
public ResultInfo<Worker> batchWorkerShopping(String[] workerIds, Operator operator) {
ResultInfo<Worker> resultInfo = new ResultInfo<Worker>();
for (String id : workerIds) {
Worker worker =new Worker();
worker.setWorkerId(id);
worker.setIsShopping(1);;
resultInfo = updateWorker(worker,operator);
}
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