80 lines
3.1 KiB
Plaintext
80 lines
3.1 KiB
Plaintext
|
|
package com.nationalelectric.greenH5;
|
|||
|
|
|
|||
|
|
import java.util.HashMap;
|
|||
|
|
import java.util.List;
|
|||
|
|
import java.util.Map;
|
|||
|
|
|
|||
|
|
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.jdbc.core.BeanPropertyRowMapper;
|
|||
|
|
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.IGreenMinorItemBizc;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenMinorItem;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenPhysicalItem;
|
|||
|
|
import com.sgcc.uap.bizc.sysbizc.datadictionary.IDataDictionaryBizC;
|
|||
|
|
import com.sgcc.uap.mdd.runtime.meta.IMetadataService;
|
|||
|
|
import com.sgcc.uap.mdd.runtime.utils.HttpMessageConverter;
|
|||
|
|
import com.sgcc.uap.mdd.runtime.validate.IValidateService;
|
|||
|
|
import com.sgcc.uap.persistence.IHibernateDao;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* <b>概述</b>:<br>
|
|||
|
|
*
|
|||
|
|
* <p>
|
|||
|
|
* <b>功能</b>:<br>
|
|||
|
|
*
|
|||
|
|
*
|
|||
|
|
* @author Administrator
|
|||
|
|
*/
|
|||
|
|
@Controller
|
|||
|
|
@RequestMapping("/greenMinorItem")
|
|||
|
|
public class GreenMinorItemController {
|
|||
|
|
/**
|
|||
|
|
* HibernateDao逻辑构件
|
|||
|
|
*/
|
|||
|
|
@Autowired
|
|||
|
|
IHibernateDao hibernateDao;
|
|||
|
|
/***
|
|||
|
|
* 根据大项的流水号获取细项数据(第四张图)
|
|||
|
|
*/
|
|||
|
|
@RequestMapping(value = "/minorItemInfo", method = RequestMethod.POST)
|
|||
|
|
public @ResponseBody RestResult getMinorItemInfo(@RequestBody Object requestBody) {
|
|||
|
|
|
|||
|
|
GreenMinorItem greenMinorItem = new ObjectMapper().convertValue(requestBody, new TypeReference<GreenMinorItem>() {});
|
|||
|
|
if(greenMinorItem.getNoteId()!=null){
|
|||
|
|
String noteid=greenMinorItem.getNoteId();
|
|||
|
|
//获取细项的详情
|
|||
|
|
String minorItemInfoSql ="SELECT * FROM GREEN_MINOR_ITEM WHERE note_id=?";
|
|||
|
|
List<GreenMinorItem> greenMinorItemInfo = hibernateDao.queryForListWithSql(minorItemInfoSql,new Object[] {noteid},new BeanPropertyRowMapper<GreenMinorItem>(GreenMinorItem.class));
|
|||
|
|
//获取细项的异常数量
|
|||
|
|
String illGignCountSql ="SELECT count(*) FROM GREEN_MINOR_ITEM WHERE note_id=? and ill_sign=1";
|
|||
|
|
int illGignCount=hibernateDao.queryForIntWithSql(illGignCountSql,new Object[] {noteid});
|
|||
|
|
String physicalItemSql="SELECT * FROM GREEN_PHYSICAL_ITEM WHERE note_id=?";
|
|||
|
|
//获取西项的检查结论
|
|||
|
|
List<GreenPhysicalItem> physicalItemList =hibernateDao.queryForListWithSql(physicalItemSql,new Object[] {noteid},new BeanPropertyRowMapper(GreenPhysicalItem.class));
|
|||
|
|
String briefSummary=physicalItemList.get(0).getBriefSummary();
|
|||
|
|
Map<Object, Object> map = new HashMap<Object, Object>();
|
|||
|
|
map.put("greenMinorItemInfo", greenMinorItemInfo);
|
|||
|
|
map.put("illGignCount", illGignCount);
|
|||
|
|
map.put("briefSummary", briefSummary);
|
|||
|
|
return new RestResult(Constant.SUCCESS, "请求成功!",map);
|
|||
|
|
}
|
|||
|
|
return new RestResult(Constant.FAILED, "体检流水号为空!");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|