Commit 9a1ba06c authored by wangyihao's avatar wangyihao

修改 排序 新增 数据字典项查询接口

parent 6dbcc097
package cn.com.fqy.controller.mapi;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.com.fqy.common.ResultInfo;
import cn.com.fqy.core.common.BaseController;
import cn.com.fqy.core.model.DataDictItem;
import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.service.DataDictCatService;
import cn.com.fqy.core.service.DataDictItemService;
/**
* 数据字典项分类查询
* @author Administrator
*
*/
@Controller
@RequestMapping("config")
public class ConfigController extends BaseController{
@Resource
private DataDictCatService dataDictCatService;
@Resource
private DataDictItemService dataDictItemService;
/**
* 数据字典分类查询(店铺消费区间)
*
* @param dataDictCat
* @param pageNo
* @param pageSize
* @return
*/
@RequestMapping("getDataDictsStore")
@ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsStore(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>();
DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("CONSUME_INTERVAL");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) {
result.setCode("1");
result.setData(list);
}else {
result.setCode("0");
result.setMsg("暂无数据");
}
return result;
}
/**
* 数据字典分类查询(员工身高)
*
* @param dataDictCat
* @param pageNo
* @param pageSize
* @return
*/
@RequestMapping("getDataDictsHight")
@ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsHight(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>();
DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("WORKER_HEIGHT");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) {
result.setCode("1");
result.setData(list);
}else {
result.setCode("0");
result.setMsg("暂无数据");
}
return result;
}
/**
* 数据字典分类查询(员工年龄)
*
* @param dataDictCat
* @param pageNo
* @param pageSize
* @return
*/
@RequestMapping("getDataDictsAge")
@ResponseBody
public ResultInfo<List<DataDictItem>> getDataDictsAge(){
ResultInfo<List<DataDictItem>> result = new ResultInfo<>();
DataDictItem dataDictItem = new DataDictItem();
dataDictItem.setIsAvailable(1);
dataDictItem.setIsDeleted(0);
dataDictItem.setDataDictCatCode("WORKER_AGE");
List<DataDictItem> list = dataDictItemService.getDataDictItemList(new Query(dataDictItem));
if (list.size()>0) {
result.setCode("1");
result.setData(list);
}else {
result.setCode("0");
result.setMsg("暂无数据");
}
return result;
}
}
package cn.com.fqy.controller.mapi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
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.ResponseBody;
import cn.com.fqy.common.ResultInfo;
import cn.com.fqy.common.constants.Constant;
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.Store;
import cn.com.fqy.core.model.Worker;
import cn.com.fqy.core.service.AdvertService;
import cn.com.fqy.core.service.StoreService;
import cn.com.fqy.core.service.WorkerService;
......@@ -80,4 +80,28 @@ public class WebShopController {
return resultInfo;
}
/**
* 商家店铺区信息
*/
@RequestMapping("getStoresCountyList")
@ResponseBody
public ResultInfo<List<Map<String,Object>>> getStoresCountyList(){
ResultInfo<List<Map<String,Object>>> resultInfo = new ResultInfo<>();
List<Map<String,Object>> listQuery = new ArrayList<>();
List<Store> storeList = storeService.getStoreList(new Query());
if ( storeList.size()>0 && storeList !=null ) {
for(Store list:storeList) {
Map<String,Object> map = new HashMap<>();
map.put("storeId", list.getStoreId());
map.put("county", list.getCounty());
listQuery.add(map);
}
resultInfo.setCode("1");
resultInfo.setData(listQuery);
}else {
resultInfo.setCode("0");
resultInfo.setMsg("暂无店铺区位置信息");
}
return resultInfo;
}
}
......@@ -266,7 +266,7 @@ OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED,IS_AVAILABLE,ADMINISTRATORS_N
<where>
<include refid="listCommonWhere1"/>
</where>
ORDER BY SERIAL_NUMBER DESC,CLICKS ASC
ORDER BY SERIAL_NUMBER ASC,CLICKS DESC
<![CDATA[LIMIT #{rowIndex},#{pageSize} ]]>
</select>
......
......@@ -260,7 +260,7 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
<where>
<include refid="listCommonWhere1"/>
</where>
ORDER BY SERIAL_NUMBER DESC,CLICKS ASC
ORDER BY SERIAL_NUMBER ASC,CLICKS DESC
<![CDATA[LIMIT #{rowIndex},#{pageSize} ]]>
</select>
......
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