|
|
@@ -2,6 +2,8 @@ package com.fs.app.controller;
|
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
@@ -20,6 +22,7 @@ import com.fs.his.dto.FindUsersByDTO;
|
|
|
import com.fs.his.param.FindUserByParam;
|
|
|
import com.fs.his.param.FsUserCouponUParam;
|
|
|
import com.fs.his.param.FsUserEditPushParam;
|
|
|
+import com.fs.his.config.IntegralConfig;
|
|
|
import com.fs.his.service.IFsDoctorService;
|
|
|
import com.fs.his.service.IFsPackageService;
|
|
|
import com.fs.his.service.IFsUserCouponService;
|
|
|
@@ -30,6 +33,7 @@ import com.fs.his.vo.FsUserCouponListUVO;
|
|
|
import com.fs.his.vo.UserVo;
|
|
|
import com.fs.live.service.ILiveCommentWsUserTypeService;
|
|
|
import com.fs.qw.service.IQwAppContactWayService;
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.system.oss.CloudStorageService;
|
|
|
import com.fs.system.oss.OSSFactory;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
@@ -86,6 +90,8 @@ public class UserController extends AppBaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private IFsUserService fsUserService;
|
|
|
+ @Autowired
|
|
|
+ private ISysConfigService configService;
|
|
|
@Login
|
|
|
@ApiOperation("获取用户信息")
|
|
|
@PostMapping("/friendsSearch")
|
|
|
@@ -204,6 +210,30 @@ public class UserController extends AppBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("获取首次登录App奖励返回")
|
|
|
+ @GetMapping("/getIntegralFirstLoginApp")
|
|
|
+ public R getIntegralFirstLoginApp() {
|
|
|
+ String json = configService.selectConfigByKey("his.integral");
|
|
|
+ if (StringUtils.isBlank(json)) {
|
|
|
+ return R.ok()
|
|
|
+ .put("integralFirstLoginApp", 0)
|
|
|
+ .put("giftName", "")
|
|
|
+ .put("giftPrice", "")
|
|
|
+ .put("giftImage", "");
|
|
|
+ }
|
|
|
+ JSONObject cfgObj = JSONUtil.parseObj(json);
|
|
|
+ IntegralConfig config = JSONUtil.toBean(cfgObj, IntegralConfig.class);
|
|
|
+ Integer integralFirstLoginApp = config.getIntegralFirstLoginApp();
|
|
|
+ return R.ok()
|
|
|
+ .put("integralFirstLoginApp", integralFirstLoginApp == null ? 0 : integralFirstLoginApp)
|
|
|
+ .put("giftName", pickFirstNonBlank(cfgObj,
|
|
|
+ "firstLoginGiftName", "integralFirstLoginGiftName", "newcomerGiftName", "giftName"))
|
|
|
+ .put("giftPrice", pickFirstNonBlank(cfgObj,
|
|
|
+ "firstLoginGiftPrice", "integralFirstLoginGiftPrice", "newcomerGiftPrice", "giftPrice"))
|
|
|
+ .put("giftImage", pickFirstNonBlank(cfgObj,
|
|
|
+ "firstLoginGiftImage", "integralFirstLoginGiftImage", "newcomerGiftImage", "giftImage"));
|
|
|
+ }
|
|
|
+
|
|
|
@Login
|
|
|
@ApiOperation("修改用户信息")
|
|
|
@PostMapping("/editUser")
|
|
|
@@ -410,4 +440,17 @@ public class UserController extends AppBaseController {
|
|
|
user.setLiveUserType(liveUt);
|
|
|
user.setUserType(Integer.toString(liveUt));
|
|
|
}
|
|
|
+
|
|
|
+ private String pickFirstNonBlank(JSONObject jsonObject, String... keys) {
|
|
|
+ if (jsonObject == null || keys == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ for (String key : keys) {
|
|
|
+ String value = jsonObject.getStr(key);
|
|
|
+ if (StringUtils.isNotBlank(value)) {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
}
|