hz-zhhq-app-service/greenH5modul/.svn/pristine/72/7273291fa4574d56351248de215...

71 lines
2.8 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.List;
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;
import org.springframework.web.bind.annotation.RequestMapping;
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.bizc.IGreenOperateLogBizc;
import com.nationalelectric.greenH5.po.GreenGeneralInspecton;
import com.sgcc.uap.persistence.IHibernateDao;
/**
* <b>概述</b><br>
*
* <p>
* <b>功能</b><br>
*
*
* @author Administrator
*/
@Controller
@RequestMapping("/greenGeneralInspecton")
public class GreenGeneralInspectonController {
/**
* HibernateDao逻辑构件
*/
@Autowired
IHibernateDao hibernateDao;
@Resource
private IGreenOperateLogBizc greenOperateLogBizc;
/***
* 根据体检编号获取一般体检数据(参数:体检编号;第三张图)
* @param greenGeneralInspecton
* @return
*/
@RequestMapping(value = "/generalInspectonInfo", method = RequestMethod.POST)
public @ResponseBody RestResult generalInspecton(@RequestBody Object requestBody) {
GreenGeneralInspecton greenGeneralInspecton = new ObjectMapper().convertValue(requestBody, new TypeReference<GreenGeneralInspecton>() {});
try {
if(greenGeneralInspecton.getTjId()!=null){
//获取一般的体检数据
String generalInspectonInfoSql ="SELECT u.real_name as realName, b.sex as sex,b.physical_date as physicalDate,i.* FROM GREEN_GENERAL_INSPECTON i LEFT JOIN GREEN_USER_INFO u ON i.user_id = u.id left join GREEN_PHYSICAL_BASE b ON i.tj_id=b.tj_id WHERE i.tj_id =? and i.physical_date=?";
List<GreenGeneralInspecton> generalInspectonInfo = hibernateDao.queryForListWithSql(generalInspectonInfoSql,new Object[] {greenGeneralInspecton.getTjId(),greenGeneralInspecton.getPhysicalDate()});
//greenOperateLogBizc.addLog(Constant.PHYSICAL, Constant.QUERY, Constant.OPERATE_SUCCESS, "查询体检列表", Constant.LOG_OPERATE, greenGeneralInspecton.getUserId());
return new RestResult(Constant.SUCCESS, "请求成功!",generalInspectonInfo);
}
return new RestResult(Constant.FAILED, "体检编号为空!");
} catch (Exception e) {
//greenOperateLogBizc.addLog(Constant.PHYSICAL, Constant.QUERY, Constant.OPERATE_FAIL, "查询体检列表", Constant.LOG_ERROR, greenGeneralInspecton.getUserId());
return new RestResult(Constant.FAILED,"返回异常");
}
}
}