|
@ -56,6 +56,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
@ -181,6 +182,50 @@ public class YkyyEntranceService {
|
|
|
public void updateBySql(String sql){
|
|
|
hibenateUtils.updateBySql(sql);
|
|
|
}
|
|
|
/**
|
|
|
* 同步科室信息
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray findDeptByYq(String yqFlag,String deptCode,String deptName)throws Exception{
|
|
|
String sql = "select code AS \"code\",name as \"name\",consultdeptflag as \"consultDeptFlag\",to_char(yjsy) as \"yjsy\" ,to_char(yqdm) as \"orgCode\" from V_HLW_KSXX where 1=1 and yjsy = 'Y'";
|
|
|
if (StringUtils.isNoneBlank(yqFlag)){
|
|
|
sql+=" and yqdm = '"+yqFlag+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(deptCode)){
|
|
|
sql+=" and code = '"+deptCode+"'";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(deptName)){
|
|
|
sql+=" and name like '%"+deptName+"%'";
|
|
|
}
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
params.put("sql",sql);
|
|
|
logger.info("findDeptByYq:"+sql);
|
|
|
HttpResponse response = HttpUtils.doGet(url,params);
|
|
|
String content = response.getContent();
|
|
|
logger.info("response:"+content);
|
|
|
JSONObject rs = JSON.parseObject(content);
|
|
|
Integer status = rs.getInteger("status");
|
|
|
if(status!=null&&status == 200){
|
|
|
JSONArray array = rs.getJSONArray("detailModelList");
|
|
|
logger.info("dept size:"+array.size());
|
|
|
if(array!=null&&array.size()>0){
|
|
|
for(int i=0;i<array.size();i++){
|
|
|
JSONObject deptjson = array.getJSONObject(i);
|
|
|
String orgCode = deptjson.getString("orgCode");
|
|
|
if ("1001".equalsIgnoreCase(orgCode)){
|
|
|
deptjson.put("orgName","思北院区");
|
|
|
}else {
|
|
|
deptjson.put("orgName","五缘院区");
|
|
|
}
|
|
|
}
|
|
|
return array;
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 同步科室信息
|
|
|
* @return
|
|
@ -1969,7 +2014,8 @@ public class YkyyEntranceService {
|
|
|
JSONObject deptobject = jsonArray.getJSONObject(0);
|
|
|
deptNo = deptobject.getString("dept");
|
|
|
}
|
|
|
ykEmrJcsqDO.setZxks(deptNo==null?0:Integer.parseInt(deptNo));
|
|
|
//ykEmrJcsqDO.setZxks(deptNo==null?0:Integer.parseInt(deptNo));
|
|
|
ykEmrJcsqDO.setZxks(wlyyInspectionDO.getDept()==null?0:Integer.parseInt(wlyyInspectionDO.getDept()));
|
|
|
ykEmrJcsqDO.setJcxm(wlyyInspectionDO.getName());
|
|
|
ykEmrJcsqDO.setXmdj(new BigDecimal(wlyyInspectionDO.getChargeAmount()));
|
|
|
ykEmrJcsqDO.setSqsl(wlyyInspectionDO.getQuantity());
|