|
@ -19,6 +19,7 @@ import com.yihu.jw.utils.ImgUtils;
|
|
|
import com.yihu.jw.utils.JSONUtils;
|
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
import com.yihu.jw.utils.encode.AESUtils;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
|
import com.ylzinfo.ehc.common.utils.DateUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@ -53,11 +54,14 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
|
|
|
@Autowired
|
|
|
private WlyyHospitalSysDictDao dictDao;
|
|
|
@Autowired
|
|
|
private HibenateUtils hibenateUtils;
|
|
|
|
|
|
static String userName = "xmykzx";
|
|
|
static String psw = "7j39c7";
|
|
|
static String appId = "ws022";
|
|
|
static String AesEncodeKey = "834irjf3jd39rh2m";
|
|
|
//http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?
|
|
|
static String urlString = "http://10.120.102.202:18081/micc/wsapi/1.0?wsdl"; // 正式线路径
|
|
|
// static String urlString = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?wsdl"; // 测试线路径
|
|
|
static String method = "execute";
|
|
@ -128,7 +132,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
jb.put("organ_name",orgName);
|
|
|
jb.put("corporation", "苏庆灿");
|
|
|
jb.put("no_pra_lic", "42660991-335020016A5122");
|
|
|
jb.put("second_organ_name", "");
|
|
|
jb.put("second_organ_name", "厦门眼科中心");
|
|
|
jb.put("charge_person", "");
|
|
|
|
|
|
jb.put("level", "1");
|
|
@ -263,6 +267,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
|
|
|
jb.put("third_compeny_prot", "");
|
|
|
|
|
|
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
jsonArray.add(jb);
|
|
|
|
|
@ -296,7 +301,8 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
" a.mobile AS \"mobile\"," +
|
|
|
" b.dept_code AS \"dept_code\"," +
|
|
|
" b.dept_name AS \"dept_name\"," +
|
|
|
" a.job_title_code AS \"job_title_code\"" +
|
|
|
" a.job_title_code AS \"job_title_code\"," +
|
|
|
" a.fzrq AS \"fzrq\"" +
|
|
|
" from base_doctor a " +
|
|
|
" ,base_doctor_hospital b" +
|
|
|
" where a.id = b.doctor_code" +
|
|
@ -322,7 +328,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
Boolean errorFlag = false;
|
|
|
JSONObject jb = new JSONObject();
|
|
|
try {
|
|
|
String[] dept = depToSubject("1090000");
|
|
|
String[] dept = depToSubject(jb.getString("dept_code"));
|
|
|
// 中山医院 监管平台 职务字典强转
|
|
|
String[] dutyInfo = classToduty(info.get("job_title_code").toString());
|
|
|
|
|
@ -335,10 +341,10 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
jb.put("birthday", info.get("birthday") == null?"1900-01-01": DateUtil.dateToStrLong((Date)info.get("birthday")));
|
|
|
jb.put("subject", dept[0].toString());
|
|
|
jb.put("subject_name", dept[1].toString());
|
|
|
jb.put("belong_dept","1090000");
|
|
|
jb.put("belong_dept_name", "眼科");
|
|
|
jb.put("belong_dept",jb.getString("dept_code"));
|
|
|
jb.put("belong_dept_name", jb.getString("dept_name"));
|
|
|
jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
|
|
|
// jb.put("title_rec_date", info.get("fzrq"));
|
|
|
jb.put("title_rec_date", info.get("fzrq"));
|
|
|
jb.put("prac_type", "1"); // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
|
|
|
jb.put("title_code", dutyInfo[0].toString()); // 需要与监管平台的字典进行映射
|
|
|
jb.put("first_compeny_code", orgCode);
|
|
@ -352,7 +358,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
jb.put("doc_cert",ImgUtils.getImageStr("D:"+ File.separator+"zstp"+File.separator+info.get("name")+File.separator+"zg.jpg"));
|
|
|
//执业证书
|
|
|
jb.put("cert_doc_prac", ImgUtils.getImageStr("D:"+ File.separator+"zstp"+File.separator+info.get("name")+File.separator+"zy.jpg"));
|
|
|
jb.put("txt_introduction", "");
|
|
|
jb.put("txt_introduction", "厦门大学附属厦门眼科中心成立于1997年11月8日,是集医疗、教学、科研、防盲为一体的三级甲等眼科医院、国家临床重点专科、国家药物临床试验机构。设有国家博士后科研工作站、院士专家工作站、全国住院医师规培基地、转化医学研究所等。");
|
|
|
|
|
|
}catch (Exception e){
|
|
|
errorFlag = true;
|
|
@ -1429,6 +1435,71 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
|
|
|
return resInfo;
|
|
|
}
|
|
|
|
|
|
public String upNsInvokeTotal(String startDate, String endDate,String keyId) throws Exception {
|
|
|
String url = getUrl();
|
|
|
String api = "micc.upNsInvokeTotal";
|
|
|
String upid = getCode();
|
|
|
String token = upNsUserToken(url);
|
|
|
String res = "";
|
|
|
int total = 0;
|
|
|
int success = 0;
|
|
|
int error = 0;
|
|
|
int dataError = 0;
|
|
|
|
|
|
String yyghSql = "SELECT " +
|
|
|
" count(1) AS \"yyghtotal\"" +
|
|
|
" FROM wlyy_outpatient p " +
|
|
|
" WHERE 1=1" ;
|
|
|
|
|
|
if(StringUtils.isNotBlank(startDate)){
|
|
|
yyghSql = yyghSql + " and reg.create_time >= '" + startDate + "' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endDate)){
|
|
|
yyghSql = yyghSql + " and reg.create_time < '" + endDate + "' ";
|
|
|
}
|
|
|
List<Map<String,Object>> yygh = hibenateUtils.createSQLQuery(yyghSql);
|
|
|
Long yyghtotal = 0L;
|
|
|
if(yyghtotal!=null){
|
|
|
//mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
|
|
|
yyghtotal = hibenateUtils.objTransformLong(yygh.get(0).get("yyghtotal"));
|
|
|
}
|
|
|
|
|
|
JSONObject jb = new JSONObject();
|
|
|
Boolean errorFlag = false;
|
|
|
try {
|
|
|
jb.put("id_ws_invoke_total",upid);
|
|
|
jb.put("organ_code", orgCode);
|
|
|
jb.put("organ_name",orgName);
|
|
|
jb.put("protocol_type", "1");
|
|
|
jb.put("protocol_name", "用户协议信息");
|
|
|
jb.put("upload_time", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
}catch (Exception e){
|
|
|
errorFlag = true;
|
|
|
saveErrorLog(upid,"13",upid,res,1);
|
|
|
dataError++;
|
|
|
logger.error(e.toString());
|
|
|
}
|
|
|
|
|
|
if(!errorFlag){
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
jsonArray.add(jb);
|
|
|
res = postToInter(token,api, jsonArray,url);
|
|
|
|
|
|
JSONObject resJson = (JSONObject) JSONObject.parse(res);
|
|
|
if("200".equals(resJson.get("msg").toString())){
|
|
|
success++;
|
|
|
}else{
|
|
|
saveErrorLog(upid,"13",upid,res,2);
|
|
|
error++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,上传失败 : " + error + "条。格式错误:"+dataError+"条。";
|
|
|
saveUpLog(upid,"13",DateUtil.stringToDate(startDate,"yyyy-MM-dd HH:mm:ss"),DateUtil.stringToDate(endDate,"yyyy-MM-dd HH:mm:ss"),success,error,dataError,resInfo);
|
|
|
return resInfo;
|
|
|
}
|
|
|
|
|
|
// 基于医生所在科室,转换成国家诊疗科目代码(中山医院专用)
|
|
|
// 当科室信息在列表中不存在的情况,全部配置为预防保健科
|
|
|
public static String[] depToSubject(String dep){
|