|
@ -11,6 +11,7 @@ import io.swagger.annotations.ApiParam;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Map;
|
|
@ -19,9 +20,9 @@ import java.util.Map;
|
|
|
* Created by Trick on 2017/7/25.
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/doctor/prescriptionCode")
|
|
|
@RequestMapping(value = "/doctor/prescriptionCode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "医生端-长处方接口")
|
|
|
public class PrescriptionCodeController extends BaseController{
|
|
|
public class PrescriptionCodeController extends BaseController {
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@ -92,13 +93,13 @@ public class PrescriptionCodeController extends BaseController{
|
|
|
@RequestMapping(value = "/expressage", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "确认配送")
|
|
|
public String expressage(
|
|
|
@RequestParam(required = true) @ApiParam(value = "wlyy_prescription_dispensary_code的code", name = "code") String code) {
|
|
|
@ApiParam(required = true, name = "code", value = " 二维码code") @RequestParam(value = "code", required = true) String code) {
|
|
|
try {
|
|
|
Integer status = prescriptionExpressageService.expressage(code, getUID(),1);
|
|
|
Integer status = prescriptionExpressageService.expressage(code, getUID(), 1);
|
|
|
if (status == -1) {
|
|
|
return error(-1, "取药码错误");
|
|
|
}
|
|
|
return write(200, "配送成功","status",status);
|
|
|
return write(200, "配送成功", "status", status);
|
|
|
} catch (Exception e) {
|
|
|
return error(-1, "失败");
|
|
|
}
|
|
@ -106,17 +107,18 @@ public class PrescriptionCodeController extends BaseController{
|
|
|
|
|
|
/**
|
|
|
* 医生端获取取药码
|
|
|
*
|
|
|
* @param dispensaryCode
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/dispensaryCode/getDoctorDispensaryQrcode", method = RequestMethod.GET)
|
|
|
@ObserverRequired
|
|
|
public String getDoctorDispensaryQrcode(@RequestParam(value = "dispensaryCode",required = true) String dispensaryCode) {
|
|
|
public String getDoctorDispensaryQrcode(@RequestParam(value = "dispensaryCode", required = true) String dispensaryCode) {
|
|
|
|
|
|
try{
|
|
|
Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(dispensaryCode,getRepUID(),2);
|
|
|
try {
|
|
|
Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(dispensaryCode, getRepUID(), 2);
|
|
|
return write(200, "获取配送员取药码成功!", "data", map);
|
|
|
}catch (Exception e) {
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "获取配送员取药码失败!");
|
|
|
}
|
|
@ -124,17 +126,18 @@ public class PrescriptionCodeController extends BaseController{
|
|
|
|
|
|
/**
|
|
|
* 医生端获取配送码
|
|
|
*
|
|
|
* @param dispensaryCode
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/dispensaryCode/getDoctorDeliveryQrcode", method = RequestMethod.GET)
|
|
|
@ObserverRequired
|
|
|
public String getDoctorDeliveryQrcode(@RequestParam(value = "dispensaryCode",required = true) String dispensaryCode) {
|
|
|
public String getDoctorDeliveryQrcode(@RequestParam(value = "dispensaryCode", required = true) String dispensaryCode) {
|
|
|
|
|
|
try{
|
|
|
Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(dispensaryCode,getRepUID(),3);
|
|
|
try {
|
|
|
Map<String, Object> map = prescriptionDispensaryCodeService.getQrcode(dispensaryCode, getRepUID(), 3);
|
|
|
return write(200, "获取配送员配送码成功!", "data", map);
|
|
|
}catch (Exception e) {
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "获取配送员配送码失败!");
|
|
|
}
|