|
@ -1006,117 +1006,126 @@ public class YkyyEntranceService {
|
|
|
|
|
|
public WlyyPrescriptionVO synPrecriptionHis(WlyyPrescriptionVO wlyyPrescriptionVO,String code) throws Exception {
|
|
public WlyyPrescriptionVO synPrecriptionHis(WlyyPrescriptionVO wlyyPrescriptionVO,String code) throws Exception {
|
|
HlwCf01DO hlwCf01DO = new HlwCf01DO();
|
|
HlwCf01DO hlwCf01DO = new HlwCf01DO();
|
|
|
|
logger.info("开始===================");
|
|
if (wlyyPrescriptionVO!=null){
|
|
if (wlyyPrescriptionVO!=null){
|
|
hlwCf01DO.setSPZT(0);
|
|
|
|
hlwCf01DO.setFKZT(wlyyPrescriptionVO.getPayStatus());
|
|
|
|
hlwCf01DO.setYFSB(3);
|
|
|
|
hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
|
|
|
|
hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
|
|
|
|
hlwCf01DO.setZFPB(0);
|
|
|
|
hlwCf01DO.setFYBZ(0);
|
|
|
|
hlwCf01DO.setPYBZ(0);
|
|
|
|
hlwCf01DO.setDJYBZ(0);
|
|
|
|
hlwCf01DO.setCFTS(1);
|
|
|
|
hlwCf01DO.setYXPB(1);
|
|
|
|
hlwCf01DO.setDYBZ(0);
|
|
|
|
hlwCf01DO.setTSCF(0);
|
|
|
|
hlwCf01DO.setTYBZ(0);
|
|
|
|
hlwCf01DO.setTSLX(6);
|
|
|
|
hlwCf01DO.setCFBZ(0);
|
|
|
|
hlwCf01DO.setJZXH(0);
|
|
|
|
hlwCf01DO.setYXPB(0);
|
|
|
|
hlwCf01DO.setLSCFBZ(0);
|
|
|
|
hlwCf01DO.setZJFLAG(0);
|
|
|
|
hlwCf01DO.setLSCFBZ(0);
|
|
|
|
hlwCf01DO.setZJFLAG(0);
|
|
|
|
hlwCf01DO.setFKZT(1);
|
|
|
|
hlwCf01DO.setSCDDH(wlyyPrescriptionVO.getOrderNo());
|
|
|
|
String patient = wlyyPrescriptionVO.getPatientCode();
|
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
|
|
|
|
hlwCf01DO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
|
|
|
|
hlwCf01DO.setBRXM(wlyyPrescriptionVO.getPatientName());
|
|
|
|
hlwCf01DO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
|
|
|
|
String doctor = wlyyPrescriptionVO.getDoctor();
|
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
|
|
hlwCf01DO.setYSDM(doctorMappingDO.getMappingCode());
|
|
|
|
hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
|
|
|
|
hlwCf01DO.setGUID(getCode());
|
|
|
|
hlwCf01DO.setSJLY(1);
|
|
|
|
hlwCf01DO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
|
|
|
|
/* hibenateUtils.save(hlwCf01DO);*/
|
|
|
|
|
|
|
|
String jsonString = JSONObject.toJSONString(hlwCf01DO);
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
|
params.put("json",jsonString);
|
|
|
|
params.put("table","HLW_CF01");
|
|
|
|
logger.info("HLW_CF01:"+jsonString);
|
|
|
|
HttpResponse response = HttpUtils.doGet(saveUrl,params);
|
|
|
|
if (response.getStatus()==200){
|
|
|
|
logger.info("content"+response.getContent());
|
|
|
|
String content = response.getContent();
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(content);
|
|
|
|
JSONObject object = jsonObject.getJSONObject("obj");
|
|
|
|
if (object!=null){
|
|
|
|
String cfsb = object.getString("cfsb");
|
|
|
|
List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(code);
|
|
|
|
if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
|
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
|
|
|
|
wlyyPrescriptionDO.setRealOrder(cfsb);
|
|
|
|
prescriptionDao.save(wlyyPrescriptionDO);
|
|
|
|
|
|
try {
|
|
|
|
hlwCf01DO.setSPZT(0);
|
|
|
|
hlwCf01DO.setFKZT(wlyyPrescriptionVO.getPayStatus());
|
|
|
|
hlwCf01DO.setYFSB(3);
|
|
|
|
hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
|
|
|
|
hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
|
|
|
|
hlwCf01DO.setZFPB(0);
|
|
|
|
hlwCf01DO.setFYBZ(0);
|
|
|
|
hlwCf01DO.setPYBZ(0);
|
|
|
|
hlwCf01DO.setDJYBZ(0);
|
|
|
|
hlwCf01DO.setCFTS(1);
|
|
|
|
hlwCf01DO.setYXPB(1);
|
|
|
|
hlwCf01DO.setDYBZ(0);
|
|
|
|
hlwCf01DO.setTSCF(0);
|
|
|
|
hlwCf01DO.setTYBZ(0);
|
|
|
|
hlwCf01DO.setTSLX(6);
|
|
|
|
hlwCf01DO.setCFBZ(0);
|
|
|
|
hlwCf01DO.setJZXH(0);
|
|
|
|
hlwCf01DO.setYXPB(0);
|
|
|
|
hlwCf01DO.setLSCFBZ(0);
|
|
|
|
hlwCf01DO.setZJFLAG(0);
|
|
|
|
hlwCf01DO.setLSCFBZ(0);
|
|
|
|
hlwCf01DO.setZJFLAG(0);
|
|
|
|
hlwCf01DO.setFKZT(1);
|
|
|
|
hlwCf01DO.setSCDDH(wlyyPrescriptionVO.getOrderNo());
|
|
|
|
String patient = wlyyPrescriptionVO.getPatientCode();
|
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
|
|
|
|
hlwCf01DO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
|
|
|
|
hlwCf01DO.setBRXM(wlyyPrescriptionVO.getPatientName());
|
|
|
|
hlwCf01DO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
|
|
|
|
String doctor = wlyyPrescriptionVO.getDoctor();
|
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
|
|
|
|
hlwCf01DO.setYSDM(doctorMappingDO.getMappingCode());
|
|
|
|
hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
|
|
|
|
hlwCf01DO.setGUID(getCode());
|
|
|
|
hlwCf01DO.setSJLY(1);
|
|
|
|
hlwCf01DO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
|
|
|
|
/* hibenateUtils.save(hlwCf01DO);*/
|
|
|
|
|
|
|
|
String jsonString = JSONObject.toJSONString(hlwCf01DO);
|
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
|
params.put("json",jsonString);
|
|
|
|
params.put("table","HLW_CF01");
|
|
|
|
logger.info("HLW_CF01:"+jsonString);
|
|
|
|
HttpResponse response = HttpUtils.doGet(saveUrl,params);
|
|
|
|
String cfsb = "";
|
|
|
|
if (response.getStatus()==200){
|
|
|
|
logger.info("content"+response.getContent());
|
|
|
|
String content = response.getContent();
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(content);
|
|
|
|
JSONObject object = jsonObject.getJSONObject("obj");
|
|
|
|
if (object!=null){
|
|
|
|
cfsb = object.getString("cfsb");
|
|
|
|
List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(code);
|
|
|
|
if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
|
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
|
|
|
|
wlyyPrescriptionDO.setRealOrder(cfsb);
|
|
|
|
wlyyPrescriptionVO.setRealOrder(cfsb);
|
|
|
|
prescriptionDao.save(wlyyPrescriptionDO);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
logger.info("表HLW_CF01同步成功!");
|
|
|
|
|
|
logger.info("表HLW_CF01同步成功!");
|
|
|
|
|
|
}else {
|
|
|
|
logger.info("表HLW_CF01同步失败!"+response.getErrorMsg());
|
|
|
|
}
|
|
|
|
logger.info("处方:"+wlyyPrescriptionVO);
|
|
|
|
List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS =wlyyPrescriptionVO.getInfoVOs();
|
|
|
|
for (WlyyPrescriptionInfoVO wlyyPrescriptionInfoVO:wlyyPrescriptionInfoVOS){
|
|
|
|
try {
|
|
|
|
logger.info("chufang1============");
|
|
|
|
HlwCf02DO hlwCf02DO = new HlwCf02DO();
|
|
|
|
hlwCf02DO.setCFSB(Integer.parseInt(wlyyPrescriptionVO.getRealOrder()));
|
|
|
|
hlwCf02DO.setYPXH(Integer.parseInt(wlyyPrescriptionInfoVO.getDrugNo()));
|
|
|
|
logger.info("drugNo"+hlwCf02DO.getYPXH());
|
|
|
|
hlwCf02DO.setYPCD(Integer.parseInt(wlyyPrescriptionInfoVO.getDrugPlace()));
|
|
|
|
hlwCf02DO.setXMLX(1);
|
|
|
|
hlwCf02DO.setCFTS(1);
|
|
|
|
hlwCf02DO.setYPSL(Double.parseDouble(wlyyPrescriptionInfoVO.getQuantity()));
|
|
|
|
hlwCf02DO.setYPDJ(wlyyPrescriptionInfoVO.getPackRetprice());
|
|
|
|
hlwCf02DO.setHJJE(Integer.parseInt(wlyyPrescriptionInfoVO.getQuantity())*wlyyPrescriptionInfoVO.getPackRetprice());//划价价额
|
|
|
|
hlwCf02DO.setYPZS(1);//药品组数 待确定
|
|
|
|
hlwCf02DO.setYCSL("0");
|
|
|
|
hlwCf02DO.setFYGB(17);//费用归并
|
|
|
|
hlwCf02DO.setZFBL(1.0);//自负比例
|
|
|
|
hlwCf02DO.setYFDW(wlyyPrescriptionInfoVO.getPackUnitName());
|
|
|
|
hlwCf02DO.setMRCS(Integer.parseInt(wlyyPrescriptionInfoVO.getDosage()));//每日次数
|
|
|
|
hlwCf02DO.setYFBZ(wlyyPrescriptionInfoVO.getPackQuantity());
|
|
|
|
hlwCf02DO.setYPYF(wlyyPrescriptionInfoVO.getUsageCode());
|
|
|
|
hlwCf02DO.setGYTJ(wlyyPrescriptionInfoVO.getYpyf());
|
|
|
|
hlwCf02DO.setPSPB(0);
|
|
|
|
hlwCf02DO.setYYTS(1);
|
|
|
|
/*hlwCf02DO.setYPZH(Integer.parseInt(wlyyPrescriptionInfoVO.getFrequency()));*/
|
|
|
|
hlwCf02DO.setYFGG(wlyyPrescriptionInfoVO.getSpecification());
|
|
|
|
/* hibenateUtils.save(hlwCf02DO);*/
|
|
|
|
String jsonString1 = JSONObject.toJSONString(hlwCf02DO);
|
|
|
|
logger.info("chufang2============");
|
|
|
|
Map<String,Object> params1 = new HashedMap();
|
|
|
|
params1.put("json",jsonString1);
|
|
|
|
params1.put("table","HLW_CF02");
|
|
|
|
logger.info("HLW_CF02:"+jsonString1);
|
|
|
|
HttpResponse response1 = HttpUtils.doGet(saveUrl,params1);
|
|
|
|
if (response1.getStatus()==200){
|
|
|
|
logger.info("表HLW_CF02同步成功!");
|
|
|
|
}else {
|
|
}else {
|
|
logger.info("表HLW_CF02同步失败!"+response1.getErrorMsg());
|
|
|
|
|
|
logger.info("表HLW_CF01同步失败!"+response.getErrorMsg());
|
|
|
|
}
|
|
|
|
logger.info("处方:"+wlyyPrescriptionVO);
|
|
|
|
if (!StringUtils.isNoneBlank(cfsb)){
|
|
|
|
throw new Exception("添加失败");
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
e.getMessage();
|
|
|
|
|
|
List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS =wlyyPrescriptionVO.getInfoVOs();
|
|
|
|
for (WlyyPrescriptionInfoVO wlyyPrescriptionInfoVO:wlyyPrescriptionInfoVOS){
|
|
|
|
try {
|
|
|
|
logger.info("chufang1============");
|
|
|
|
HlwCf02DO hlwCf02DO = new HlwCf02DO();
|
|
|
|
hlwCf02DO.setCFSB(Integer.parseInt(cfsb));
|
|
|
|
hlwCf02DO.setYPXH(Integer.parseInt(wlyyPrescriptionInfoVO.getDrugNo()));
|
|
|
|
logger.info("drugNo"+hlwCf02DO.getYPXH());
|
|
|
|
hlwCf02DO.setYPCD(Integer.parseInt(wlyyPrescriptionInfoVO.getDrugPlace()));
|
|
|
|
hlwCf02DO.setXMLX(1);
|
|
|
|
hlwCf02DO.setCFTS(1);
|
|
|
|
hlwCf02DO.setYPSL(Double.parseDouble(wlyyPrescriptionInfoVO.getQuantity()));
|
|
|
|
hlwCf02DO.setYPDJ(wlyyPrescriptionInfoVO.getPackRetprice());
|
|
|
|
hlwCf02DO.setHJJE(Integer.parseInt(wlyyPrescriptionInfoVO.getQuantity())*wlyyPrescriptionInfoVO.getPackRetprice());//划价价额
|
|
|
|
hlwCf02DO.setYPZS(1);//药品组数 待确定
|
|
|
|
hlwCf02DO.setYCSL("0");
|
|
|
|
hlwCf02DO.setFYGB(17);//费用归并
|
|
|
|
hlwCf02DO.setZFBL(1.0);//自负比例
|
|
|
|
hlwCf02DO.setYFDW(wlyyPrescriptionInfoVO.getPackUnitName());
|
|
|
|
hlwCf02DO.setMRCS(Integer.parseInt(wlyyPrescriptionInfoVO.getDosage()));//每日次数
|
|
|
|
hlwCf02DO.setYFBZ(wlyyPrescriptionInfoVO.getPackQuantity());
|
|
|
|
hlwCf02DO.setYPYF(wlyyPrescriptionInfoVO.getUsageCode());
|
|
|
|
hlwCf02DO.setGYTJ(wlyyPrescriptionInfoVO.getYpyf());
|
|
|
|
hlwCf02DO.setPSPB(0);
|
|
|
|
hlwCf02DO.setYYTS(1);
|
|
|
|
/*hlwCf02DO.setYPZH(Integer.parseInt(wlyyPrescriptionInfoVO.getFrequency()));*/
|
|
|
|
hlwCf02DO.setYFGG(wlyyPrescriptionInfoVO.getSpecification());
|
|
|
|
/* hibenateUtils.save(hlwCf02DO);*/
|
|
|
|
String jsonString1 = JSONObject.toJSONString(hlwCf02DO);
|
|
|
|
logger.info("chufang2============");
|
|
|
|
Map<String,Object> params1 = new HashedMap();
|
|
|
|
params1.put("json",jsonString1);
|
|
|
|
params1.put("table","HLW_CF02");
|
|
|
|
logger.info("HLW_CF02:"+jsonString1);
|
|
|
|
HttpResponse response1 = HttpUtils.doGet(saveUrl,params1);
|
|
|
|
if (response1.getStatus()==200){
|
|
|
|
logger.info("表HLW_CF02同步成功!");
|
|
|
|
}else {
|
|
|
|
logger.info("表HLW_CF02同步失败!"+response1.getErrorMsg());
|
|
|
|
}
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
e.getMessage();
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|