Browse Source

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 years ago
parent
commit
71c451d788

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -77,6 +77,9 @@ public class PrescriptionExpressageService {
        prescriptionLog.setUserType(2);
        prescriptionLog.setType(100);
        prescriptionLogDao.save(prescriptionLog);
        //修改取药码code为已经使用
        prescriptionDispensaryCode.setIsUse(1);
        return 1;
    }
}

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionCodeController.java

@ -24,6 +24,8 @@ public class PrescriptionCodeController extends BaseController{
    @Autowired
    private PrescriptionDispensaryCodeService prescriptionDispensaryCodeService;
    @Autowired
    private PrescriptionExpressageService prescriptionExpressageService;
    /**
     * 显示居民所有的取药码列表
     * @param status 处方状态
@ -46,4 +48,26 @@ public class PrescriptionCodeController extends BaseController{
        return result.toString();
    }
    /**
     * 确认配送 二维码方式
     * 根据处方code获取处方流程
     *
     * @param code wlyy_prescription_dispensary_code的code
     * @return
     */
    @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) {
        try {
            Integer status = prescriptionExpressageService.expressage(code, getUID());
            if (status == -1) {
                return error(-1, "编码不存在");
            }
            return write(200, "配送成功");
        } catch (Exception e) {
            return error(-1, "失败");
        }
    }
}