|
@@ -23,6 +23,7 @@ import com.fs.his.param.PrescribePhoneParam;
|
|
|
import com.fs.his.service.IFsDoctorPatientService;
|
|
import com.fs.his.service.IFsDoctorPatientService;
|
|
|
import com.fs.his.service.IFsPrescribeDataScrmService;
|
|
import com.fs.his.service.IFsPrescribeDataScrmService;
|
|
|
import com.fs.his.service.IFsPrescribeService;
|
|
import com.fs.his.service.IFsPrescribeService;
|
|
|
|
|
+import com.fs.hisStore.dto.CreatePhoneQRCodeDTO;
|
|
|
import com.fs.hisStore.param.FsCompanyCustomerOrderParam;
|
|
import com.fs.hisStore.param.FsCompanyCustomerOrderParam;
|
|
|
import com.fs.hisStore.service.IFsUserInformationCollectionService;
|
|
import com.fs.hisStore.service.IFsUserInformationCollectionService;
|
|
|
import com.fs.hisStore.vo.FsStoreOrderVO;
|
|
import com.fs.hisStore.vo.FsStoreOrderVO;
|
|
@@ -86,6 +87,10 @@ public class FsCompanyCustomerController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysConfigService sysConfigService;
|
|
private ISysConfigService sysConfigService;
|
|
|
|
|
|
|
|
|
|
+ //商城小程序appId配置常量
|
|
|
|
|
+ private static final String APP_ID_CONFIG_KEY = "appStore.appId.config";
|
|
|
|
|
+ private static final String DEFAULT_APP_ID = "wx50bcb040b4963a7e";
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询客户列表
|
|
* 查询客户列表
|
|
|
*/
|
|
*/
|
|
@@ -368,7 +373,7 @@ public class FsCompanyCustomerController extends BaseController {
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
Long companyUserId = loginUser.getUser().getUserId();
|
|
Long companyUserId = loginUser.getUser().getUserId();
|
|
|
if (companyUserId == null){
|
|
if (companyUserId == null){
|
|
|
- throw new CustomException("销售登录信息获取异常");
|
|
|
|
|
|
|
+ throw new CustomException("登录信息已过期,请重新登录");
|
|
|
}
|
|
}
|
|
|
fsDoctorPatient.setCompanyUserId(companyUserId);
|
|
fsDoctorPatient.setCompanyUserId(companyUserId);
|
|
|
PageHelper.startPage(fsDoctorPatient.getPageNum(), fsDoctorPatient.getPageSize());
|
|
PageHelper.startPage(fsDoctorPatient.getPageNum(), fsDoctorPatient.getPageSize());
|
|
@@ -404,7 +409,7 @@ public class FsCompanyCustomerController extends BaseController {
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
Long companyUserId = loginUser.getUser().getUserId();
|
|
Long companyUserId = loginUser.getUser().getUserId();
|
|
|
if (companyUserId == null){
|
|
if (companyUserId == null){
|
|
|
- throw new CustomException("销售登录信息获取异常");
|
|
|
|
|
|
|
+ throw new CustomException("登录信息已过期,请重新登录");
|
|
|
}
|
|
}
|
|
|
PageHelper.startPage(customerOrderParam.getPageNum(), customerOrderParam.getPageSize());
|
|
PageHelper.startPage(customerOrderParam.getPageNum(), customerOrderParam.getPageSize());
|
|
|
List<FsStoreOrderVO> list = fsCompanyCustomerService.selectStoreOrderScrmByCompanyCustomerParam(customerOrderParam);
|
|
List<FsStoreOrderVO> list = fsCompanyCustomerService.selectStoreOrderScrmByCompanyCustomerParam(customerOrderParam);
|
|
@@ -430,18 +435,8 @@ public class FsCompanyCustomerController extends BaseController {
|
|
|
* */
|
|
* */
|
|
|
@GetMapping("/getQRCode/{orderId}")
|
|
@GetMapping("/getQRCode/{orderId}")
|
|
|
public R getQRCode(@PathVariable("orderId") Long orderId){
|
|
public R getQRCode(@PathVariable("orderId") Long orderId){
|
|
|
- String configValue = sysConfigService.selectConfigByKey("appStore.appId.config");
|
|
|
|
|
- String appId = null;
|
|
|
|
|
- if (StringUtils.isNotEmpty(configValue)) {
|
|
|
|
|
- // 解析JSON
|
|
|
|
|
- JSONObject json = JSONUtil.parseObj(configValue);
|
|
|
|
|
- appId = json.getStr("appId");
|
|
|
|
|
- }
|
|
|
|
|
- // 如果配置不存在或解析失败,使用默认值
|
|
|
|
|
- if (StringUtils.isEmpty(appId)) {
|
|
|
|
|
- log.error("未配置制单小程序appId");
|
|
|
|
|
- appId = "wx50bcb040b4963a7e";//默认为营口市小程序;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //获取appId
|
|
|
|
|
+ String appId = getAppId();
|
|
|
return informationCollectionService.getCustomerGenerateQRCode(orderId,appId);
|
|
return informationCollectionService.getCustomerGenerateQRCode(orderId,appId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -478,4 +473,48 @@ public class FsCompanyCustomerController extends BaseController {
|
|
|
public AjaxResult improve(@RequestBody FsCompanyCustomer fsCompanyCustomer){
|
|
public AjaxResult improve(@RequestBody FsCompanyCustomer fsCompanyCustomer){
|
|
|
return toAjax(fsCompanyCustomerService.improve(fsCompanyCustomer));
|
|
return toAjax(fsCompanyCustomerService.improve(fsCompanyCustomer));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成收集手机号二维码
|
|
|
|
|
+ * */
|
|
|
|
|
+ @PostMapping("/createPhoneQRCode")
|
|
|
|
|
+ public R createPhoneQRCode(@RequestBody CreatePhoneQRCodeDTO qrCodeDTO) {
|
|
|
|
|
+ // 登录用户ID
|
|
|
|
|
+ Long companyUserId;
|
|
|
|
|
+ try {
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
|
+ companyUserId = loginUser.getUser().getUserId();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("获取当前登录用户信息失败", e);
|
|
|
|
|
+ throw new CustomException("登录信息已过期,请重新登录");
|
|
|
|
|
+ }
|
|
|
|
|
+ // 当前配置的商城小程序appId
|
|
|
|
|
+ String appId = getAppId();
|
|
|
|
|
+ return fsCompanyCustomerService.createPhoneQRCode(qrCodeDTO,companyUserId, appId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取 appId 的私有方法
|
|
|
|
|
+ */
|
|
|
|
|
+ private String getAppId() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ String configValue = sysConfigService.selectConfigByKey(APP_ID_CONFIG_KEY);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(configValue)) {
|
|
|
|
|
+ JSONObject json = JSONUtil.parseObj(configValue);
|
|
|
|
|
+ String appId = json.getStr("appId");
|
|
|
|
|
+ if (StringUtils.isNotEmpty(appId)) {
|
|
|
|
|
+ return appId;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("配置 {} 中 appId 字段为空,使用默认值", APP_ID_CONFIG_KEY);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("未找到配置 {},使用默认值", APP_ID_CONFIG_KEY);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("解析 appId 配置异常,configValue={}",
|
|
|
|
|
+ sysConfigService.selectConfigByKey(APP_ID_CONFIG_KEY), e);
|
|
|
|
|
+ }
|
|
|
|
|
+ //默认值
|
|
|
|
|
+ return DEFAULT_APP_ID;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|