Browse Source

Merge branch 'pre-production'

# Conflicts:
#	blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
master
pref_mail@163.com 2 months ago
parent
commit
354dbc5822
  1. 2
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 4
      blade-ops/blade-resource/src/main/resources/application-prod.yml
  3. 50
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ContactsVO.java
  4. 2
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/feign/IUserClient.java
  5. 33
      blade-service/blade-system/src/main/java/org/springblade/system/controller/ContactsController.java
  6. 1
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/UserMapper.java
  7. 14
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/UserMapper.xml
  8. 4
      blade-service/blade-system/src/main/java/org/springblade/system/service/IUserService.java
  9. 21
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/UserServiceImpl.java

2
blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@ -34,7 +34,7 @@ public interface LauncherConstant {
/**
* nacos prod 地址
*/
String NACOS_PROD_ADDR = "172.16.128.145:8848";
String NACOS_PROD_ADDR = "172.26.199.145:8848";
/**
* nacos test 地址

4
blade-ops/blade-resource/src/main/resources/application-prod.yml

@ -15,9 +15,9 @@ oss:
#租户模式
tenant-mode: false
#oss服务地址
endpoint: http://47.108.51.143:9000
endpoint: http://8.137.19.41:9000
#minio转换服务地址,用于内网上传后将返回地址改为转换的外网地址
transform-endpoint: http://47.108.51.143:9000
transform-endpoint: http://8.137.19.41:9000
#访问key
access-key: minio
#密钥key

50
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ContactsVO.java

@ -0,0 +1,50 @@
package org.springblade.system.vo;
import lombok.Data;
/**
* 通讯录
*/
@Data
public class ContactsVO {
/**
* 姓名
*/
private String name;
/**
* 手机号码
*/
private String mobile;
/**
* 电子邮件地址
*/
private String email;
/**
* 家庭或通信地址
*/
private String address;
/**
* 部门
* 逗号分割 拼接在一起
*/
private String deptNames;
/**
* 岗位s
* 逗号分割 拼接在一起
*/
private String postNames;
/**
* 备注信息记录额外的说明或需要注意的事项
*/
private String remark;
}

2
blade-service-api/blade-user-api/src/main/java/org/springblade/system/feign/IUserClient.java

@ -155,7 +155,7 @@ public interface IUserClient {
@GetMapping(USER_INFO_BY_IDS)
R<List<User>> userInfoByIds(@RequestParam("tenantId") String tenantId, @RequestParam("deptId") String ids);
R<List<User>> userInfoByIds(@RequestParam String tenantId, @RequestParam String ids);

33
blade-service/blade-system/src/main/java/org/springblade/system/controller/ContactsController.java

@ -0,0 +1,33 @@
package org.springblade.system.controller;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.system.service.IUserService;
import org.springblade.system.vo.ContactsVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/contacts")
@ApiIgnore
@Api(value = "通讯录", tags = "通讯录")
public class ContactsController extends BladeController {
private final IUserService userService;
@GetMapping("/list")
public R<List<ContactsVO>> list() {
List<ContactsVO> data =userService.listContacts();
return R.data(data);
}
}

1
blade-service/blade-system/src/main/java/org/springblade/system/mapper/UserMapper.java

@ -60,4 +60,5 @@ public interface UserMapper extends BaseMapper<User> {
*/
List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper);
List<User> listContacts( @Param("tenantId") String tenantId);
}

14
blade-service/blade-system/src/main/java/org/springblade/system/mapper/UserMapper.xml

@ -73,5 +73,19 @@
<select id="exportUser" resultType="org.springblade.system.excel.UserExcel">
SELECT id, tenant_id, user_type, account, name, real_name, email, phone, birthday, role_id, dept_id, post_id FROM blade_user ${ew.customSqlSegment}
</select>
<select id="listContacts" resultType="org.springblade.system.entity.User">
SELECT
real_name,
phone,
email,
dept_id,
post_id
FROM
blade_user
WHERE
is_deleted = 0
AND tenant_id = #{tenantId}
AND phone IS NOT NULL
</select>
</mapper>

4
blade-service/blade-system/src/main/java/org/springblade/system/service/IUserService.java

@ -26,6 +26,7 @@ import org.springblade.system.entity.UserInfo;
import org.springblade.system.entity.UserOauth;
import org.springblade.system.enums.UserEnum;
import org.springblade.system.excel.UserExcel;
import org.springblade.system.vo.ContactsVO;
import org.springblade.system.vo.UserVO;
import java.util.List;
@ -213,4 +214,7 @@ public interface IUserService extends BaseService<User> {
* @return
*/
User userInfoByPhone(String tenantId, String phone);
List<ContactsVO> listContacts();
}

21
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/UserServiceImpl.java

@ -46,6 +46,7 @@ import org.springblade.system.mapper.UserMapper;
import org.springblade.system.service.IUserDeptService;
import org.springblade.system.service.IUserOauthService;
import org.springblade.system.service.IUserService;
import org.springblade.system.vo.ContactsVO;
import org.springblade.system.vo.UserVO;
import org.springblade.system.wrapper.UserWrapper;
import org.springframework.stereotype.Service;
@ -444,4 +445,24 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
return null;
}
@Override
public List<ContactsVO> listContacts() {
List<ContactsVO> contactsVOS = new ArrayList<>();
List<User> list =baseMapper.listContacts(AuthUtil.getTenantId());
for (User user : list) {
ContactsVO contactsVO = new ContactsVO();
contactsVO.setName(user.getRealName());
contactsVO.setMobile(user.getPhone());
contactsVO.setEmail(user.getEmail());
contactsVO.setDeptNames(StringUtil.join(SysCache.getDeptNames(user.getDeptId())));
contactsVO.setPostNames(StringUtil.join(SysCache.getPostNames(user.getPostId())));
contactsVOS.add(contactsVO);
}
return contactsVOS;
}
}

Loading…
Cancel
Save