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());
}
} }
package cn.com.fqy.core.service; package cn.com.fqy.core.service;
import java.util.List; import java.util.List;
import cn.com.fqy.common.Operator; import cn.com.fqy.common.Operator;
import cn.com.fqy.common.ResultInfo; 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.Worker; import cn.com.fqy.core.model.SysUser;
import cn.com.fqy.core.model.Worker;
/**
* Worker 服务接口类 /**
*/ * Worker 服务接口类
public interface WorkerService extends BaseService { */
public interface WorkerService extends BaseService {
/**
* 根据查询条件,查询并返回Worker的列表 /**
* @param q 查询条件 * 根据查询条件,查询并返回Worker的列表
* @return * @param q 查询条件
*/ * @return
public List<Worker> getWorkerList(Query q); */
public List<Worker> getWorkerList(Query q);
/**
* 根据查询条件,分页查询并返回Worker的分页结果 /**
* @param q 查询条件 * 根据查询条件,分页查询并返回Worker的分页结果
* @return * @param q 查询条件
*/ * @return
public PageFinder<Worker> getWorkerPagedList(Query q); */
public PageFinder<Worker> getWorkerPagedList(Query q);
/**
* 根据主键,查询并返回一个Worker对象 /**
* @param id 主键id * 根据主键,查询并返回一个Worker对象
* @return * @param id 主键id
*/ * @return
public Worker getWorker(String id); */
public Worker getWorker(String id);
/**
* 根据主键数组,查询并返回一组Worker对象 /**
* @param ids 主键数组,数组中的主键值应当无重复值,如有重复值时,则返回的列表长度可能小于传入的数组长度 * 根据主键数组,查询并返回一组Worker对象
* @return * @param ids 主键数组,数组中的主键值应当无重复值,如有重复值时,则返回的列表长度可能小于传入的数组长度
*/ * @return
public List<Worker> getWorkerByIds(String[] ids); */
public List<Worker> getWorkerByIds(String[] ids);
/**
* 根据主键,删除特定的Worker记录 /**
* @param id 主键id * 根据主键,删除特定的Worker记录
* @param operator 操作人对象 * @param id 主键id
* @return * @param operator 操作人对象
*/ * @return
public ResultInfo<Worker> delWorker(String id, Operator operator); */
public ResultInfo<Worker> delWorker(String id, Operator operator);
/**
* 新增一条Worker记录,执行成功后传入对象及返回对象的主键属性值不为null /**
* @param worker 新增的Worker数据(如果无特殊需求,新增对象的主键值请保留为null) * 新增一条Worker记录,执行成功后传入对象及返回对象的主键属性值不为null
* @param operator 操作人对象 * @param worker 新增的Worker数据(如果无特殊需求,新增对象的主键值请保留为null)
* @return * @param operator 操作人对象
*/ * @return
public ResultInfo<Worker> addWorker(Worker worker, Operator operator); */
public ResultInfo<Worker> addWorker(Worker worker, Operator operator);
/**
* 根据主键,更新一条Worker记录 /**
* @param worker 更新的Worker数据,且其主键不能为空 * 根据主键,更新一条Worker记录
* @param operator 操作人对象 * @param worker 更新的Worker数据,且其主键不能为空
* @return * @param operator 操作人对象
*/ * @return
public ResultInfo<Worker> updateWorker(Worker worker, Operator operator); */
public ResultInfo<Worker> updateWorker(Worker worker, Operator operator);
/**
* 生成主键 /**
* @return * 生成主键
*/ * @return
public String generatePK(); */
public String generatePK();
/**
* 为Worker对象设置默认值 /**
* @param obj * 为Worker对象设置默认值
*/ * @param obj
public void fillDefaultValues(Worker obj); */
public void fillDefaultValues(Worker obj);
/**
* 根据 一组ID 查询返回一个对象集合 /**
* @param ids * 根据 一组ID 查询返回一个对象集合
* @return * @param ids
*/ * @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);
}
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