70 lines
2.2 KiB
Plaintext
70 lines
2.2 KiB
Plaintext
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>>());
|
||
}
|
||
}
|
||
|
||
|
||
}
|