|
@ -1,19 +1,24 @@
|
|
package com.yihu.wlyy.controller.manager.datastatic;
|
|
package com.yihu.wlyy.controller.manager.datastatic;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
|
|
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
|
|
import com.yihu.wlyy.service.prescription.PrescriptionService;
|
|
import com.yihu.wlyy.service.prescription.PrescriptionService;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
import jxl.Workbook;
|
|
import jxl.Workbook;
|
|
import jxl.write.*;
|
|
import jxl.write.*;
|
|
|
|
import org.apache.http.NameValuePair;
|
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStream;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -24,9 +29,13 @@ import java.util.List;
|
|
@Controller
|
|
@Controller
|
|
@RequestMapping(value="/admin/static/prescription")
|
|
@RequestMapping(value="/admin/static/prescription")
|
|
public class PrescriptionStaticController extends BaseController {
|
|
public class PrescriptionStaticController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${reservation.zyurl}")
|
|
|
|
private String baseUrl;
|
|
@Autowired
|
|
@Autowired
|
|
private PrescriptionService prescriptionService;
|
|
private PrescriptionService prescriptionService;
|
|
|
|
@Autowired
|
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
|
|
|
//长处方统计管理*******************************
|
|
//长处方统计管理*******************************
|
|
@RequestMapping(value = "initial", method = RequestMethod.GET)
|
|
@RequestMapping(value = "initial", method = RequestMethod.GET)
|
|
@ -170,4 +179,33 @@ public class PrescriptionStaticController extends BaseController {
|
|
}
|
|
}
|
|
ws.addCell(label);
|
|
ws.addCell(label);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取长处方状态
|
|
|
|
@RequestMapping(value = "getDataStatus/{prescription_code}",method = RequestMethod.GET)
|
|
|
|
public String DataStatus(@PathVariable(value = "prescription_code") String prescription_code){
|
|
|
|
return "prescription/prescription_status";
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "getDataStatus")
|
|
|
|
@ResponseBody
|
|
|
|
public String getDataStatus(
|
|
|
|
@ApiParam(name = "prescriptionCode", value = "长处方单号")
|
|
|
|
@RequestParam(value = "prescriptionCode") String prescriptionCode){
|
|
|
|
try {
|
|
|
|
String url = baseUrl + "/third/prescription/getDataStatus";
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
|
params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
|
|
|
|
params.add(new BasicNameValuePair("type", "2"));
|
|
|
|
String response = httpClientUtil.post(url, params, "UTF-8");
|
|
|
|
// String response = "{\"status\":200,\"msg\":\"查询成功!\",\"data\":\"{\\\"CODE\\\":\\\"1\\\",\\\"returnData\\\":[[{\\\"RECIPE_NO\\\":43861978,\\\"RECIPE_STATUS_CODE\\\":5,\\\"RECIPE_STATUS_NAME\\\":\\\"已执行\\\",\\\"CHARGE_STATUS_CODE\\\":5,\\\"CHARGE_STATUS_NAME\\\":\\\"已扣费\\\"}]],\\\"byRefParaData\\\":[]}\"}";
|
|
|
|
JSONObject res = JSONObject.parseObject(response);
|
|
|
|
//从JSONObject对象里取出key是data的对象
|
|
|
|
JSONObject data = res.getJSONObject("data").getJSONArray("returnData").getJSONArray(0).getJSONObject(0);
|
|
|
|
return write(200,"success","data",data);
|
|
|
|
}catch (Exception e){
|
|
|
|
error(e);
|
|
|
|
return error(-1,"操作失败!");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|