|
@ -1,5 +1,7 @@
|
|
package com.yihu.wlyy.web.patient.prescription;
|
|
package com.yihu.wlyy.web.patient.prescription;
|
|
|
|
|
|
|
|
import com.yihu.wlyy.entity.charge.PatientPopups;
|
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.service.app.prescription.PatientPrescriptionPayService;
|
|
import com.yihu.wlyy.service.app.prescription.PatientPrescriptionPayService;
|
|
import com.yihu.wlyy.service.app.prescription.PrescriptionAdressService;
|
|
import com.yihu.wlyy.service.app.prescription.PrescriptionAdressService;
|
|
import com.yihu.wlyy.service.app.prescription.PrescriptionNoticesService;
|
|
import com.yihu.wlyy.service.app.prescription.PrescriptionNoticesService;
|
|
@ -9,6 +11,7 @@ import com.yihu.wlyy.web.WeixinBaseController;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
@ -19,6 +22,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import static com.yihu.wlyy.interceptors.GateWayInterceptor.status;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by Reece on 2017/7/28.
|
|
* Created by Reece on 2017/7/28.
|
|
*/
|
|
*/
|
|
@ -215,24 +220,26 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
|
|
return error(-1, "发送失败!");
|
|
return error(-1, "发送失败!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//===========================v1.3.9======================================================================
|
|
|
|
|
|
|
|
|
|
//===========================v1.3.9======================================================================
|
|
@RequestMapping(value = "/getAddressList", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/getAddressList", method = RequestMethod.POST)
|
|
@ApiOperation(value = "获取患者所有地址")
|
|
@ApiOperation(value = "获取患者所有地址")
|
|
public String getAdressList( @ApiParam(name = "patient", value = "居民code")
|
|
|
|
@RequestParam(value = "patient", required = true)String patient){
|
|
|
|
|
|
public String getAdressList(@ApiParam(name = "patient", value = "居民code")
|
|
|
|
@RequestParam(value = "patient", required = true) String patient) {
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200, "获取成功!","data",prescriptionAdressService.getAdressList(patient));
|
|
|
|
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getAdressList(patient));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return error(-1, "获取失败!");
|
|
return error(-1, "获取失败!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getDefAddress", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/getDefAddress", method = RequestMethod.POST)
|
|
@ApiOperation(value = "获取患者默认地址")
|
|
@ApiOperation(value = "获取患者默认地址")
|
|
public String getDefAdress(String patient){
|
|
|
|
|
|
public String getDefAdress(String patient) {
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200, "获取成功!","data",prescriptionAdressService.getDefAdress(patient));
|
|
|
|
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getDefAdress(patient));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
return error(-1, "发送失败!");
|
|
return error(-1, "发送失败!");
|
|
@ -242,7 +249,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
|
|
@RequestMapping(value = "/saveAddress", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/saveAddress", method = RequestMethod.POST)
|
|
@ApiOperation(value = "保存地址")
|
|
@ApiOperation(value = "保存地址")
|
|
public String saveAdress(@ApiParam(name = "addressJson", value = "实体json串")
|
|
public String saveAdress(@ApiParam(name = "addressJson", value = "实体json串")
|
|
@RequestParam(value = "addressJson", required = true)String addressJson){
|
|
|
|
|
|
@RequestParam(value = "addressJson", required = true) String addressJson) {
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.saveAdress(addressJson));
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.saveAdress(addressJson));
|
|
@ -251,10 +258,11 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
|
|
return error(-1, "获取失败!");
|
|
return error(-1, "获取失败!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/delAddress", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/delAddress", method = RequestMethod.POST)
|
|
@ApiOperation(value = "删除地址")
|
|
@ApiOperation(value = "删除地址")
|
|
public String delAdress(@ApiParam(name = "id", value = "主键")
|
|
public String delAdress(@ApiParam(name = "id", value = "主键")
|
|
@RequestParam(value = "id", required = true)Long id){
|
|
|
|
|
|
@RequestParam(value = "id", required = true) Long id) {
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.delAdress(id));
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.delAdress(id));
|
|
@ -266,7 +274,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
|
|
|
|
|
|
@RequestMapping(value = "/getProvince", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/getProvince", method = RequestMethod.POST)
|
|
@ApiOperation(value = "获取省会")
|
|
@ApiOperation(value = "获取省会")
|
|
public String getProvince(){
|
|
|
|
|
|
public String getProvince() {
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getProvince());
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getProvince());
|
|
@ -279,7 +287,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
|
|
@RequestMapping(value = "/getCityByProvince", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/getCityByProvince", method = RequestMethod.POST)
|
|
@ApiOperation(value = "根据省会获取城市")
|
|
@ApiOperation(value = "根据省会获取城市")
|
|
public String getCityByProvince(@ApiParam(name = "province", value = "省会code")
|
|
public String getCityByProvince(@ApiParam(name = "province", value = "省会code")
|
|
@RequestParam(value = "province", required = true)String province){
|
|
|
|
|
|
@RequestParam(value = "province", required = true) String province) {
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getCityByProvince(province));
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getCityByProvince(province));
|
|
@ -292,7 +300,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
|
|
@RequestMapping(value = "/getTowmByCity", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/getTowmByCity", method = RequestMethod.POST)
|
|
@ApiOperation(value = "根据城市获取区")
|
|
@ApiOperation(value = "根据城市获取区")
|
|
public String getTowmByCity(@ApiParam(name = "city", value = "城市code")
|
|
public String getTowmByCity(@ApiParam(name = "city", value = "城市code")
|
|
@RequestParam(value = "city", required = true)String city){
|
|
|
|
|
|
@RequestParam(value = "city", required = true) String city) {
|
|
try {
|
|
try {
|
|
|
|
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getTowmByCity(city));
|
|
return write(200, "获取成功!", "data", prescriptionAdressService.getTowmByCity(city));
|
|
@ -301,4 +309,73 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
|
|
return error(-1, "获取失败!");
|
|
return error(-1, "获取失败!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保存居民支付弹窗设置
|
|
|
|
*
|
|
|
|
* @param type 弹窗类型(0:签约支付 1续方支付)
|
|
|
|
* @param status 弹出状态(0不弹出 1弹出)
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/savePopups", method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "保存居民支付弹窗设置")
|
|
|
|
public String savePopups(@ApiParam(name = "type", value = "弹窗类型")
|
|
|
|
@RequestParam(value = "type", required = true) int type,
|
|
|
|
@ApiParam(name = "status", value = "弹窗状态")
|
|
|
|
@RequestParam(value = "status", required = true) String status) {
|
|
|
|
try {
|
|
|
|
payService.savePopups(type, getUID(), status);
|
|
|
|
return write(200, "保存成功!");
|
|
|
|
} catch (Exception e) {
|
|
|
|
error(e);
|
|
|
|
return error(-1, "保存失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询居民支付弹窗设置
|
|
|
|
*
|
|
|
|
* @param type 弹窗类型(0:签约支付 1续方支付)
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/getPopups", method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "查询居民支付弹窗设置")
|
|
|
|
public String getPopups(@ApiParam(name = "type", value = "弹窗类型")
|
|
|
|
@RequestParam(value = "type", required = true) int type) {
|
|
|
|
try {
|
|
|
|
String status = "1";
|
|
|
|
PatientPopups popups = payService.getPopups(type, getUID());
|
|
|
|
if (popups != null) {
|
|
|
|
status = popups.getStatus();
|
|
|
|
return write(200, "查询成功!", "data", status);
|
|
|
|
} else {
|
|
|
|
return write(200, "该居民未设置弹窗!", "data", status);
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
error(e);
|
|
|
|
return error(-1, "查询失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询缴费居民手机绑定情况
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/getPatientMobile", method = RequestMethod.GET)
|
|
|
|
@ApiOperation(value = "查询缴费居民手机绑定情况")
|
|
|
|
public String getPatientMobile() {
|
|
|
|
try {
|
|
|
|
String status = "1";
|
|
|
|
String mobile = payService.getPatientMobile(getRepUID());
|
|
|
|
if (StringUtils.isEmpty(mobile)){
|
|
|
|
status = "0";
|
|
|
|
}
|
|
|
|
return write(200, "查询成功!", "data", status);
|
|
|
|
} catch (Exception e) {
|
|
|
|
error(e);
|
|
|
|
return error(-1, "查询失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|