Compare commits
39 Commits
3b1f2ef586
...
master
Author | SHA1 | Date | |
---|---|---|---|
ca5dd9aa64 | |||
38922ac6db | |||
172ff729c9 | |||
ccc300faa4 | |||
47cd086123 | |||
75ea429a0a | |||
21294369bf | |||
40eb2d80a4 | |||
ed94274923 | |||
05dbdb6407 | |||
536c6a5438 | |||
fb2efa6aa0 | |||
0cf9e59d17 | |||
278c6f0f0f | |||
a731a31a59 | |||
2e58d1d1a4 | |||
2527208ac7 | |||
07df918174 | |||
deb9d58130 | |||
a1fe1044ef | |||
9d01dc5e86 | |||
513e6ef833 | |||
69ba803f18 | |||
0772d2b3e3 | |||
c0af8f1ab3 | |||
71531aa680 | |||
e37c88df5d | |||
2e6b795284 | |||
db54e19d06 | |||
7ed9debcc6 | |||
e9b5c507be | |||
22eee1a7fc | |||
1e55dfe39c | |||
3d67382373 | |||
cd840878b6 | |||
0171d301c3 | |||
0c7d4e3d2c | |||
2cae924e58 | |||
da03c0f02a |
@ -11,6 +11,7 @@ import java.io.IOException;
|
||||
public class BearerTokenFilter implements Filter {
|
||||
private static final String AUTHORIZATION_HEADER = "Authorization";
|
||||
private static final String BEARER_PREFIX = "Bearer ";
|
||||
private static final String ROLE_HEADER = "Currentrolecode";
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
@ -22,10 +23,15 @@ public class BearerTokenFilter implements Filter {
|
||||
String token = authHeader.substring(BEARER_PREFIX.length());
|
||||
BearerTokenHolder.setToken(token);
|
||||
}
|
||||
//currentRole
|
||||
String roleHeader = httpRequest.getHeader(ROLE_HEADER);
|
||||
if (roleHeader != null) {;
|
||||
CurrentRoleHolder.setRole(roleHeader);
|
||||
}
|
||||
}
|
||||
chain.doFilter(request, response);
|
||||
} finally {
|
||||
BearerTokenHolder.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.security.starter.filter;
|
||||
|
||||
public class CurrentRoleHolder {
|
||||
private static final ThreadLocal<String> ROLE_HOLDER = new ThreadLocal<>();
|
||||
|
||||
public static void setRole(String role) {
|
||||
ROLE_HOLDER.set(role);
|
||||
}
|
||||
|
||||
public static String getRole() {
|
||||
return ROLE_HOLDER.get();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
ROLE_HOLDER.remove();
|
||||
}
|
||||
}
|
@ -8,7 +8,6 @@ import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.AuthAllows;
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.ExternalAllows;
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.RoleCodeAuthority;
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityUser;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client.EbtpUserInfoClient;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.entity.CheckTokenVo;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.service.UserInfoService;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
|
||||
@ -45,7 +44,7 @@ import static com.chinaunicom.mall.ebtp.cloud.security.starter.common.Constants.
|
||||
* @author Ajaxfan
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
//@Component
|
||||
public class TokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
@Autowired
|
||||
private UserInfoService client;
|
||||
@ -55,9 +54,6 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
@Autowired
|
||||
private ExternalAllows eAllows;
|
||||
|
||||
@Autowired
|
||||
private EbtpUserInfoClient ebtpClient;
|
||||
|
||||
@Autowired(required = false)
|
||||
@Qualifier("userinfoRedisTemplate")
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
@ -17,9 +17,9 @@ import org.springframework.web.client.RestTemplate;
|
||||
@ComponentScan(basePackages = "com.chinaunicom.mall.ebtp.cloud.userinfo.starter")
|
||||
public class UserinfoStarterConfiguration {
|
||||
|
||||
@Bean
|
||||
public RestTemplate restTemplate() {
|
||||
return new RestTemplate();
|
||||
}
|
||||
// @Bean
|
||||
// public RestTemplate restTemplate() {
|
||||
// return new RestTemplate();
|
||||
// }
|
||||
|
||||
}
|
||||
|
@ -1,35 +0,0 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.entity.CheckTokenVo;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.fallback.EbtpUserInfoClientFallbackFactory;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 文档中心数据服务客户端
|
||||
*
|
||||
* @author Ajaxfan
|
||||
*/
|
||||
@FeignClient(value = "sys-manager-ebtp-project")
|
||||
public interface EbtpUserInfoClient {
|
||||
|
||||
/**
|
||||
* 刷新redis缓存的信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/userinfo/refresh")
|
||||
public ResponseEntity<Boolean> refreshToken();
|
||||
|
||||
/**
|
||||
* 获取配置信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/v1/checkToken/getCheckTokenVo")
|
||||
public BaseResponse<CheckTokenVo> getCheckTokenVo(@RequestParam("ps") String ps);
|
||||
}
|
@ -1,18 +1,21 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityEntity;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.entity.CheckTokenVo;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.fallback.UnifastOAuthClientFallbackFactory;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 文档中心数据服务客户端
|
||||
*
|
||||
*
|
||||
* @author Ajaxfan
|
||||
*/
|
||||
@FeignClient(value = "${user.auth.resource.serviceId:sys-manager-ebtp-project}",
|
||||
@FeignClient(value = "sys-manager-ebtp-project",
|
||||
fallbackFactory = UnifastOAuthClientFallbackFactory.class)
|
||||
public interface UnifastOAuthClient {
|
||||
|
||||
@ -22,4 +25,19 @@ public interface UnifastOAuthClient {
|
||||
@PostMapping("/v1/userinfo/oauth/check_token")
|
||||
SecurityEntity getPost(@RequestParam("token") String token);
|
||||
|
||||
/**
|
||||
* 刷新redis缓存的信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/userinfo/refresh")
|
||||
public ResponseEntity<Boolean> refreshToken();
|
||||
|
||||
/**
|
||||
* 获取配置信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/v1/checkToken/getCheckTokenVo")
|
||||
public BaseResponse<CheckTokenVo> getCheckTokenVo(@RequestParam("ps") String ps);
|
||||
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.userinfo.starter.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client.EbtpUserInfoClient;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.entity.CheckTokenVo;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class EbtpUserInfoClientFallback implements EbtpUserInfoClient {
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Boolean> refreshToken() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<CheckTokenVo> getCheckTokenVo(String ps) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.userinfo.starter.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityEntity;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client.EbtpUserInfoClient;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class EbtpUserInfoClientFallbackFactory implements FallbackFactory<EbtpUserInfoClient> {
|
||||
@Override
|
||||
public EbtpUserInfoClient create(Throwable throwable) {
|
||||
log.error("EbtpUserInfoClient error : " + throwable.getMessage());
|
||||
return new EbtpUserInfoClientFallback();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public EbtpUserInfoClient create(Throwable throwable) {
|
||||
// log.error("EbtpUserInfoClient error : " + throwable.getMessage());
|
||||
// return () -> ResponseEntity.ok(null);
|
||||
// }
|
||||
|
||||
}
|
@ -2,6 +2,9 @@ package com.chinaunicom.mall.ebtp.cloud.userinfo.starter.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityEntity;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client.UnifastOAuthClient;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.entity.CheckTokenVo;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ -17,4 +20,14 @@ public class UnifastOAuthClientFallback implements UnifastOAuthClient {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Boolean> refreshToken() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<CheckTokenVo> getCheckTokenVo(String ps) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.AuthorityEntity;
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.entity.SecurityEntity;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client.EbtpUserInfoClient;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.client.UnifastOAuthClient;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.entity.CheckTokenVo;
|
||||
import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.service.UserInfoService;
|
||||
@ -44,9 +43,6 @@ private Integer valid_time_limit;
|
||||
@Qualifier("userinfoRedisTemplate")
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Autowired
|
||||
private EbtpUserInfoClient ebtpClient;
|
||||
|
||||
@Override
|
||||
public BaseCacheUser getUserInfo(String token) {
|
||||
token = token.replaceAll(TOKEN_PREFIX, "");
|
||||
@ -213,7 +209,7 @@ private Integer valid_time_limit;
|
||||
if (o != null) {
|
||||
return (CheckTokenVo)o;
|
||||
}else{
|
||||
BaseResponse<CheckTokenVo> baseResponse = ebtpClient.getCheckTokenVo("eshop@2024");
|
||||
BaseResponse<CheckTokenVo> baseResponse = client.getCheckTokenVo("eshop@2024");
|
||||
//log.info("responseEntity:" + baseResponse);
|
||||
if (baseResponse.getData() != null) {
|
||||
//log.info("responseEntity.getBody():" + baseResponse.getData());
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.CoscoCategoryMaintenance;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.CoscoCategoryMaintenanceVO;
|
||||
import com.chinaunicom.mall.ebtp.common.base.fallback.CategoryClientFallback;
|
||||
import com.chinaunicom.mall.ebtp.common.constant.ServiceNameConstants;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(
|
||||
name = ServiceNameConstants.SYSTEM_SERVICE,
|
||||
fallback = CategoryClientFallback.class
|
||||
)
|
||||
public interface CategoryClient {
|
||||
|
||||
// --------------------------品类接口-----------------------
|
||||
@ApiOperation("查询品类数据详细")
|
||||
@GetMapping("/v1/coscocategorymaintenance/{id}")
|
||||
BaseResponse<CoscoCategoryMaintenance> getInfo(@PathVariable String id);
|
||||
|
||||
@ApiOperation("查询树结构数据")
|
||||
@PostMapping("/v1/coscocategorymaintenance/getTreeList")
|
||||
BaseResponse<List<CoscoCategoryMaintenanceVO>> getTreeList(@RequestBody CoscoCategoryMaintenanceVO coscoCategoryMaintenanceVO);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictProject;
|
||||
import com.chinaunicom.mall.ebtp.common.base.fallback.DictClientFallback;
|
||||
import com.chinaunicom.mall.ebtp.common.constant.ServiceNameConstants;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.cloud.openfeign.SpringQueryMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(
|
||||
name = ServiceNameConstants.SYSTEM_SERVICE,
|
||||
fallback = DictClientFallback.class
|
||||
)
|
||||
public interface DictClient {
|
||||
|
||||
// --------------------------字典接口-----------------------
|
||||
|
||||
/**
|
||||
* 查询所有字典
|
||||
* @param dictProject
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询数据集合")
|
||||
@GetMapping("/v1/dictProject/selectDictList")
|
||||
BaseResponse<List<DictProject>> selectDictList(@SpringQueryMap DictProject dictProject);
|
||||
|
||||
@ApiOperation("查询数据集合(支持详情查询)")
|
||||
@GetMapping("/v1/dictProject/getDictList")
|
||||
BaseResponse<List<DictProject>> getDictList(@SpringQueryMap DictProject dictProject);
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegion;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegionInternational;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegionTreeVO;
|
||||
import com.chinaunicom.mall.ebtp.common.base.fallback.DictRegionClientFallback;
|
||||
import com.chinaunicom.mall.ebtp.common.base.fallback.DictRegionInternationalClientFallback;
|
||||
import com.chinaunicom.mall.ebtp.common.constant.ServiceNameConstants;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(
|
||||
name = ServiceNameConstants.SYSTEM_SERVICE,
|
||||
fallback = DictRegionClientFallback.class
|
||||
)
|
||||
public interface DictRegionClient {
|
||||
|
||||
// --------------------------省市区信息接口-----------------------
|
||||
|
||||
|
||||
@ApiOperation("查询所有数据")
|
||||
@GetMapping("/v1/dictRegion/all")
|
||||
BaseResponse<List<DictRegion>> listAll();
|
||||
|
||||
@ApiOperation("查询数据子节点")
|
||||
@GetMapping("/v1/dictRegion/getChild")
|
||||
BaseResponse<List<DictRegion>> getChild(@RequestParam(name = "pId") String pId);
|
||||
|
||||
@ApiOperation("递归查询所有下级数据树形结构")
|
||||
@GetMapping("/v1/dictRegion/getAllChildrenTree/{id}")
|
||||
BaseResponse<DictRegionTreeVO> getAllChildrenTree(@PathVariable String id);
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegionInternational;
|
||||
import com.chinaunicom.mall.ebtp.common.base.fallback.DictRegionInternationalClientFallback;
|
||||
import com.chinaunicom.mall.ebtp.common.constant.ServiceNameConstants;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(
|
||||
name = ServiceNameConstants.SYSTEM_SERVICE,
|
||||
fallback = DictRegionInternationalClientFallback.class
|
||||
)
|
||||
public interface DictRegionInternationalClient {
|
||||
|
||||
// --------------------------全球国家信息接口-----------------------
|
||||
|
||||
@ApiOperation("查询详细数据")
|
||||
@GetMapping("/v1/dictRegionInternational//{id}")
|
||||
BaseResponse<DictRegionInternational> get(@PathVariable String id);
|
||||
|
||||
@ApiOperation("查询所有数据")
|
||||
@GetMapping("/v1/dictRegionInternational/all")
|
||||
BaseResponse<List<DictRegionInternational>> listAll();
|
||||
|
||||
@ApiOperation("查询子数据")
|
||||
@GetMapping("/v1/dictRegionInternational/getChild")
|
||||
BaseResponse<List<DictRegionInternational>> getChild(@RequestParam(name = "pId") String pId);
|
||||
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import feign.RequestInterceptor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(
|
||||
name = ServiceNameConstants.SYSTEM_SERVICE,
|
||||
fallback = SystemClientFallback.class,
|
||||
@ -42,6 +44,27 @@ public interface SystemClient {
|
||||
@ApiParam(value = "查询对象数据", required = false) @SpringQueryMap SysUser param
|
||||
);
|
||||
|
||||
@ApiOperation("根据用户ID集合查询所有用户信息")
|
||||
@PostMapping("/v1/sysuser/getUsersByIds")
|
||||
BaseResponse<List<SysUser>> getUsersByIds(@RequestBody List<String> ids);
|
||||
|
||||
@ApiOperation("根据用户ID查询本单位下所有用户分页数据")
|
||||
@PostMapping("/v1/sysuser/getPageByUserCompany")
|
||||
BaseResponse<Page<SysUser>> getPageByUserCompany(@ApiParam(value = "分页及查询条件", required = true) @RequestBody SysUserVO sysUserVO);
|
||||
|
||||
// -----------------------供应商用户接口-----------------------
|
||||
@ApiOperation("供应商注册(自动生成账号并设置统一重置密码)")
|
||||
@PostMapping("/v1/supplieruser/register")
|
||||
BaseResponse<SysSupplierUser> register(@ApiParam(value = "注册信息", required = true) @RequestBody @Valid SupplierRegistrationVO registrationVO);
|
||||
|
||||
@ApiOperation("修改供应商用户信息")
|
||||
@PostMapping("/v1/supplieruser/update")
|
||||
BaseResponse<Boolean> update(@ApiParam(value = "供应商用户信息", required = true) @RequestBody SysSupplierUser sysSupplierUser);
|
||||
|
||||
@ApiOperation("供应商用户分页查询")
|
||||
@PostMapping("/v1/supplieruser/getPage")
|
||||
BaseResponse<Page<SysSupplierUser>> getPage(@RequestBody SysSupplierUser sysSupplierUser);
|
||||
|
||||
// -----------------------组织接口-----------------------
|
||||
@ApiOperation("查询组织信息(当前组织及下级组织列表)")
|
||||
@GetMapping("/v1/sysorg/queryOrgWithChildren")
|
||||
@ -53,12 +76,16 @@ public interface SystemClient {
|
||||
|
||||
@ApiOperation("查询机构列表")
|
||||
@GetMapping("/v1/sysorg/list")
|
||||
BaseResponse<List<SysOrg>> getOrglist(@ApiParam(value = "查询对象数据", required = false) @SpringQueryMap SysOrg param);
|
||||
BaseResponse<List<SysOrg>> getOrglist(@ApiParam(value = "查询对象数据", required = false) @SpringQueryMap SysOrgVO param);
|
||||
|
||||
@ApiOperation("查询所有数据(树形结构)")
|
||||
@GetMapping("/v1/sysorg/queryAll")
|
||||
BaseResponse<List<SysOrgVO>> queryAll(@SpringQueryMap SysOrg sysOrg);
|
||||
|
||||
@ApiOperation("查询分页数据")
|
||||
@PostMapping("/v1/sysorg/getPage")
|
||||
BaseResponse<Page<SysOrg>> getOrgPage(@ApiParam(value = "对象数据", required = true) @RequestBody SysOrgVO sysOrgVO);
|
||||
|
||||
@Configuration
|
||||
class FeignConfig {
|
||||
@Value("${check.tokentime.checkpublicKey}")
|
||||
|
@ -114,6 +114,16 @@ public class BaseCacheUser {
|
||||
* 组织名称
|
||||
*/
|
||||
private String organizationName;
|
||||
|
||||
/**
|
||||
* 组织ID全路径
|
||||
*/
|
||||
private String organizationFullId;
|
||||
|
||||
/**
|
||||
* 组织名称全路径
|
||||
*/
|
||||
private String organizationFullName;
|
||||
//
|
||||
/**
|
||||
* 组织机构类别
|
||||
|
@ -0,0 +1,91 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实体类 CoscoCategoryMaintenance
|
||||
* @author sunyu
|
||||
* @date 2025-5-27
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel
|
||||
public class CoscoCategoryMaintenance extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 版本id
|
||||
*/
|
||||
@ApiModelProperty(value = "版本id")
|
||||
private Long versionId;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
@ApiModelProperty(value = "父id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
@ApiModelProperty(value = "路径")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 路径名称(从根到当前节点的所有category_name,以逗号分隔)
|
||||
*/
|
||||
@ApiModelProperty(value = "路径名称")
|
||||
private String pathName;
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
@ApiModelProperty(value = "品类名称")
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@ApiModelProperty(value = "编码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 状态(1启用 0停用)
|
||||
*/
|
||||
@ApiModelProperty(value = "状态(1启用 0停用)")
|
||||
private Integer status;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.time.LocalDateTime createDate;
|
||||
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.time.LocalDateTime updateDate;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实体类 CoscoCategoryMaintenance
|
||||
* @author sunyu
|
||||
* @date 2025-5-27
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel
|
||||
public class CoscoCategoryMaintenanceVO extends CoscoCategoryMaintenance implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "分页对象信息")
|
||||
private BasePageRequest basePageRequest;
|
||||
|
||||
@ApiModelProperty(value = "children")
|
||||
private List<CoscoCategoryMaintenanceVO> children;
|
||||
|
||||
@ApiModelProperty(value = "品类版本id")
|
||||
private Long versionId;
|
||||
|
||||
}
|
@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实体类 DictProject
|
||||
@ -65,4 +67,14 @@ public class DictProject implements Serializable {
|
||||
private String description;
|
||||
|
||||
|
||||
/**
|
||||
* 英文名称
|
||||
*/
|
||||
@ApiModelProperty(value = "英文名称")
|
||||
private String enName;
|
||||
|
||||
/**
|
||||
* 字典子项
|
||||
*/
|
||||
List<DictProject> children = new ArrayList<>();
|
||||
}
|
||||
|
@ -0,0 +1,65 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 全国行政区域实体类 DictRegion
|
||||
*
|
||||
* @author daixc
|
||||
* @date 2020/10/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("全国行政区域实体类")
|
||||
public class DictRegion implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 上级id
|
||||
*/
|
||||
@ApiModelProperty(value = "上级id")
|
||||
private String pId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型:0-省,1-市,2-县
|
||||
*/
|
||||
@ApiModelProperty(value = "类型:0-省,1-市,2-县")
|
||||
private String level;
|
||||
/**
|
||||
* 缩写
|
||||
*/
|
||||
@ApiModelProperty(value = "缩写")
|
||||
private String ab;
|
||||
|
||||
/**
|
||||
* ID路径,逗号分隔
|
||||
*/
|
||||
@ApiModelProperty(value = "ID路径,逗号分隔")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 名称路径,逗号分隔
|
||||
*/
|
||||
@ApiModelProperty(value = "名称路径,逗号分隔")
|
||||
private String pathName;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 全球国家信息实体类 DictRegionInternational
|
||||
*
|
||||
* @author 自动生成
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("全球国家信息实体类")
|
||||
public class DictRegionInternational implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 上级id
|
||||
*/
|
||||
@ApiModelProperty(value = "上级id")
|
||||
private String pId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型:0-国家
|
||||
*/
|
||||
@ApiModelProperty(value = "类型:0-国家")
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 缩写
|
||||
*/
|
||||
@ApiModelProperty(value = "缩写")
|
||||
private String ab;
|
||||
|
||||
/**
|
||||
* 英文名称
|
||||
*/
|
||||
@ApiModelProperty(value = "英文名称")
|
||||
private String enName;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 全国行政区域树形结构VO
|
||||
*
|
||||
* @author daixc
|
||||
* @date 2020/10/29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("全国行政区域树形结构VO")
|
||||
public class DictRegionTreeVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 上级id
|
||||
*/
|
||||
@ApiModelProperty(value = "上级id")
|
||||
private String pId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型:0-省,1-市,2-县
|
||||
*/
|
||||
@ApiModelProperty(value = "类型:0-省,1-市,2-县")
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 缩写
|
||||
*/
|
||||
@ApiModelProperty(value = "缩写")
|
||||
private String ab;
|
||||
|
||||
/**
|
||||
* 子节点列表
|
||||
*/
|
||||
@ApiModelProperty(value = "子节点列表")
|
||||
private List<DictRegionTreeVO> children;
|
||||
|
||||
/**
|
||||
* 是否叶子节点
|
||||
*/
|
||||
@ApiModelProperty(value = "是否叶子节点")
|
||||
private Boolean isLeaf;
|
||||
|
||||
/**
|
||||
* 层级深度
|
||||
*/
|
||||
@ApiModelProperty(value = "层级深度")
|
||||
private Integer depth;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@Data
|
||||
@ApiModel("供应商注册信息")
|
||||
public class SupplierRegistrationVO {
|
||||
|
||||
@ApiModelProperty(value = "供应商名称", required = true)
|
||||
@NotBlank(message = "供应商名称不能为空")
|
||||
private String supplierName;
|
||||
|
||||
@ApiModelProperty(value = "统一信用代码", required = true)
|
||||
// @Pattern(regexp = "^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$", message = "统一信用代码格式不正确")
|
||||
private String creditCode;
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true)
|
||||
// @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "邮箱", required = true)
|
||||
@NotBlank(message = "邮箱不能为空")
|
||||
@Email(message = "邮箱格式不正确")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "联系人")
|
||||
private String contactName;
|
||||
|
||||
@ApiModelProperty(value = "联系人职务")
|
||||
private String contactTitle;
|
||||
|
||||
@ApiModelProperty(value = "企业地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "企业简介")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "供应商ID", required = true)
|
||||
@NotBlank(message = "供应商ID不能为空")
|
||||
private String supplierId;
|
||||
}
|
@ -78,7 +78,8 @@ public class SysOrg extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty(value = "所属分公司编码")
|
||||
private String cuCompanyNumber;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "所属公司名称")
|
||||
private String cuCompanyName;
|
||||
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private String tenantId;
|
||||
|
@ -36,4 +36,7 @@ public class SysOrgVO extends SysOrg implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "树形结构所有部门ID")
|
||||
private String allDepartmentId;
|
||||
|
||||
@ApiModelProperty(value = "所属公司名称")
|
||||
private String cuCompanyName;
|
||||
}
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 实体类 SysSupplierUser-供应商用户表
|
||||
*
|
||||
* @author yss
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "sys_supplier_user", autoResultMap = true)
|
||||
@ApiModel(value = "SysSupplierUser对象", description = "供应商用户表")
|
||||
public class SysSupplierUser extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "密码")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "中文姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "手机号码(用于接收短信提醒)等")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "统一邮件")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "性别")
|
||||
private String sex;
|
||||
|
||||
@ApiModelProperty(value = "供应商id")
|
||||
private String supplierId;
|
||||
|
||||
@ApiModelProperty(value = "是否首次登录 0:否 1:是")
|
||||
private Integer firstLogin;
|
||||
|
||||
@ApiModelProperty(value = "最后登录时间")
|
||||
private LocalDateTime lastLoginTime;
|
||||
|
||||
@ApiModelProperty(value = "统一信用代码")
|
||||
private String creditCode;
|
||||
|
||||
@ApiModelProperty(value = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.CategoryClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class CategoryClientFallback implements CategoryClient {
|
||||
|
||||
@Override
|
||||
public BaseResponse<CoscoCategoryMaintenance> getInfo(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<CoscoCategoryMaintenanceVO>> getTreeList(CoscoCategoryMaintenanceVO coscoCategoryMaintenanceVO) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.DictClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictProject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class DictClientFallback implements DictClient {
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<DictProject>> selectDictList(DictProject dictProject) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<DictProject>> getDictList(DictProject dictProject) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.DictRegionClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.DictRegionInternationalClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegion;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegionInternational;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegionTreeVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class DictRegionClientFallback implements DictRegionClient {
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<DictRegion>> listAll() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<DictRegion>> getChild(String pId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<DictRegionTreeVO> getAllChildrenTree(String id) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.DictClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.DictRegionInternationalClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictProject;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.DictRegionInternational;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class DictRegionInternationalClientFallback implements DictRegionInternationalClient {
|
||||
|
||||
@Override
|
||||
public BaseResponse<DictRegionInternational> get(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<DictRegionInternational>> listAll() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<DictRegionInternational>> getChild(String pId) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.fallback;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.SystemClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.*;
|
||||
@ -29,6 +30,31 @@ public class SystemClientFallback implements SystemClient {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<SysUser>> getUsersByIds(List<String> ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<Page<SysUser>> getPageByUserCompany(SysUserVO sysUserVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<SysSupplierUser> register(SupplierRegistrationVO registrationVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<Boolean> update(SysSupplierUser sysSupplierUser) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<Page<SysSupplierUser>> getPage(SysSupplierUser sysSupplierUser) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<SysOrg>> getOrgWithChildren(SysOrg sysOrg) {
|
||||
return null;
|
||||
@ -40,7 +66,7 @@ public class SystemClientFallback implements SystemClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<List<SysOrg>> getOrglist(SysOrg param) {
|
||||
public BaseResponse<List<SysOrg>> getOrglist(SysOrgVO param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -48,4 +74,9 @@ public class SystemClientFallback implements SystemClient {
|
||||
public BaseResponse<List<SysOrgVO>> queryAll(SysOrg sysOrg) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<Page<SysOrg>> getOrgPage(SysOrgVO sysOrgVO) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,15 +1,32 @@
|
||||
package com.chinaunicom.mall.ebtp.common.base.service.impl;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.common.RSAcheck;
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.filter.CurrentRoleHolder;
|
||||
import com.chinaunicom.mall.ebtp.common.base.client.SystemClient;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.SysUser;
|
||||
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
|
||||
import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.chinaunicom.mall.ebtp.cloud.security.starter.filter.BearerTokenHolder;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.util.Base64;
|
||||
|
||||
import static com.chinaunicom.mall.ebtp.cloud.security.starter.common.Constants.REDIS_USER_KEY;
|
||||
|
||||
/**
|
||||
@ -27,25 +44,96 @@ public class BaseCacheUserServiceImpl implements IBaseCacheUserService {
|
||||
@Qualifier("userinfoRedisTemplate")
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Value("${login.captcha.privateKey}")
|
||||
private String privateKey;
|
||||
|
||||
@Autowired
|
||||
private SystemClient systemClient;
|
||||
|
||||
@Override
|
||||
public BaseCacheUser getCacheUser() {
|
||||
try {
|
||||
String token = BearerTokenHolder.getToken();
|
||||
if (token == null || token.isEmpty()) {
|
||||
log.warn("未获取到token");
|
||||
return null;
|
||||
BaseCacheUser cacheUser = null;
|
||||
if (StringUtils.hasText(token)) {
|
||||
Object o = redisTemplate.opsForValue().get(REDIS_USER_KEY + token);
|
||||
if (o instanceof BaseCacheUser) {
|
||||
cacheUser = (BaseCacheUser) o;
|
||||
}
|
||||
}
|
||||
Object o = redisTemplate.opsForValue().get(REDIS_USER_KEY + token);
|
||||
if (o instanceof BaseCacheUser) {
|
||||
return (BaseCacheUser) o;
|
||||
} else {
|
||||
log.warn("redis中未找到用户信息,token:{}", token);
|
||||
return null;
|
||||
// 如果Token没有传递或获取不到,尝试从请求头获取userId字段来获取用户信息(流程/IOA等需要挂载外部页面的鉴权,外部页面的前端将userId拼接_时间加密放到请求头传递)
|
||||
if (cacheUser == null) {
|
||||
// token为空或redis未找到,尝试从请求参数code解密userId
|
||||
ServletRequestAttributes attrs = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attrs != null) {
|
||||
String userId = attrs.getRequest().getHeader("userId");
|
||||
String cap = this.decrypt(userId);
|
||||
String[] caps = cap.split("_");
|
||||
if (caps.length != 2) {
|
||||
log.warn("解密后的userId格式不正确,userId:{}", userId);
|
||||
return null;
|
||||
}
|
||||
userId = caps[0];
|
||||
cacheUser = getCacheUserByUserId(userId);
|
||||
} else {
|
||||
log.warn("无法获取ServletRequestAttributes");
|
||||
}
|
||||
}
|
||||
if (cacheUser != null) {
|
||||
cacheUser.setCurrentRoleCode(CurrentRoleHolder.getRole());
|
||||
return cacheUser;
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
log.error("获取缓存用户信息异常", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过userId远程获取用户并封装为BaseCacheUser
|
||||
*/
|
||||
private BaseCacheUser getCacheUserByUserId(String userId) {
|
||||
BaseResponse<SysUser> resp = systemClient.getUser(userId);
|
||||
if (resp != null && resp.isSuccess() && resp.getData() != null) {
|
||||
SysUser user = resp.getData();
|
||||
BaseCacheUser cacheUser = new BaseCacheUser();
|
||||
cacheUser.setUserId(user.getUserId());
|
||||
cacheUser.setFullName(user.getName());
|
||||
cacheUser.setLoginName(user.getEmployeeNumber());
|
||||
cacheUser.setMobilePhone(user.getMobile());
|
||||
cacheUser.setOfficePhone(user.getOfficePhone());
|
||||
cacheUser.setSex(user.getSex() != null ? user.getSex().toString() : null);
|
||||
cacheUser.setEmployeeNumber(user.getEmployeeNumber());
|
||||
cacheUser.setEmailAddress(user.getEmail());
|
||||
cacheUser.setUserType("0");
|
||||
// cacheUser.setDeptId(orgId);
|
||||
// cacheUser.setDeptName(sysOrg.getOrgName());
|
||||
// cacheUser.setOrganizationId(sysOrg.getCuCompanyNumber());
|
||||
// cacheUser.setOrganizationName(sysOrg.getCuCompanyName());
|
||||
// cacheUser.setOrganizationFullId(sysOrg.getOrgFullId());
|
||||
// cacheUser.setOrganizationFullName(sysOrg.getOrgFullName());
|
||||
// BeanUtils.copyProperties(sysUser, cacheUser);
|
||||
return cacheUser;
|
||||
} else {
|
||||
log.warn("systemClient未获取到用户信息,userId:{}", userId);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String decrypt(String value){
|
||||
String val = "";
|
||||
System.out.println("\r解密前文字:\r\n" + value);
|
||||
try {
|
||||
byte[] encodedData = RSAcheck.decryptBASE64(value);
|
||||
byte[] decodedData = RSAcheck.decryptByPrivateKey(encodedData, privateKey);
|
||||
val = new String(decodedData);
|
||||
System.out.println("解密后文字:\r\n" + val);
|
||||
}catch (Exception e){
|
||||
log.error("解密失败 异常!",e);
|
||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("解密失败",true);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
@ -21,6 +22,7 @@ import java.util.concurrent.Executor;
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
@EnableConfigurationProperties(AsyncProperties.class)
|
||||
@ConditionalOnProperty(prefix = "async.thead.pool", name = "core-size", matchIfMissing = false)
|
||||
@Slf4j
|
||||
public class AsyncConfig implements AsyncConfigurer {
|
||||
|
||||
|
@ -15,8 +15,10 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.RedisClusterConfiguration;
|
||||
import org.springframework.data.redis.connection.RedisNode;
|
||||
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisOperations;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
@ -69,10 +71,26 @@ public class RedisLettuceConfig {
|
||||
}
|
||||
|
||||
private LettuceConnectionFactory getLettuceConnectionFactory(Integer db) {
|
||||
LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(this.sentinelConfig());
|
||||
lettuceConnectionFactory.setDatabase(db);
|
||||
lettuceConnectionFactory.afterPropertiesSet();
|
||||
return lettuceConnectionFactory;
|
||||
LettuceConnectionFactory factory;
|
||||
if (redisProperties.getCluster() != null && redisProperties.getCluster().getNodes() != null && !redisProperties.getCluster().getNodes().isEmpty()) {
|
||||
// 集群模式
|
||||
RedisClusterConfiguration clusterConfig = new RedisClusterConfiguration(redisProperties.getCluster().getNodes());
|
||||
clusterConfig.setPassword(redisProperties.getPassword());
|
||||
factory = new LettuceConnectionFactory(clusterConfig);
|
||||
} else if (redisProperties.getSentinel() != null && redisProperties.getSentinel().getNodes() != null && !redisProperties.getSentinel().getNodes().isEmpty()) {
|
||||
// 哨兵模式
|
||||
factory = new LettuceConnectionFactory(this.sentinelConfig());
|
||||
} else {
|
||||
// 单机模式
|
||||
RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration();
|
||||
standaloneConfig.setHostName(redisProperties.getHost());
|
||||
standaloneConfig.setPort(redisProperties.getPort());
|
||||
standaloneConfig.setPassword(redisProperties.getPassword());
|
||||
factory = new LettuceConnectionFactory(standaloneConfig);
|
||||
}
|
||||
factory.setDatabase(db);
|
||||
factory.afterPropertiesSet();
|
||||
return factory;
|
||||
}
|
||||
|
||||
private RedisSentinelConfiguration sentinelConfig() {
|
||||
|
@ -86,7 +86,7 @@ public class LogAspect {
|
||||
OperationLogDetail annotation = signature.getMethod().getAnnotation(OperationLogDetail.class);
|
||||
if (annotation != null) {
|
||||
operationLog.setLevel("aop");
|
||||
operationLog.setDescribe(getDetail(((MethodSignature) joinPoint.getSignature()).getParameterNames(), joinPoint.getArgs(), annotation));
|
||||
operationLog.setDetail(getDetail(((MethodSignature) joinPoint.getSignature()).getParameterNames(), joinPoint.getArgs(), annotation));
|
||||
operationLog.setOperationType(annotation.operationType().getValue());
|
||||
operationLog.setBusinessModule(annotation.businessModule().getValue());
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public class OperationLog implements Serializable {
|
||||
/**
|
||||
* 日志描述
|
||||
*/
|
||||
private String describe;
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 方法运行时间
|
||||
|
@ -106,7 +106,7 @@ public class OperationLogServiceImpl implements OperationLogService {
|
||||
.setResult(result)
|
||||
.setBusinessModule(businessModule.getValue())
|
||||
.setLevel("business")
|
||||
.setDescribe(detail)
|
||||
.setDetail(detail)
|
||||
.setTransactionId(transactionId)
|
||||
.setOperationType(type.getValue()));
|
||||
}
|
||||
|
@ -66,5 +66,7 @@ public interface SmsFeignClient {
|
||||
* @return 发送短信的响应结果
|
||||
*/
|
||||
@GetMapping("/sms/send")
|
||||
BaseResponse<SmsSendResponse.TemplateSMS> sendSms(@RequestParam String[] mobiles, @RequestParam String templateId, @RequestParam String[] datas);
|
||||
BaseResponse<SmsSendResponse.TemplateSMS> sendSms(@RequestParam String[] mobiles, @RequestParam String templateId, @RequestParam String[] datas,
|
||||
@RequestParam String reqId,
|
||||
@RequestParam(required = false) String subAppend);
|
||||
}
|
||||
|
@ -53,7 +53,10 @@ public class SmsFeignClientFallback implements SmsFeignClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse<SmsSendResponse.TemplateSMS> sendSms(String[] mobiles, String templateId, String[] datas) {
|
||||
public BaseResponse<SmsSendResponse.TemplateSMS> sendSms(String[] mobiles, String templateId, String[] datas,
|
||||
String reqId,
|
||||
String subAppend
|
||||
) {
|
||||
String json = " {\n" +
|
||||
" \"code\":200,\n" +
|
||||
" \"message\":\"mock\",\n" +
|
||||
|
@ -0,0 +1,33 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.constant.ServiceNameConstants;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.entity.WorkflowCreateResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.fallback.WorkflowFeignClientFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = ServiceNameConstants.EXTEND_SERVICE, fallback = WorkflowFeignClientFallback.class)
|
||||
public interface WorkflowFeignClient {
|
||||
|
||||
/**
|
||||
* @param userEmail 发起人邮箱
|
||||
* @param userName 发起人用户名
|
||||
* @param userOrgId 发起人所在部门id
|
||||
* @param modelId 流程模型ID
|
||||
* @param businessKey 节点标识
|
||||
* @param url 流程审批详情页面URL(urlencode)
|
||||
* @return 流程创建结果 获取processInstanceId与业务数据ID进行关联,为了后续回调处理后续业务
|
||||
*/
|
||||
@GetMapping("/workflow/create")
|
||||
BaseResponse<WorkflowCreateResponse> create(
|
||||
@RequestParam String userEmail,
|
||||
@RequestParam String userName,
|
||||
@RequestParam String userOrgId,
|
||||
@RequestParam String modelId,
|
||||
@RequestParam String businessKey,
|
||||
@RequestParam String url
|
||||
);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 流程审批业务类型枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BusinessTypeEnum {
|
||||
|
||||
SUPPLIER_ACCESS_APPROVAL("supplierAccessApproval", "供应商准入审批"),
|
||||
SUPPLIER_CATEGORY_ACCESS_APPROVAL("supplierCategoryAccessApproval", "供应商品类准入审批"),
|
||||
SUPPLIER_INFO_CHANGE_APPROVAL("supplierInfoChangeApproval", "供应商信息变更审批"),
|
||||
BLACKLIST_APPROVAL("blacklistApproval", "黑名单审批"),
|
||||
EXIT_APPROVAL("exitApproval", "退出审批"),
|
||||
CATEGORY_LIBRARY_APPROVAL("categoryLibraryApproval", "品类库审批"),
|
||||
CATEGORY_LIBRARY_SUPPLIER_APPROVAL("categoryLibrarySupplierApproval","品类库供应商入库审批"),
|
||||
EVALUATION_APPROVAL("evaluationApproval", "评价审批");
|
||||
|
||||
private final String key;
|
||||
private final String desc;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
{
|
||||
"resultCode": "0",
|
||||
"resultMsg": "成功",
|
||||
"resultObject": {
|
||||
"token": "5f50b59a-faf8-4ea2-b7e9-2e4fa04c46fa",
|
||||
"id": 7000458,
|
||||
"userId": 7180012,
|
||||
"loginName": "dingx23",
|
||||
"loginPassword": null,
|
||||
"userName": "丁侠",
|
||||
"userMail": "dingx23@chinaunicom.cn",
|
||||
"userPhone": "",
|
||||
"userStatus": "1",
|
||||
"userType": "1",
|
||||
"createId": "0",
|
||||
"createTime": "2023-07-18T16:23:28",
|
||||
"updateId": "0",
|
||||
"updateTime": "2025-05-07T19:07:19",
|
||||
"attributes": {
|
||||
"oaOrgInfo": null,
|
||||
"oaEmpCode": "0958168",
|
||||
"siteInfo": "4,999,1,联通软件研究院-公共平台与架构研发事业部,主岗,"
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowBaseResponse<T> {
|
||||
|
||||
private String resultCode;
|
||||
private String resultMsg;
|
||||
private T resultObject;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
{
|
||||
"modelId": "1953018896810274817",
|
||||
"businessKey":"10002",
|
||||
"variables": [{
|
||||
"name":"internal_app_env_key",
|
||||
"value":"env_test"
|
||||
},{
|
||||
"name":"url",
|
||||
"value":"http://10.0.0.125:3000/index"
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowCreateRequest {
|
||||
private String modelId;
|
||||
private String businessKey;
|
||||
private WorkflowVariable[] variables;
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* {
|
||||
"id": "69f4b176-7335-11f0-ad9f-a2843e06dd7d",
|
||||
"processDefId": "Process_2p4rq5b:1:2ba9b30c-72a4-11f0-ad9f-a2843e06dd7d",
|
||||
"orgId": "ce7d12dd8bcd416aafe3bea5a4e96edd",
|
||||
"appId": "580470127",
|
||||
"envType": "env_test",
|
||||
"startUserName": "丁侠",
|
||||
"startDepartmentId": null,
|
||||
"customInfoAttr": null,
|
||||
"memo": null,
|
||||
"processCode": "cslc",
|
||||
"formKey": "10002",
|
||||
"appInfo": "{\"appId\":580470127,\"appCode\":\"clc1752747475234\",\"appName\":\"ceshi07\",\"appUseType\":\"1001\",\"appType\":\"0\",\"appEnv\":\"env_dev,env_test\",\"orgId\":\"ce7d12dd8bcd416aafe3bea5a4e96edd\",\"orgName\":\"中国远洋海运集团有限公司\",\"statusCd\":\"00A\"}",
|
||||
"startUserId": "7180012",
|
||||
"processName": "测试流程",
|
||||
"processAttr": "{}",
|
||||
"startTime": "2025-08-07 10:22:49",
|
||||
"businessKey": "10002",
|
||||
"processType": "Main",
|
||||
"businessStatus": null,
|
||||
"processInstanceId": "69f4b176-7335-11f0-ad9f-a2843e06dd7d",
|
||||
"processInstanceName": "测试流程",
|
||||
"createTime": "2025-08-07 10:22:49",
|
||||
"endTime": null,
|
||||
"startUser": {
|
||||
"userId": "7180012",
|
||||
"loginName": "dingx23",
|
||||
"userName": "丁侠",
|
||||
"userMail": "dingx23@chinaunicom.cn",
|
||||
"userPhone": "",
|
||||
"oaOrgInfo": "联通软件研究院-公共平台与架构研发事业部"
|
||||
},
|
||||
"tenantId": "580470127",
|
||||
"processVariables": {
|
||||
"processInstanceId": "69f4b176-7335-11f0-ad9f-a2843e06dd7d",
|
||||
"internal_app_env_key": "env_test",
|
||||
"internal_app_id": 580470127,
|
||||
"internal_process_attr": "{}",
|
||||
"internal_app_org_key": "ce7d12dd8bcd416aafe3bea5a4e96edd",
|
||||
"internal_start_user_name": "丁侠",
|
||||
"internal_start_user_id": "7180012",
|
||||
"internal_app_info_key": "{\"appId\":580470127,\"appCode\":\"clc1752747475234\",\"appName\":\"ceshi07\",\"appUseType\":\"1001\",\"appType\":\"0\",\"appEnv\":\"env_dev,env_test\",\"orgId\":\"ce7d12dd8bcd416aafe3bea5a4e96edd\",\"orgName\":\"中国远洋海运集团有限公司\",\"statusCd\":\"00A\"}",
|
||||
"url": "http://10.0.0.125:3000/index",
|
||||
"internal_process_code_": "cslc",
|
||||
"internal_start_form_key": "10002"
|
||||
}
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowCreateResponse {
|
||||
private String id;
|
||||
private String processDefId;
|
||||
private String orgId;
|
||||
private String appId;
|
||||
private String envType;
|
||||
private String startUserName;
|
||||
private String startDepartmentId;
|
||||
private String customInfoAttr;
|
||||
private String memo;
|
||||
private String processCode;
|
||||
private String formKey;
|
||||
private String appInfo;
|
||||
private String startUserId;
|
||||
private String processName;
|
||||
private String processAttr;
|
||||
private String startTime;
|
||||
private String businessKey;
|
||||
private String processType;
|
||||
private String businessStatus;
|
||||
private String processInstanceId;
|
||||
private String processInstanceName;
|
||||
private String createTime;
|
||||
private String endTime;
|
||||
private WorkflowUser startUser;
|
||||
private String tenantId;
|
||||
// private WorkflowProcessVariables processVariables;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowExchange {
|
||||
private String dateTime;
|
||||
private Boolean createUserWhenNotExist;
|
||||
private String userOrgId;
|
||||
private WorkflowUser userVo;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
"clientId":"zhongyuan-haiyun",
|
||||
"exchangeRequest":"zAW5fhAo3z078qTBd8jGkXqkmeivlYs1U4yslBoqYCgjDMIq33OJidLsP5WQhQDsZAq6h0kOJnBorg6dZFsAOI9grEOGSoqe22-WNzi6s03hFR0FbGtM1FPJYVh1rzGkOSFNhsS4ju_B5bJxyw204LegGIsPmQFCQxglz6WDB3zX2dZ9eWcr5zoDLbNoouZdv7wTw9iymvUH3uCofyp5aqjT4JNHniWh3BlQFngB57ss5T-aIxrRjHJbFJqDOT8T1Niiu11limSjv3uQlGTj_r12NpPoyKnrhgL8N8SJP70WrnzN5G6r8KPpG68V4A_Q"
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowTokenRequest {
|
||||
private String clientId;
|
||||
private String exchangeRequest;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
"token": "5f50b59a-faf8-4ea2-b7e9-2e4fa04c46fa",
|
||||
"id": 7000458,
|
||||
"userId": 7180012,
|
||||
"loginName": "dingx23",
|
||||
"loginPassword": null,
|
||||
"userName": "丁侠",
|
||||
"userMail": "dingx23@chinaunicom.cn",
|
||||
"userPhone": "",
|
||||
"userStatus": "1",
|
||||
"userType": "1",
|
||||
"createId": "0",
|
||||
"createTime": "2023-07-18T16:23:28",
|
||||
"updateId": "0",
|
||||
"updateTime": "2025-05-07T19:07:19",
|
||||
"attributes": {
|
||||
"oaOrgInfo": null,
|
||||
"oaEmpCode": "0958168",
|
||||
"siteInfo": "4,999,1,联通软件研究院-公共平台与架构研发事业部,主岗,"
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowTokenResponse {
|
||||
private String token;
|
||||
private Long id;
|
||||
private Long userId;
|
||||
private String loginName;
|
||||
private String loginPassword;
|
||||
private String userName;
|
||||
private String userMail;
|
||||
private String userPhone;
|
||||
private String userStatus;
|
||||
private String userType;
|
||||
private String createId;
|
||||
private String createTime;
|
||||
private String updateId;
|
||||
private String updateTime;
|
||||
private Attributes attributes;
|
||||
|
||||
@Data
|
||||
public static class Attributes {
|
||||
private String oaOrgInfo;
|
||||
private String oaEmpCode;
|
||||
private String siteInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowUser {
|
||||
private String loginName;
|
||||
private String loginPassword;
|
||||
private String userName;
|
||||
private String userMail;
|
||||
private String userPhone;
|
||||
private String oaOrgInfo;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WorkflowVariable {
|
||||
private String name;
|
||||
private String value;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.chinaunicom.mall.ebtp.common.workflow.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.client.WorkflowFeignClient;
|
||||
import com.chinaunicom.mall.ebtp.common.workflow.entity.WorkflowCreateResponse;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class WorkflowFeignClientFallback implements WorkflowFeignClient {
|
||||
|
||||
@Override
|
||||
public BaseResponse<WorkflowCreateResponse> create(String userEmail, String userName, String userOrgId, String modelId, String businessKey, String url) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -75,24 +75,6 @@ spring:
|
||||
sasl.mechanism: SCRAM-SHA-256
|
||||
sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123";
|
||||
|
||||
# 天宫 redis 需要使用哨兵进行访问
|
||||
redis:
|
||||
sentinel:
|
||||
master: eshop-redis
|
||||
nodes: 10.125.164.124:32718, 10.125.164.118:32716, 10.125.164.121:32716
|
||||
password: Unicom#135
|
||||
|
||||
# 天宫Eureka配置
|
||||
eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://10.242.37.148:5001/eureka
|
||||
instance:
|
||||
prefer-ip-address: true
|
||||
ip-address: 125.32.114.204
|
||||
hostname: 125.32.114.204
|
||||
instance-ip: 125.32.114.204:${server.port}
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
# 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射
|
||||
@ -123,6 +105,8 @@ hystrix:
|
||||
forceClosed: true
|
||||
|
||||
ribbon:
|
||||
eureka:
|
||||
enabled: false
|
||||
ReadTimeout: 20000 #请求处理的超时时间
|
||||
ConnectTimeout: 20000 #请求连接超时时间
|
||||
MaxAutoRetries: 0 #对当前实例的重试次数
|
||||
|
Reference in New Issue
Block a user