hz-zhhq-app-service/greenH5modul/.svn/pristine/56/56b1155e6d6757a79cc5e1bdfc3...

75 lines
2.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.nationalelectric.greenH5;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.nationalelectirc.Constant.Constant;
import com.nationalelectirc.utils.RestResult;
import com.nationalelectric.greenH5.DTO.GreenMealTicketApplyDTO;
import com.nationalelectric.greenH5.DTO.UserDTO;
import com.nationalelectric.greenH5.bizc.BaseServiceImpl;
import com.nationalelectric.greenH5.bizc.IGreenOperateLogBizc;
import com.sgcc.uap.service.validator.ServiceValidatorBaseException;
import com.sgcc.uap.persistence.IHibernateDao;
import org.springframework.web.bind.annotation.RequestMapping;
import java.text.SimpleDateFormat;
import java.util.*;
import com.nationalelectric.greenH5.po.GreenUserInfo;
import javax.annotation.Resource;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
/**
* <b>概述</b><br>
* <p>
* <b>功能</b><br>
*
* @author BOWEI
*/
@Controller
@RequestMapping("/greenServiceGuide")
public class GreenServiceGuideController extends GreenBaseController {
@Resource
private IHibernateDao hibernateDao;
@Resource
private IGreenOperateLogBizc greenOperateLogBizc;
@Autowired
private BaseServiceImpl baseService;
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ResponseBody
public RestResult list(Map<String, Object> map) {
String userId = map.get("userId").toString();
// String date = map.get("date").toString();
GreenUserInfo info = getUserInfo(userId);
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
try {
List<Map<String, String>> menuList1 = new ArrayList<Map<String,String>>();
String sql = "select ADDRESS as \"address\",CONTENT as \"content\",NAME as \"name\",PHONE as \"phone\",POINT as \"point\",SERVICE_TIME as \"service_time\","
+ " PAGE_PATH AS \"page_path\" "
+ " from green_service_guide where is_deleted='N' order by sort ";
menuList1 = hibernateDao.queryForListWithSql(sql);
return new RestResult(Constant.SUCCESS, "成功", menuList1);
} catch (ServiceValidatorBaseException e) {
throw e;
} catch (Exception e) {
e.printStackTrace();
// greenOperateLogBizc.addLog(Constant.TAKE_OUT_FOOD,
// Constant.QUERY, Constant.OPERATE_FAIL, "查询外卖预定列表",
// Constant.LOG_ERROR, userDTO.getUserId());
return new RestResult(Constant.FAILED, "返回异常");
}
}
}