|
@ -409,4 +409,42 @@ public class PrescriptionService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject checkRecipeNoPay(int type,String prescriptionCode) throws Exception{
|
|
|
String result = jwPrescriptionService.getDataStatus(type,prescriptionCode);
|
|
|
JSONObject statusObj = new JSONObject();
|
|
|
|
|
|
if(StringUtils.isNotBlank(result)){
|
|
|
JSONObject jsonobj = JSON.parseObject(result);
|
|
|
JSONObject statusInfon = jsonobj.getJSONObject("data");
|
|
|
Integer status = jsonobj.getInteger("status");
|
|
|
|
|
|
if(200 == status){
|
|
|
JSONArray ReturnData = statusInfon.getJSONArray("returnData");
|
|
|
if(ReturnData.size()!=0 && !ReturnData.isEmpty()) {
|
|
|
JSONObject data = ReturnData.getJSONArray(0).getJSONObject(0);
|
|
|
String code = data.getString("RECIPE_STATUS_CODE");
|
|
|
//如果基卫返回回来的处方状态为“作废”,code为9的时候,修改本地数据库
|
|
|
//处方状态为“线下取消”
|
|
|
if("9".equals(code)){
|
|
|
prescriptionDao.updateStatus(prescriptionCode,-5);
|
|
|
statusObj.put("status",200);
|
|
|
statusObj.put("code",200);
|
|
|
statusObj.put("message","基卫处方为作废,已修改本地数据库该处方为线下取消");
|
|
|
}else{
|
|
|
statusObj.put("status",200);
|
|
|
statusObj.put("code",data.getString("RECIPE_STATUS_CODE"));
|
|
|
statusObj.put("message",data.getString("RECIPE_STATUS_NAME"));
|
|
|
}
|
|
|
}
|
|
|
}else if (404 == status){
|
|
|
statusObj.put("status",404);
|
|
|
statusObj.put("message","没有找到相应的结果");
|
|
|
}else{
|
|
|
statusObj.put("status",0);
|
|
|
statusObj.put("message","操作失败!");
|
|
|
}
|
|
|
}
|
|
|
return statusObj;
|
|
|
}
|
|
|
}
|