|
@ -4,6 +4,7 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.service.common.QrcodeService;
|
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
|
import com.yihu.wlyy.web.WeixinBaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@ -21,7 +22,8 @@ import java.io.OutputStream;
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/qrcode")
|
|
|
public class QrcodeController extends WeixinBaseController {
|
|
|
@Api(description = "二维码")
|
|
|
public class QrCodeController extends WeixinBaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private QrcodeService qrcodeService;
|
|
@ -116,7 +118,7 @@ public class QrcodeController extends WeixinBaseController {
|
|
|
@RequestMapping(value = "/hospital_img")
|
|
|
public void downloadSqQrcode(String hospital, HttpServletResponse response){
|
|
|
try{
|
|
|
File file = new File(QrcodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File.separator +"qrcode" + File.separator + hospital + ".png");
|
|
|
boolean flag = false;
|
|
|
if(!file.exists()){
|
|
@ -158,7 +160,7 @@ public class QrcodeController extends WeixinBaseController {
|
|
|
@RequestMapping(value = "/town_img")
|
|
|
public void downloadTownQrcode(String town, HttpServletResponse response){
|
|
|
try{
|
|
|
File file = new File(QrcodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File.separator +"qrcode" + File.separator + town + ".png");
|
|
|
boolean flag = false;
|
|
|
if(!file.exists()){
|
|
@ -207,7 +209,7 @@ public class QrcodeController extends WeixinBaseController {
|
|
|
qrcodeService.makeDoctorQrcode(doctor,getAccessToken());
|
|
|
doc = doctorService.findDoctorByCode(doctor);
|
|
|
}else{
|
|
|
File file = new File(QrcodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File.separator +"qrcode" + File.separator + doc.getQrcode());
|
|
|
|
|
|
if(!file.exists()){
|
|
@ -259,7 +261,7 @@ public class QrcodeController extends WeixinBaseController {
|
|
|
qrcodeService.makeDoctorQrcode(doctor,getAccessToken());
|
|
|
doc = doctorService.findDoctorByCode(doctor);
|
|
|
}else{
|
|
|
File file = new File(QrcodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
|
|
|
File.separator +"qrcode" + File.separator + doc.getQrcode());
|
|
|
|
|
|
if(!file.exists()){
|