hz-zhhq-app-service/greenH5modul/.svn/pristine/20/200f132321cc3a6bca91e3d604b...

70 lines
2.2 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 java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jysoft.weChat.service.WechatService;
import com.nationalelectirc.Constant.Constant;
import com.nationalelectirc.utils.RestResult;
import com.nationalelectric.greenH5.bizc.BaseServiceImpl;
import com.nationalelectric.greenH5.po.GreenCalendar;
import com.sgcc.uap.persistence.IHibernateDao;
import com.sgcc.uap.service.validator.ServiceValidatorBaseException;
/**
* <b>概述</b><br>
* <p>
* <b>功能</b><br>
*
* @author chenweikang
*/
@Controller
@RequestMapping("/greenCalendar")
public class GreenCalendarController extends GreenBaseController {
@Resource
private IHibernateDao hibernateDao;
@Autowired
private BaseServiceImpl baseService;
@Resource
private WechatService wService;
/**用户订单列表*/
@RequestMapping(value="/getCalendarList", method = RequestMethod.POST)
@ResponseBody
public RestResult getCalendarList(@RequestBody Map<String,Object> map){
try {
String date_name = (String) map.get("date_name");
StringBuffer sb = new StringBuffer();
//查询订单
sb.append("select * from( select to_char(DATE_NAME,'yyyy-MM-dd') as \"date_name\" ,isholiday as \"isholiday\" from green_calendar"
+ " where to_char(DATE_NAME,'yyyy-MM-dd')>=? and IS_DELETE='N' order by DATE_NAME) WHERE ROWNUM <=30 ");
List<Map<String,Object>> applyList = hibernateDao.queryForListWithSql(sb.toString()
,new Object[]{ date_name});
return new RestResult(Constant.SUCCESS,"成功",applyList);
}catch (ServiceValidatorBaseException e) {
throw e;
}catch (Exception e) {
e.printStackTrace();
return new RestResult(Constant.FAILED,"返回异常",new ArrayList<Map<String,Object>>());
}
}
}