|  | @ -6,7 +6,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 | 
												
													
														
															|  | import com.yihu.jw.entity.base.message.BaseMessageDO;
 |  | import com.yihu.jw.entity.base.message.BaseMessageDO;
 | 
												
													
														
															|  | import com.yihu.jw.entity.base.org.BaseOrgDO;
 |  | import com.yihu.jw.entity.base.org.BaseOrgDO;
 | 
												
													
														
															|  | import com.yihu.jw.internet.dao.IntUpErrorLogDao;
 |  | import com.yihu.jw.internet.dao.IntUpErrorLogDao;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.internet.dao.MedicalSkillOrdersDao;
 | 
												
													
														
															|  | import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
 |  | import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.internet.entity.MedicalSkillOrdersDO;
 | 
												
													
														
															|  | import com.yihu.jw.internet.wsapi.Wsapi;
 |  | import com.yihu.jw.internet.wsapi.Wsapi;
 | 
												
													
														
															|  | import com.yihu.jw.internet.wsapi.WsapiProxy;
 |  | import com.yihu.jw.internet.wsapi.WsapiProxy;
 | 
												
													
														
															|  | import com.yihu.jw.message.dao.MessageDao;
 |  | import com.yihu.jw.message.dao.MessageDao;
 | 
												
											
												
													
														
															|  | @ -31,6 +33,9 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
 | 
												
													
														
															|  |     @Autowired
 |  |     @Autowired
 | 
												
													
														
															|  |     private InternetUpErrorLogService internetUpErrorLogService;
 |  |     private InternetUpErrorLogService internetUpErrorLogService;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @Autowired
 | 
												
													
														
															|  | 
 |  |     private MedicalSkillOrdersDao medicalSkillOrdersDao;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     static String userName = "xmzsyy";
 |  |     static String userName = "xmzsyy";
 | 
												
													
														
															|  |     static String psw = "7j7s9e";
 |  |     static String psw = "7j7s9e";
 | 
												
													
														
															|  |     static String appId = "ws007";
 |  |     static String appId = "ws007";
 | 
												
											
												
													
														
															|  | @ -237,7 +242,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
 | 
												
													
														
															|  |         return res;
 |  |         return res;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     // 3 医师基本信息	micc.upNsDoctorRecord   --- 条件付完成  差医师的职务信息的适配未处理
 |  | 
 | 
												
													
														
															|  | 
 |  |     // 3 医师基本信息	micc.upNsDoctorRecord   --- 完成
 | 
												
													
														
															|  |     public String upNsDoctorRecord(String startDate, String endDate) throws Exception {
 |  |     public String upNsDoctorRecord(String startDate, String endDate) throws Exception {
 | 
												
													
														
															|  |         String api = "micc.upNsDoctorRecord";
 |  |         String api = "micc.upNsDoctorRecord";
 | 
												
													
														
															|  |         String res = "";
 |  |         String res = "";
 | 
												
											
												
													
														
															|  | @ -253,7 +258,9 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
 | 
												
													
														
															|  |                 "  from base_doctor a\n" +
 |  |                 "  from base_doctor a\n" +
 | 
												
													
														
															|  |                 "      ,base_doctor_hospital b\n" +
 |  |                 "      ,base_doctor_hospital b\n" +
 | 
												
													
														
															|  |                 " where a.id = b.doctor_code\n"  +
 |  |                 " where a.id = b.doctor_code\n"  +
 | 
												
													
														
															|  |                 "   and b.dept_code != '' \n" ;
 |  | 
 | 
												
													
														
															|  | 
 |  |                 "   and b.dept_code != '' \n" +
 | 
												
													
														
															|  | 
 |  |                 "   and b.doctor_duty_code  not in('4107','054','1313','1413','1415','018','1412','4105','1212','1312','4103','1315','1217','1215','3301','005',\n" +
 | 
												
													
														
															|  | 
 |  |                 "'1213','3501','017','020','058','002','1417','1214','1317','4101','4106') \n" ;
 | 
												
													
														
															|  |         if(startDate.length() > 0){
 |  |         if(startDate.length() > 0){
 | 
												
													
														
															|  |             sql =  sql + "  and a.update_time >=  '" + startDate + "' ";
 |  |             sql =  sql + "  and a.update_time >=  '" + startDate + "' ";
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -269,6 +276,8 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
 | 
												
													
														
															|  |             LinkedCaseInsensitiveMap info = (LinkedCaseInsensitiveMap)list.get(i);
 |  |             LinkedCaseInsensitiveMap info = (LinkedCaseInsensitiveMap)list.get(i);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             String[] dept = depToSubject(info.get("dept_code").toString());
 |  |             String[] dept = depToSubject(info.get("dept_code").toString());
 | 
												
													
														
															|  | 
 |  |             // 中山医院 监管平台  职务字典强转
 | 
												
													
														
															|  | 
 |  |             String[] dutyInfo = classToduty(info.get("doctor_duty_code").toString());
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             JSONObject jb = new JSONObject();
 |  |             JSONObject jb = new JSONObject();
 | 
												
													
														
															|  |             jb.put("organ_code", orgCode);
 |  |             jb.put("organ_code", orgCode);
 | 
												
											
												
													
														
															|  | @ -285,7 +294,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
 | 
												
													
														
															|  |             jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
 |  |             jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
 | 
												
													
														
															|  |             jb.put("title_rec_date", "1900-01-01");
 |  |             jb.put("title_rec_date", "1900-01-01");
 | 
												
													
														
															|  |             jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
 |  |             jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
 | 
												
													
														
															|  |             jb.put("title_code", "231");  // 需要与监管平台的字典进行映射
 |  | 
 | 
												
													
														
															|  | 
 |  |             jb.put("title_code", dutyInfo[0].toString());  // 需要与监管平台的字典进行映射
 | 
												
													
														
															|  |             jb.put("first_compeny_code", orgCode);
 |  |             jb.put("first_compeny_code", orgCode);
 | 
												
													
														
															|  |             jb.put("first_compeny_name", orgName);
 |  |             jb.put("first_compeny_name", orgName);
 | 
												
													
														
															|  |             jb.put("secd_compeny_code", "");
 |  |             jb.put("secd_compeny_code", "");
 | 
												
											
												
													
														
															|  | @ -399,35 +408,58 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
 | 
												
													
														
															|  |         return resInfo;
 |  |         return resInfo;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     // 6 在线医技预约 	micc.upMedicalOnline --- 无该业务,不对应
 |  | 
 | 
												
													
														
															|  |     public String upMedicalOnline() throws Exception {
 |  | 
 | 
												
													
														
															|  | 
 |  |     // 6 在线医技预约 	micc.upMedicalOnline --- 完成
 | 
												
													
														
															|  | 
 |  |     public String upMedicalOnline(String startDate, String endDate) throws Exception {
 | 
												
													
														
															|  |         String api = "micc.upMedicalOnline";
 |  |         String api = "micc.upMedicalOnline";
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         String token = upNsUserToken();
 |  |         String token = upNsUserToken();
 | 
												
													
														
															|  | 
 |  |         String res = "";
 | 
												
													
														
															|  | 
 |  |         int total = 0;
 | 
												
													
														
															|  | 
 |  |         int success = 0;
 | 
												
													
														
															|  | 
 |  |         int error = 0;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         JSONObject jb = new JSONObject();
 |  | 
 | 
												
													
														
															|  |         jb.put("id", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("cd_org", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("cd_area", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("cd_orgSub", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("app_time", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("app_dep_code", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("app_class_code", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("id_doctor", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("fg_handle", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("handle_time", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("pt_name", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("ge_code", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("card_type", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("id_no", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("pt_tel", "");
 |  | 
 | 
												
													
														
															|  |         jb.put("crt_date", "");
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         JSONArray jsonArray = new JSONArray();
 |  | 
 | 
												
													
														
															|  |         jsonArray.add(jb);
 |  | 
 | 
												
													
														
															|  |         String res = postToInter(token,api, jsonArray);
 |  | 
 | 
												
													
														
															|  | 
 |  |         List<MedicalSkillOrdersDO> medicalSkillOrdersDOs= medicalSkillOrdersDao.findMedicalSkillOrdersByAppTime(startDate,endDate);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         if(medicalSkillOrdersDOs != null && medicalSkillOrdersDOs.size() > 0){
 | 
												
													
														
															|  | 
 |  |             total = medicalSkillOrdersDOs.size();
 | 
												
													
														
															|  | 
 |  |             for(MedicalSkillOrdersDO medicalSkillOrdersDO :medicalSkillOrdersDOs ){
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                 String[] dept = depToSubject(medicalSkillOrdersDO.getAppDepCode().toString());
 | 
												
													
														
															|  | 
 |  |                 String docInterId = achNsDoctorRecord(medicalSkillOrdersDO.getIdDoctor());
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                 JSONObject jb = new JSONObject();
 | 
												
													
														
															|  | 
 |  |                 jb.put("id",orgCode + medicalSkillOrdersDO.getId());
 | 
												
													
														
															|  | 
 |  |                 jb.put("cd_org", orgCode);
 | 
												
													
														
															|  | 
 |  |                 jb.put("cd_area", orgArea);
 | 
												
													
														
															|  | 
 |  |                 jb.put("cd_orgSub", orgSub);
 | 
												
													
														
															|  | 
 |  |                 jb.put("app_time",medicalSkillOrdersDO.getAppTime().toString());
 | 
												
													
														
															|  | 
 |  |                 jb.put("app_dep_code", dept[0].toString());
 | 
												
													
														
															|  | 
 |  |                 jb.put("app_class_code", medicalSkillOrdersDO.getAppClassCode());
 | 
												
													
														
															|  | 
 |  |                 jb.put("id_doctor", docInterId);
 | 
												
													
														
															|  | 
 |  |                 jb.put("fg_handle", medicalSkillOrdersDO.getFgHandle());
 | 
												
													
														
															|  | 
 |  |                 jb.put("handle_time", medicalSkillOrdersDO.getHandleTime());
 | 
												
													
														
															|  | 
 |  |                 jb.put("pt_name", medicalSkillOrdersDO.getPtName());
 | 
												
													
														
															|  | 
 |  |                 jb.put("ge_code", medicalSkillOrdersDO.getGeCode());
 | 
												
													
														
															|  | 
 |  |                 jb.put("card_type", "1");
 | 
												
													
														
															|  | 
 |  |                 jb.put("id_no", medicalSkillOrdersDO.getIdNo());
 | 
												
													
														
															|  | 
 |  |                 jb.put("pt_tel", medicalSkillOrdersDO.getPtTel());
 | 
												
													
														
															|  | 
 |  |                 jb.put("crt_date",DateUtil.dateToStrLong(DateUtil.getNow()));
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                 JSONArray jsonArray = new JSONArray();
 | 
												
													
														
															|  | 
 |  |                 jsonArray.add(jb);
 | 
												
													
														
															|  | 
 |  |                 res = postToInter(token,api, jsonArray);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                 JSONObject resJson = (JSONObject) JSONObject.parse(res);
 | 
												
													
														
															|  | 
 |  |                 if("200".equals(resJson.get("msg").toString())){
 | 
												
													
														
															|  | 
 |  |                     success++;
 | 
												
													
														
															|  | 
 |  |                 }else{
 | 
												
													
														
															|  | 
 |  |                     saveErrorLog("6",medicalSkillOrdersDO.getId().toString(),res);
 | 
												
													
														
															|  | 
 |  |                     error++;
 | 
												
													
														
															|  | 
 |  |                 }
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         return res;
 |  | 
 | 
												
													
														
															|  | 
 |  |         String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,失败 : " + error + "条。";
 | 
												
													
														
															|  | 
 |  |         return resInfo;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     // 7 医生评价信息	micc.upNsDoctorScore  --- 完成
 |  |     // 7 医生评价信息	micc.upNsDoctorScore  --- 完成
 | 
												
											
												
													
														
															|  | @ -1061,5 +1093,105 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
 | 
												
													
														
															|  |         internetUpErrorLogService.save(internetUpErrorLogDO);
 |  |         internetUpErrorLogService.save(internetUpErrorLogDO);
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     // 基于中山医院的职务字典,强转为监管平台的字典(该部分过滤掉字典与监管理无法匹配的部分)
 | 
												
													
														
															|  | 
 |  |     public static  String[]  classToduty(String duty){
 | 
												
													
														
															|  | 
 |  |         String[] res = new String[2];
 | 
												
													
														
															|  | 
 |  |         switch (duty) {
 | 
												
													
														
															|  | 
 |  |             case "1303":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "243";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主管药师";
 | 
												
													
														
															|  | 
 |  |             case "1304":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "243";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主管药师";
 | 
												
													
														
															|  | 
 |  |             case "1101":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "231";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主任医师";
 | 
												
													
														
															|  | 
 |  |             case "065":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "231";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主任医师";
 | 
												
													
														
															|  | 
 |  |             case "1201":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "232";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "副主任医师";
 | 
												
													
														
															|  | 
 |  |             case "067":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "232";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "副主任医师";
 | 
												
													
														
															|  | 
 |  |             case "1301":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "233";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主治医师";
 | 
												
													
														
															|  | 
 |  |             case "066":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "233";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主治医师";
 | 
												
													
														
															|  | 
 |  |             case "1310":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "233";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主治医师";
 | 
												
													
														
															|  | 
 |  |             case "1401":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "234";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "医师";
 | 
												
													
														
															|  | 
 |  |             case "061":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "234";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "医师";
 | 
												
													
														
															|  | 
 |  |             case "1501":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "235";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "医士";
 | 
												
													
														
															|  | 
 |  |             case "1103":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "241";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主任药师";
 | 
												
													
														
															|  | 
 |  |             case "1104":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "241";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主任药师";
 | 
												
													
														
															|  | 
 |  |             case "1203":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "242";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "副主任药师";
 | 
												
													
														
															|  | 
 |  |             case "1403":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "244";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "药师";
 | 
												
													
														
															|  | 
 |  |             case "1404":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "244";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "药师";
 | 
												
													
														
															|  | 
 |  |             case "1503":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "245";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "药士";
 | 
												
													
														
															|  | 
 |  |             case "1102":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "251";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主任护师";
 | 
												
													
														
															|  | 
 |  |             case "1204":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "252";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "副主护师";
 | 
												
													
														
															|  | 
 |  |             case "1302":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "253";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主管护师";
 | 
												
													
														
															|  | 
 |  |             case "1402":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "254";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "护师";
 | 
												
													
														
															|  | 
 |  |             case "1502":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "255";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "护士";
 | 
												
													
														
															|  | 
 |  |             case "1107":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "261";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主任技师";
 | 
												
													
														
															|  | 
 |  |             case "1207":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "262";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "副主任技师";
 | 
												
													
														
															|  | 
 |  |             case "1307":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "263";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主管技师";
 | 
												
													
														
															|  | 
 |  |             case "056":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "263";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "主管技师";
 | 
												
													
														
															|  | 
 |  |             case "1407":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "264";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "技师";
 | 
												
													
														
															|  | 
 |  |             case "006":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "264";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "技师";
 | 
												
													
														
															|  | 
 |  |             case "053":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "264";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "技师";
 | 
												
													
														
															|  | 
 |  |             case "1202":
 | 
												
													
														
															|  | 
 |  |                 res[0] = "252";
 | 
												
													
														
															|  | 
 |  |                 res[1] = "副主护师";
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         return  res;
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | }
 |  | }
 |