|
@@ -35,6 +35,7 @@ import com.fs.framework.security.SecurityUtils;
|
|
|
import com.fs.framework.service.TokenService;
|
|
import com.fs.framework.service.TokenService;
|
|
|
import com.fs.his.utils.qrcode.QRCodeUtils;
|
|
import com.fs.his.utils.qrcode.QRCodeUtils;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
import com.fs.his.vo.OptionsVO;
|
|
|
|
|
+import com.fs.hisStore.service.IFsUserScrmService;
|
|
|
import com.fs.hisStore.vo.FsStoreProductExportVO;
|
|
import com.fs.hisStore.vo.FsStoreProductExportVO;
|
|
|
import com.fs.im.config.IMConfig;
|
|
import com.fs.im.config.IMConfig;
|
|
|
import com.fs.im.dto.OpenImResponseDTO;
|
|
import com.fs.im.dto.OpenImResponseDTO;
|
|
@@ -112,6 +113,9 @@ public class CompanyUserController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CloudHostProper cloudHostProper;
|
|
private CloudHostProper cloudHostProper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsUserScrmService fsUserScrmService;
|
|
|
|
|
+
|
|
|
private static final String appLink = "https://jump.ylrztop.com/jumpapp/pages/index/index?link=";
|
|
private static final String appLink = "https://jump.ylrztop.com/jumpapp/pages/index/index?link=";
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -805,4 +809,64 @@ public class CompanyUserController extends BaseController {
|
|
|
OpenImResponseDTO openImResponseDTO = openIMService.importFriend(ownerUserID, friendUserIDs);
|
|
OpenImResponseDTO openImResponseDTO = openIMService.importFriend(ownerUserID, friendUserIDs);
|
|
|
return R.ok().put("data",openImResponseDTO);
|
|
return R.ok().put("data",openImResponseDTO);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据手机号码精确查询fs_user(完全匹配)
|
|
|
|
|
+ * @param phone 手机号码
|
|
|
|
|
+ * @return 用户列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("根据手机号码精确查询fs_user")
|
|
|
|
|
+ @GetMapping("/fsUser/queryByPhone")
|
|
|
|
|
+ public R queryFsUserByPhone(@RequestParam("phone") String phone) {
|
|
|
|
|
+ if (StringUtils.isEmpty(phone)) {
|
|
|
|
|
+ return R.error("手机号码不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<com.fs.hisStore.domain.FsUserScrm> userList = fsUserScrmService.selectFsUserListByPhoneExact(phone);
|
|
|
|
|
+ return R.ok().put("data", userList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 批量绑定用户到员工
|
|
|
|
|
+ * @param data 包含 userIds(公司用户ID列表)和 bindCompanyUserId(绑定的销售ID)
|
|
|
|
|
+ * @return 操作结果
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("批量绑定用户到员工")
|
|
|
|
|
+ @PostMapping("/batchBindCompanyUserId")
|
|
|
|
|
+ public R batchBindCompanyUserId(@RequestBody Map<String, Object> data) {
|
|
|
|
|
+ List<Long> userIds = (List<Long>) data.get("fsUserIds");
|
|
|
|
|
+ Long bindCompanyUserId = null;
|
|
|
|
|
+ if (data.get("companyUserId") != null) {
|
|
|
|
|
+ if (data.get("companyUserId") instanceof Integer) {
|
|
|
|
|
+ bindCompanyUserId = ((Integer) data.get("companyUserId")).longValue();
|
|
|
|
|
+ } else if (data.get("companyUserId") instanceof Long) {
|
|
|
|
|
+ bindCompanyUserId = (Long) data.get("companyUserId");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (userIds == null || userIds.isEmpty()) {
|
|
|
|
|
+ return R.error("用户ID列表不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ int result = companyUserService.batchUpdateBindCompanyUserId(userIds, bindCompanyUserId);
|
|
|
|
|
+ if (result > 0) {
|
|
|
|
|
+ return R.ok("绑定成功");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return R.error("绑定失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询已绑定的用户
|
|
|
|
|
+ * @param companyUserId 销售ID
|
|
|
|
|
+ * @return 绑定的用户列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("查询已绑定的用户")
|
|
|
|
|
+ @GetMapping("/getBoundUsers/{companyUserId}")
|
|
|
|
|
+ public R getBoundUsers(@PathVariable("companyUserId") Long companyUserId) {
|
|
|
|
|
+ if (companyUserId == null) {
|
|
|
|
|
+ return R.error("销售ID不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<com.fs.hisStore.domain.FsUserScrm> userList = companyUserService.selectBoundFsUsersByCompanyUserId(companyUserId);
|
|
|
|
|
+ return R.ok().put("data", userList);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|