Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -87,8 +87,6 @@
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||
@@ -109,5 +107,10 @@
|
||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -120,4 +120,6 @@ public class CommonConstants {
|
||||
|
||||
public static final String TRANSFER = "transfer";
|
||||
|
||||
public static final String FIX_MOBILE_OPENID_TEST = "HSAY5531DA7";
|
||||
public static final String FIX_MOBILE_OPENID_ONLINE = "HSAY4AF322E";
|
||||
}
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 应用类型
|
||||
*/
|
||||
public enum AppTypeEnum {
|
||||
// 数智门店-钉钉
|
||||
DING_DING("dingding","数智门店-钉钉"),
|
||||
|
||||
//酷店掌-钉钉
|
||||
DING_DING2("dingding2","酷店掌-钉钉"),
|
||||
|
||||
// 企业微信-数智门店
|
||||
WX_APP("qw","数智门店-企业微信"),
|
||||
|
||||
// 企业微信-酷店掌
|
||||
WX_APP2("qw2","酷店掌-企业微信"),
|
||||
|
||||
//用户自己添加 独立app
|
||||
APP("app","数智门店-客户端"),
|
||||
|
||||
/**
|
||||
* 酷店掌-自建企业微信
|
||||
*/
|
||||
WX_SELF_APP("qw_self", "酷店掌-自建企业微信"),
|
||||
|
||||
/**
|
||||
* 酷店掌-自建企业微信代开发
|
||||
*/
|
||||
WX_SELF_DKF("qw_self_dkf", "酷店掌--自建企业微信代开发"),
|
||||
|
||||
/**
|
||||
* 酷店掌-企业微信私服
|
||||
*/
|
||||
WX_PRIVATE_APP("qw_private", "酷店掌-企业微信私服"),
|
||||
|
||||
WX_PRIVATE_ZHOU("qw_private_zdf","酷店掌-企业微信私服-周大福"),
|
||||
|
||||
/**
|
||||
* 门店通应用
|
||||
*/
|
||||
ONE_PARTY_APP("one_party", "门店通-钉钉"),
|
||||
|
||||
/**
|
||||
* 飞书
|
||||
*/
|
||||
FEI_SHU("fei_shu", "飞书")
|
||||
|
||||
;
|
||||
private String value;
|
||||
|
||||
private String message;
|
||||
|
||||
private static final Map<String, AppTypeEnum> map = Arrays.stream(values()).collect(Collectors.toMap(AppTypeEnum::getValue, Function.identity()));
|
||||
|
||||
AppTypeEnum(String value, String message) {
|
||||
this.value = value;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static String getMessage(String value){
|
||||
if(StringUtils.isBlank(value)){
|
||||
return "";
|
||||
}
|
||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
||||
if(appTypeEnum.value.equals(value)){
|
||||
return appTypeEnum.message;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static AppTypeEnum getAppType(String appType){
|
||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
||||
if(appTypeEnum.value.equals(appType)){
|
||||
return appTypeEnum;
|
||||
}
|
||||
}
|
||||
if(appType.startsWith(WX_SELF_APP.getValue())) {
|
||||
return WX_SELF_APP;
|
||||
}
|
||||
if(appType.startsWith(WX_PRIVATE_APP.getValue())) {
|
||||
return WX_PRIVATE_APP;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是钉钉平台
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isDingType(String value) {
|
||||
if (DING_DING.getValue().equals(value) || DING_DING2.getValue().equals(value) || ONE_PARTY_APP.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是企业微信平台
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isQwType(String value) {
|
||||
if (WX_APP.getValue().equals(value) || WX_APP2.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是飞书
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isFsType(String value) {
|
||||
if (FEI_SHU.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是酷店掌
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isCoolStore(String value) {
|
||||
if (WX_APP2.getValue().equals(value) || DING_DING2.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是数智门店
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isCoolCollege(String value) {
|
||||
if (WX_APP.getValue().equals(value) || DING_DING.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是企微自建应用或者企微私服
|
||||
* @param appType
|
||||
* @return
|
||||
*/
|
||||
public static boolean isWxSelfAndPrivateType(String appType) {
|
||||
if(StringUtils.isBlank(appType)){
|
||||
return false;
|
||||
}
|
||||
return appType.startsWith(AppTypeEnum.WX_SELF_APP.getValue())
|
||||
|| appType.startsWith(AppTypeEnum.WX_PRIVATE_APP.getValue());
|
||||
}
|
||||
|
||||
public static boolean qwIsGetUserName(String appType){
|
||||
if(StringUtils.isBlank(appType) || isDingType(appType)){
|
||||
return false;
|
||||
}
|
||||
return appType.startsWith(AppTypeEnum.WX_SELF_APP.getValue()) || appType.startsWith(AppTypeEnum.WX_PRIVATE_APP.getValue())
|
||||
|| appType.startsWith(AppTypeEnum.WX_SELF_DKF.getValue()) || appType.startsWith(AppTypeEnum.WX_PRIVATE_ZHOU.getValue());
|
||||
}
|
||||
|
||||
public static String getCode(String value){
|
||||
if(StringUtils.isBlank(value)){
|
||||
return "";
|
||||
}
|
||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
||||
if(appTypeEnum.message.equals(value)){
|
||||
return appTypeEnum.value;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static AppTypeEnum parseValue(String value) {
|
||||
return map.get(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* describe:
|
||||
*
|
||||
* @author zhouyiping
|
||||
* @date 2020/10/13
|
||||
*/
|
||||
public enum AuthRoleEnum {
|
||||
/**
|
||||
* 全企业数据
|
||||
*/
|
||||
ALL("all", "全企业数据"),
|
||||
|
||||
/**
|
||||
* 所在组织架构包含下级
|
||||
*/
|
||||
INCLUDE_SUBORDINATE("include_subordinate","所在组织架构包含下级"),
|
||||
|
||||
|
||||
// /**
|
||||
// * 所在的组织架构不包含下级
|
||||
// */
|
||||
NOT_INCLUDE_SUBORDINATE("not_include_subordinate","所在的组织架构不包含下级"),
|
||||
|
||||
/**
|
||||
* 仅自己的数据
|
||||
*/
|
||||
PERSONAL("personal","仅自己的数据");
|
||||
|
||||
private String code;
|
||||
private String msg;
|
||||
|
||||
protected static final Map<String, AuthRoleEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(AuthRoleEnum::getCode, Function.identity()));
|
||||
|
||||
AuthRoleEnum(String code, String msg){
|
||||
this.code=code;
|
||||
this.msg=msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
public static AuthRoleEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseStatusEnum
|
||||
* @Description:
|
||||
* @date 2021-09-17 15:53
|
||||
*/
|
||||
public enum EnterpriseStatusEnum {
|
||||
|
||||
/**
|
||||
* 状态-1 已删除 0初始 1正常 100冻结 88创建失败
|
||||
*/
|
||||
|
||||
DELETED(-1,"已删除"),
|
||||
INIT(0,"初始"),
|
||||
NORMAL(1,"正常"),
|
||||
FREEZE(100,"冻结"),
|
||||
CREATE_FAIL(88,"创建失败"),
|
||||
;
|
||||
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
|
||||
EnterpriseStatusEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static String getMessage(Integer code){
|
||||
if(Objects.isNull(code)){
|
||||
return "";
|
||||
}
|
||||
for (EnterpriseStatusEnum value : EnterpriseStatusEnum.values()) {
|
||||
if(code.equals(value.code)){
|
||||
return value.message;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author Aaron
|
||||
* @Description 业务统一返回码
|
||||
* @date 2019/12/20
|
||||
*/
|
||||
public enum RegionTypeEnum {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
ROOT("root", "根节点"),
|
||||
|
||||
|
||||
PATH("path", "区域"),
|
||||
|
||||
|
||||
STORE("store", "门店");
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
private String desc;
|
||||
|
||||
RegionTypeEnum(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.management.relation.Role;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public enum RoleEnum {
|
||||
|
||||
/**
|
||||
* 管理员
|
||||
*/
|
||||
MASTER("20000000", "管理员", 1,"master"),
|
||||
/**
|
||||
* 子管理员
|
||||
*/
|
||||
SUB_MASTER("80000000", "子管理员", 2,"sub_master"),
|
||||
/**
|
||||
* 普通员工
|
||||
*/
|
||||
EMPLOYEE("30000000", "未分配", 99999999,"employee"),
|
||||
/**
|
||||
* 部门负责人
|
||||
*/
|
||||
DEPT_LEADER("40000000", "部门负责人", 10,"dept_leader"),
|
||||
/**
|
||||
* 店长
|
||||
*/
|
||||
SHOPOWNER("50000000", "店长", 3,"shopowner"),
|
||||
/**
|
||||
* 运营
|
||||
*/
|
||||
OPERATOR("60000000", "运营", 4,"operator"),
|
||||
/**
|
||||
* 店员
|
||||
*/
|
||||
CLERK("70000000", "店员", 5,"clerk");
|
||||
|
||||
|
||||
private static final Map<String, RoleEnum> MAP = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(RoleEnum::getRoleEnum, Function.identity()));
|
||||
|
||||
private static final Map<String, RoleEnum> ROLE_ID_MAP = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(RoleEnum::getId, Function.identity()));
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
@Getter
|
||||
@Setter
|
||||
private Integer priority;
|
||||
|
||||
private String roleEnum;
|
||||
|
||||
|
||||
RoleEnum(String id, String name, Integer priority, String roleEnum) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.priority = priority;
|
||||
this.roleEnum=roleEnum;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getRoleEnum() {
|
||||
return roleEnum;
|
||||
}
|
||||
|
||||
public static RoleEnum getByCode(String code) {
|
||||
return MAP.get(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是管理员 及 子管理员
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static boolean isAdmin(String code){
|
||||
if(MASTER.getRoleEnum().equals(code) || SUB_MASTER.getRoleEnum().equals(code)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id 判断 是否是管理员 及 子管理员
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static boolean isAdminById(String id){
|
||||
if(MASTER.getId().equals(id) || SUB_MASTER.getId().equals(id)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否包含角色id
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public static boolean isContainsRoleId(String roleId){
|
||||
return ROLE_ID_MAP.containsKey(roleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 门店删除状态枚举
|
||||
*/
|
||||
public enum StoreIsDeleteEnum {
|
||||
EFFECTIVE("effective"),//有效
|
||||
|
||||
INVALID("invalid"),//无效
|
||||
|
||||
IGNORED("ignored"), //忽略
|
||||
|
||||
UN_SYNC("unSync"); // 未同步
|
||||
|
||||
private final String value;
|
||||
|
||||
private static final Map<String, StoreIsDeleteEnum> map = Arrays.stream(values()).collect(Collectors.toMap(StoreIsDeleteEnum::getValue, Function.identity()));
|
||||
|
||||
StoreIsDeleteEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static StoreIsDeleteEnum parse(int value) {
|
||||
return map.get(value);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author wxp
|
||||
* @FileName: SubordinateSourceEnum
|
||||
* @Description: auto自动关联 select手动选择
|
||||
* @date 2022-12-30 17:12
|
||||
*/
|
||||
public enum SubordinateSourceEnum {
|
||||
|
||||
AUTO("auto", "关联区域门店权限"),
|
||||
SELECT("select", "手动选择");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
protected static final Map<String, SubordinateSourceEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(SubordinateSourceEnum::getCode, Function.identity()));
|
||||
|
||||
SubordinateSourceEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static SubordinateSourceEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zyp
|
||||
*/
|
||||
public enum UserAuthMappingTypeEnum {
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
REGION("region","区域"),
|
||||
/**
|
||||
* 门店
|
||||
*/
|
||||
STORE("store","门店");
|
||||
|
||||
private String code;
|
||||
private String desc;
|
||||
public static final Map<String, UserAuthMappingTypeEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(UserAuthMappingTypeEnum::getCode, Function.identity()));
|
||||
|
||||
UserAuthMappingTypeEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static UserAuthMappingTypeEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: UserPositionEnum
|
||||
* @Description:用户身份
|
||||
* @date 2023-06-19 16:37
|
||||
*/
|
||||
public enum UserPositionEnum {
|
||||
|
||||
INVESTMENT_MANAGER("investment_manager", "招商经理"),
|
||||
INVESTMENT_LEADER("investment_leader", "招商负责人"),
|
||||
DEVELOPMENT_DIRECTOR("development_director", "开发主管"),
|
||||
DEVELOPMENT_MANAGER("development_manager", "开发经理"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
UserPositionEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author wxp
|
||||
* @FileName: UserSelectRangeEnum
|
||||
* @Description: 用户选取范围 共同编辑人范围:self-仅自己,all-全部人员,define-自定义
|
||||
* @date 2022-12-30 17:12
|
||||
*/
|
||||
public enum UserSelectRangeEnum {
|
||||
|
||||
SELF("self", "仅自己"),
|
||||
ALL("all", "全部人员"),
|
||||
DEFINE("define", "自定义");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
protected static final Map<String, UserSelectRangeEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(UserSelectRangeEnum::getCode, Function.identity()));
|
||||
|
||||
UserSelectRangeEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static UserSelectRangeEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.cool.store.exception.ServiceException;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
/**
|
||||
* https://cloud.tencent.com/developer/article/1823249
|
||||
* 前后端约定
|
||||
*/
|
||||
public class AESDecryptor {
|
||||
|
||||
private static String Algorithm = "AES";
|
||||
private static String AlgorithmProvider = "AES/CBC/PKCS5Padding"; //算法/模式/补码方式
|
||||
|
||||
public static byte[] generatorKey() throws NoSuchAlgorithmException {
|
||||
KeyGenerator keyGenerator = KeyGenerator.getInstance(Algorithm);
|
||||
keyGenerator.init(256);//默认128,获得无政策权限后可为192或256
|
||||
SecretKey secretKey = keyGenerator.generateKey();
|
||||
return secretKey.getEncoded();
|
||||
}
|
||||
|
||||
public static IvParameterSpec getIv(byte[] ivstr) throws UnsupportedEncodingException {
|
||||
IvParameterSpec ivParameterSpec = new IvParameterSpec(ivstr);
|
||||
return ivParameterSpec;
|
||||
}
|
||||
|
||||
public static String encrypt(String src, String keystr, IvParameterSpec iv) throws
|
||||
NoSuchAlgorithmException,
|
||||
NoSuchPaddingException,
|
||||
InvalidKeyException,
|
||||
IllegalBlockSizeException,
|
||||
BadPaddingException,
|
||||
UnsupportedEncodingException,
|
||||
InvalidAlgorithmParameterException {
|
||||
byte[] key = keystr.getBytes("utf-8");
|
||||
SecretKey secretKey = new SecretKeySpec(key, Algorithm);
|
||||
IvParameterSpec ivParameterSpec = iv;
|
||||
Cipher cipher = Cipher.getInstance(AlgorithmProvider);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivParameterSpec);
|
||||
byte[] cipherBytes = cipher.doFinal(src.getBytes(Charset.forName("utf-8")));
|
||||
return byteToHexString(cipherBytes);
|
||||
}
|
||||
|
||||
public static String decrypt(String src, String keystr) {
|
||||
try {
|
||||
byte[] key = keystr.getBytes("utf-8");
|
||||
SecretKey secretKey = new SecretKeySpec(key, Algorithm);
|
||||
IvParameterSpec ivParameterSpec = getIv(Arrays.copyOfRange(keystr.getBytes("utf-8"), 0, 16));
|
||||
Cipher cipher = Cipher.getInstance(AlgorithmProvider);
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);
|
||||
byte[] hexBytes = hexStringToBytes(src);
|
||||
byte[] plainBytes = cipher.doFinal(hexBytes);
|
||||
return new String(plainBytes, "utf-8");
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将byte转换为16进制字符串
|
||||
*
|
||||
* @param src
|
||||
* @return
|
||||
*/
|
||||
public static String byteToHexString(byte[] src) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < src.length; i++) {
|
||||
int v = src[i] & 0xff;
|
||||
String hv = Integer.toHexString(v);
|
||||
if (hv.length() < 2) {
|
||||
sb.append("0");
|
||||
}
|
||||
sb.append(hv);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将16进制字符串装换为byte数组
|
||||
*
|
||||
* @param hexString
|
||||
* @return
|
||||
*/
|
||||
public static byte[] hexStringToBytes(String hexString) {
|
||||
hexString = hexString.toUpperCase();
|
||||
int length = hexString.length() / 2;
|
||||
char[] hexChars = hexString.toCharArray();
|
||||
byte[] b = new byte[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
int pos = i * 2;
|
||||
b[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
private static byte charToByte(char c) {
|
||||
return (byte) "0123456789ABCDEF".indexOf(c);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
/* // 密钥必须是16的倍数
|
||||
String keystr = "0123456789ABCDEF";
|
||||
String ivstr = "0123456789101112";
|
||||
String src = "Hello World";
|
||||
|
||||
System.out.println("密钥:" + keystr);
|
||||
System.out.println("偏移量:" + ivstr);
|
||||
System.out.println("原字符串:" + src);
|
||||
IvParameterSpec iv = getIv(ivstr);
|
||||
String enc = encrypt(src, keystr, iv);
|
||||
System.out.println("加密:" + enc);
|
||||
*/
|
||||
String enc = "38395651e391c4b8ca327c4742b7f52f";
|
||||
String keystr = "77fea013c3a6459685b83c21a2fc3411";
|
||||
String ivstr = "77fea013c3a64596";
|
||||
// IvParameterSpec iv = getIv(ivstr);
|
||||
String dec = decrypt(enc, keystr);
|
||||
System.out.println("解密:" + dec);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.cool.store.utils;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.lowagie.text.Document;
|
||||
import com.lowagie.text.Image;
|
||||
@@ -12,8 +11,7 @@ import com.lowagie.text.pdf.PdfWriter;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
|
||||
//生成资格面试通过函的工具
|
||||
public class PassLetterUtils {
|
||||
@@ -26,7 +24,7 @@ public class PassLetterUtils {
|
||||
* @param passCode 通过函编码
|
||||
* @param passTime 审批通过时间
|
||||
*/
|
||||
public static ByteArrayOutputStream genPassLetter(String partnerName, String passCode, String verifyCity, DateTime passTime) {
|
||||
public static ByteArrayOutputStream genPassLetter(String partnerName, String passCode, String verifyCity, Date passTime) {
|
||||
String passTimeStr = DateUtil.format(passTime, "yyyy年MM月dd日");
|
||||
Document document = new Document();
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
@@ -65,7 +63,7 @@ public class PassLetterUtils {
|
||||
* 生成 passCode 的方法,拆分出来方便单独获取 passCode
|
||||
* @return
|
||||
*/
|
||||
public static String genPassCode(DateTime passTime) {
|
||||
public static String genPassCode(Date passTime) {
|
||||
String randomNum = RandomUtil.randomNumbers(5);
|
||||
String passCode = "HSAY" + DateUtil.format(passTime, "yyMMdd") + "-" + randomNum;
|
||||
return passCode;
|
||||
|
||||
@@ -110,8 +110,6 @@
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||
@@ -131,6 +129,11 @@
|
||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
|
||||
@@ -64,4 +64,23 @@ public class EnterpriseUserDAO {
|
||||
public List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(List<String> regionIds, String keyword, boolean isLeader){
|
||||
return enterpriseUserMapper.searchUserByRegionIdsAndKeyword(regionIds, keyword, isLeader);
|
||||
}
|
||||
|
||||
public boolean isExistDeptUser(String regionId){
|
||||
if(StringUtils.isBlank(regionId)){
|
||||
return false;
|
||||
}
|
||||
return enterpriseUserMapper.getUserCountByRegionId(regionId) > CommonConstants.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门负责人
|
||||
* @param regionId
|
||||
* @return
|
||||
*/
|
||||
public List<EnterpriseUserDO> getUserListByDeptLeader(String regionId){
|
||||
if(StringUtils.isBlank(regionId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserListByDeptLeader(regionId);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.mapper.HyIntendDevZoneInfoMapper;
|
||||
import com.cool.store.mapper.HyOpenAreaInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -48,4 +50,16 @@ public class HyIntendDevZoneInfoDAO {
|
||||
return hyIntendDevZoneInfoMapper.getHyIntendDevZoneInfoList(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据组织架构获取配置信息
|
||||
* @param regionIds
|
||||
* @return
|
||||
*/
|
||||
public List<HyIntendDevZoneInfoDO> getZoneInfoByRegionIds(List<String> regionIds){
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyIntendDevZoneInfoMapper.getZoneInfoByRegionIds(regionIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -96,4 +96,16 @@ public class RegionDAO {
|
||||
return regionMapper.deleteRegionByRegionId(regionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的子节点
|
||||
* @param leadDeptIds
|
||||
*/
|
||||
public List<String> getSubRegionIds(List<String> leadDeptIds) {
|
||||
if(CollectionUtils.isEmpty(leadDeptIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<RegionDO> regionList = getRegionByRegionIds(leadDeptIds);
|
||||
List<String> regionPathList = regionList.stream().map(RegionDO::getRegionPath).collect(Collectors.toList());
|
||||
return regionMapper.getSubRegionIds(regionPathList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,4 +84,16 @@ public class UserRegionMappingDAO {
|
||||
return userRegionMappingMapper.getRegionIdsByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @param regionIds
|
||||
* @return
|
||||
*/
|
||||
public List<String> getUserListByRegionIds(List<String> regionIds){
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return userRegionMappingMapper.getUserListByRegionIds(regionIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,4 +61,20 @@ public interface EnterpriseUserMapper {
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseUserDO> searchUserByRegionIdsAndKeyword(@Param("regionIds") List<String> regionIds, @Param("keyword") String keyword, @Param("isLeader") boolean isLeader);
|
||||
|
||||
/**
|
||||
* 获取部门用户数
|
||||
* @param regionId
|
||||
* @return
|
||||
*/
|
||||
Integer getUserCountByRegionId(@Param("regionId") String regionId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取部门负责人用户列表
|
||||
* @param regionId
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseUserDO> getUserListByDeptLeader(String regionId);
|
||||
|
||||
}
|
||||
@@ -39,4 +39,11 @@ public interface HyIntendDevZoneInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
List<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type);
|
||||
|
||||
/**
|
||||
* 根据组织架构获取配置信息
|
||||
* @param regionIds
|
||||
* @return
|
||||
*/
|
||||
List<HyIntendDevZoneInfoDO> getZoneInfoByRegionIds(@Param("regionIds") List<String> regionIds);
|
||||
}
|
||||
@@ -22,4 +22,11 @@ public interface HyPartnerCertificationInfoMapper {
|
||||
* dateTime:2023-05-29 03:51
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerCertificationInfoDO record);
|
||||
|
||||
/**
|
||||
* 根据资质审核流程 id 获取面试会议 id
|
||||
* @param qualifyVerifyId 资质审核流程 id
|
||||
* @return 面试会议 id
|
||||
*/
|
||||
String getInterviewIdByQualifyVerifyId(@Param("qualifyVerifyId") String qualifyVerifyId);
|
||||
}
|
||||
@@ -79,4 +79,11 @@ public interface HyPartnerInterviewMapper {
|
||||
* 根据面试 id 查询面试信息
|
||||
*/
|
||||
HyPartnerInterviewDO selectByPrimaryKeySelective(String interviewId);
|
||||
|
||||
/**
|
||||
* 根据面试 id 获取意向区域
|
||||
* @param interviewId
|
||||
* @return
|
||||
*/
|
||||
String getVerifyCityByInterviewId(@Param("interviewId") String interviewId);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public interface HyPartnerInterviewPlanMapper {
|
||||
/**
|
||||
* 查询面试详情
|
||||
*
|
||||
* @param interviewId
|
||||
* @param interviewPlanId
|
||||
* @return
|
||||
*/
|
||||
InterviewVO getInterviewInfo(String interviewPlanId);
|
||||
|
||||
@@ -71,4 +71,11 @@ public interface RegionMapper {
|
||||
* @return
|
||||
*/
|
||||
Integer deleteRegionByRegionId(@Param("regionId") String regionId);
|
||||
|
||||
/**
|
||||
* 获取子节点
|
||||
* @param regionPathList
|
||||
* @return
|
||||
*/
|
||||
List<String> getSubRegionIds(@Param("regionPathList") List<String> regionPathList);
|
||||
}
|
||||
@@ -68,4 +68,11 @@ public interface UserRegionMappingMapper {
|
||||
* @return
|
||||
*/
|
||||
List<String> getRegionIdsByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @param regionIds
|
||||
* @return
|
||||
*/
|
||||
List<String> getUserListByRegionIds(@Param("regionIds") List<String> regionIds);
|
||||
}
|
||||
@@ -280,4 +280,12 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getUserCountByRegionId" resultType="integer">
|
||||
select count(1) from enterprise_user where deleted = 0 and user_region_ids like concat("%", #{regionId}, "%")
|
||||
</select>
|
||||
|
||||
<select id="getUserListByDeptLeader" resultMap="BaseResultMap">
|
||||
select user_id, leader_dept_ids from enterprise_user where leader_dept_ids like concat("%", #{regionId}, "%") and deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -128,4 +128,13 @@
|
||||
where type = #{type}
|
||||
and deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="getZoneInfoByRegionIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
hy_intend_dev_zone_info
|
||||
where
|
||||
deleted = 0 and <foreach collection="regionIds" separator="or" open="(" close=")" item="regionId">associated_region_id like concat("%", #{regionId}, "%")</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -213,8 +213,8 @@
|
||||
<if test="mobile != null and mobile!=''">
|
||||
mobile = #{mobile},
|
||||
</if>
|
||||
where partner_id = #{partnerId}
|
||||
</set>
|
||||
where partner_id = #{partnerId}
|
||||
</update>
|
||||
|
||||
<select id="getByPartnerIdAndLineId" resultMap="BaseResultMap" >
|
||||
|
||||
@@ -169,6 +169,12 @@
|
||||
<if test="record.partnership != null">
|
||||
partnership = #{record.partnership},
|
||||
</if>
|
||||
<if test="record.qualifyVerifyId != null">
|
||||
qualify_verify_id = #{record.qualifyVerifyId},
|
||||
</if>
|
||||
<if test="record.intentionContractNo != null">
|
||||
intention_contract_no = #{record.intentionContractNo},
|
||||
</if>
|
||||
<if test="record.wantSignTime != null">
|
||||
want_sign_time = #{record.wantSignTime},
|
||||
</if>
|
||||
@@ -215,6 +221,21 @@
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
<where>
|
||||
1 = 0
|
||||
<if test="record.id != null">
|
||||
or id = #{record.id}
|
||||
</if>
|
||||
<if test="record.partnerLineId != null">
|
||||
or partner_id_line_id = #{record.partnerLineId}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<!-- 根据资质审核流程 id 获取面试会议 id -->
|
||||
<select id="getInterviewIdByQualifyVerifyId" resultType="java.lang.String">
|
||||
select partner_interview_id
|
||||
from hy_partner_certification_info
|
||||
where qualify_verify_id = #{qualifyVerifyId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -220,8 +220,17 @@
|
||||
<if test="authCode != null">
|
||||
auth_code = #{authCode},
|
||||
</if>
|
||||
<if test="passFileUrl != null">
|
||||
pass_file_url = #{passFileUrl},
|
||||
<if test="passCode != null">
|
||||
pass_code = #{passCode},
|
||||
</if>
|
||||
<if test="passPdfUrl != null">
|
||||
pass_pdf_url = #{passPdfUrl},
|
||||
</if>
|
||||
<if test="passImageUrl != null">
|
||||
pass_image_url = #{passImageUrl},
|
||||
</if>
|
||||
<if test="passTime != null">
|
||||
pass_time = #{passTime},
|
||||
</if>
|
||||
<if test="expiryDate != null">
|
||||
expiry_date = #{expiryDate},
|
||||
@@ -250,11 +259,16 @@
|
||||
<if test="interviewerEnterTime != null">
|
||||
interviewer_enter_time = #{interviewerEnterTime},
|
||||
</if>
|
||||
<if test="qualifyVerifyId != null">
|
||||
qualify_verify_id = #{qualifyVerifyId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
<where>
|
||||
1 = 0
|
||||
<if test="id != null">
|
||||
or id = #{id}
|
||||
</if>
|
||||
<if test="interviewPlanId != null">
|
||||
or interview_plan_id = #{interviewPlanId}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<!-- 根据加盟商id查询面试信息 -->
|
||||
@@ -338,7 +352,7 @@
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
hy_partner_intent_info
|
||||
hy_partner_interview
|
||||
where
|
||||
id = #{interviewId}
|
||||
|
||||
@@ -364,4 +378,19 @@
|
||||
WHERE id = #{interviewId}
|
||||
</update>
|
||||
|
||||
<!-- 根据 interviewId 获取意向区域 -->
|
||||
<select id="getVerifyCityByInterviewId" resultType="java.lang.String">
|
||||
SELECT area_path
|
||||
FROM hy_open_area_info
|
||||
WHERE id = (
|
||||
SELECT want_shop_area
|
||||
FROM hy_partner_intent_info
|
||||
WHERE partner_line_id = (
|
||||
SELECT partner_line_id
|
||||
FROM hy_partner_interview
|
||||
WHERE id = #{interviewId}
|
||||
)
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -247,41 +247,44 @@
|
||||
|
||||
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">
|
||||
select hpip.id as interviewPlanId,
|
||||
hpip.partner_id as partnerId,
|
||||
hpui.username as partnerName,
|
||||
hpui.mobile as partnerMobile,
|
||||
hpip.room_id as roomId,
|
||||
hpip.start_time as startTime,
|
||||
hpui.username as interviewerName,
|
||||
hpui.mobile as interviewerMobile,
|
||||
hpip.interviewer as interviewerId,
|
||||
eu.name as interviewerName,
|
||||
eu.mobile as interviewerMobile,
|
||||
hpip.room_status as roomStatus,
|
||||
hpip.end_time as endTime
|
||||
from hy_partner_interview_plan hpip
|
||||
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
|
||||
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
|
||||
left join enterprise_user eu on hpip.interviewer = eu.user_id
|
||||
<where>
|
||||
<if test="record.partnerName !=null and record.partnerName!=''">
|
||||
hpui.username like concat('%',#{record.partnerName},'%')
|
||||
</if>
|
||||
<if test="record.partnerMobile !=null and record.partnerMobile!=''">
|
||||
hpui.mobile like concat('%',#{record.partnerMobile},'%')
|
||||
and hpui.mobile like concat('%',#{record.partnerMobile},'%')
|
||||
</if>
|
||||
<if test="record.roomId !=null and record.roomId!=''">
|
||||
hpip.room_id = #{record.roomId}
|
||||
and hpip.room_id = #{record.roomId}
|
||||
</if>
|
||||
<if test="record.interviewerName !=null and record.interviewerName!=''">
|
||||
hpui.username like concat('%',#{record.interviewerName},'%')
|
||||
and hpui.username like concat('%',#{record.interviewerName},'%')
|
||||
</if>
|
||||
<if test="record.interviewerMobile !=null and record.interviewerMobile!=''">
|
||||
hpui.mobile like concat('%',#{record.interviewerMobile},'%')
|
||||
and hpui.mobile like concat('%',#{record.interviewerMobile},'%')
|
||||
</if>
|
||||
<if test="record.roomStatus !=null and record.roomStatus!=''">
|
||||
hpip.room_status = #{record.roomStatus}
|
||||
and hpip.room_status = #{record.roomStatus}
|
||||
</if>
|
||||
<if test="record.startTime !=null and record.startTime!=''">
|
||||
hpip.start_time <= #{record.startTime}
|
||||
and hpip.start_time >= #{record.startTime}
|
||||
</if>
|
||||
<if test="record.endTime !=null and record.endTime!=''">
|
||||
hpip.end_time >= #{record.endTime}
|
||||
and hpip.end_time <= #{record.endTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
@@ -289,7 +292,8 @@
|
||||
<select id="getInterviewInfo" resultType="com.cool.store.vo.interview.InterviewVO">
|
||||
select hpip.id as interviewPlanId,
|
||||
hpi.id as interviewId,
|
||||
hpi.qualify_verify_id as qualifyVerifyId,
|
||||
hpci.qualify_verify_id as qualifyVerifyId,
|
||||
hpci.intention_contract_no as intentionContractNo,
|
||||
hpi.pass_time as passTime,
|
||||
hpi.pass_reason as passReason,
|
||||
hpi.recorder as recorderId,
|
||||
@@ -317,6 +321,7 @@
|
||||
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
|
||||
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
|
||||
left join hy_partner_interview hpi on hpip.id = hpi.interview_plan_id
|
||||
left join hy_partner_certification_info hpci on hpci.partner_interview_id = hpi.id
|
||||
where hpip.id = #{interviewPlanId}
|
||||
</select>
|
||||
<select id="selectBySelective" resultType="com.cool.store.entity.HyPartnerInterviewPlanDO">
|
||||
|
||||
@@ -204,4 +204,8 @@
|
||||
<update id="deleteRegionByRegionId">
|
||||
update region set deleted = 1 where region_id = #{regionId}
|
||||
</update>
|
||||
|
||||
<select id="getSubRegionIds" resultType="string">
|
||||
select region_id from region where deleted = 0 and <foreach collection="regionPathList" item="regionPath" open="(" close=")" separator="or"> region_path like (#{regionPath, '%'})</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -131,4 +131,8 @@
|
||||
select region_id from user_region_mapping where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getUserListByRegionIds" resultType="string">
|
||||
select user_id from user_region_mapping where region_id in <foreach collection="regionIds" item="regionId" open="(" close=")" separator=",">#{regionId}</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -88,8 +88,6 @@
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||
@@ -110,6 +108,11 @@
|
||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.dto.buser;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: UserPositionAndUserScopeDTO
|
||||
* @Description: 员工角色&获取线索范围
|
||||
* @date 2023-06-19 16:33
|
||||
*/
|
||||
@Data
|
||||
public class UserPositionAndUserScopeDTO {
|
||||
|
||||
@ApiModelProperty("招商经理用户ids")
|
||||
private List<String> investmentUserIds;
|
||||
|
||||
@ApiModelProperty("开发经理用户ids")
|
||||
private List<String> developmentUserIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.dto.mdm;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class CallbackDto {
|
||||
//
|
||||
// private Owner owner;
|
||||
//
|
||||
// private long modifiedTime;
|
||||
//
|
||||
// private Creator creator;
|
||||
//
|
||||
// private CreatorDepartment creatorDepartment;
|
||||
//
|
||||
// private String authCode;
|
||||
//
|
||||
// private Modifier modifier;
|
||||
//
|
||||
// private int amtDeposit;
|
||||
//
|
||||
// private FraSource fraSource;
|
||||
//
|
||||
// private String intendedSignerTel;
|
||||
//
|
||||
// private String sequenceNo;
|
||||
//
|
||||
// private String sequenceStatus;
|
||||
//
|
||||
// private String instanceId;
|
||||
//
|
||||
// private OwnerDepartment ownerDepartment;
|
||||
//
|
||||
// private SelfObject selfObject;
|
||||
//
|
||||
// private String name;
|
||||
//
|
||||
// private long createdTime;
|
||||
//
|
||||
// private String id;
|
||||
//
|
||||
// private long intendedSignDate;
|
||||
//
|
||||
// private String intendedSigner;
|
||||
//
|
||||
// private String systemsource;
|
||||
|
||||
}
|
||||
@@ -33,6 +33,12 @@ public class HyPartnerCertificationInfoDO implements Serializable {
|
||||
@ApiModelProperty("合作关系:1总部下属;2小区代直营;3县代直营;4县代下属;5区代直营;6区代下属")
|
||||
private String partnership;
|
||||
|
||||
@ApiModelProperty("资质审核流程id")
|
||||
private String qualifyVerifyId;
|
||||
|
||||
@ApiModelProperty("意向合同编号")
|
||||
private String intentionContractNo;
|
||||
|
||||
@ApiModelProperty("意向签约时间")
|
||||
private Date wantSignTime;
|
||||
|
||||
|
||||
@@ -54,11 +54,17 @@ public class HyPartnerInterviewDO implements Serializable {
|
||||
@ApiModelProperty("授权码")
|
||||
private String authCode;
|
||||
|
||||
@ApiModelProperty("资质审核流程id")
|
||||
private String qualifyVerifyId;
|
||||
@ApiModelProperty("通过函编码")
|
||||
private String passCode;
|
||||
|
||||
@ApiModelProperty("函文件url")
|
||||
private String passFileUrl;
|
||||
@ApiModelProperty("函文件Pdf url")
|
||||
private String passPdfUrl;
|
||||
|
||||
@ApiModelProperty("函文件image url")
|
||||
private String passImageUrl;
|
||||
|
||||
@ApiModelProperty("审核通过时间")
|
||||
private Date passTime;
|
||||
|
||||
@ApiModelProperty("有效期")
|
||||
private Date expiryDate;
|
||||
|
||||
@@ -12,9 +12,9 @@ import lombok.Data;
|
||||
@Data
|
||||
@ApiModel
|
||||
public class GetFreeBusyListReq {
|
||||
@ApiModelProperty("开始时间")
|
||||
@ApiModelProperty(value = "开始时间", required = true)
|
||||
private String startDate;
|
||||
@ApiModelProperty("结束时间")
|
||||
@ApiModelProperty(value = "结束时间",required = true)
|
||||
private String endDate;
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerId;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Api("资质审核回调入参")
|
||||
public class QualificationCallbackReq {
|
||||
|
||||
@ApiModelProperty(value = "审核流程id", required = true)
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty(value = "流程状态 已完成:FINISHED, 已作废:CANCELED", required = true)
|
||||
private String sequenceStatus;
|
||||
|
||||
@ApiModelProperty(value = "意向签约人", required = true)
|
||||
private String intendedSigner;
|
||||
|
||||
@ApiModelProperty(value = "审核通过时间", required = true)
|
||||
private long modifiedTime;
|
||||
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class InterviewVO {
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "面试过程信息视频URL数组", required = true)
|
||||
private List<String> processInfoList;
|
||||
private List<String> vedioList;
|
||||
|
||||
@ApiModelProperty(value = "面试过程信息未解析String", required = false)
|
||||
private String processInfo;
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.cool.store.service;
|
||||
import com.cool.store.dto.buser.UserPositionAndUserScopeDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.request.EnterpriseUserRequest;
|
||||
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
|
||||
import com.cool.store.vo.buser.EnterpriseUserPageVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -25,4 +23,16 @@ public interface EnterpriseUserService {
|
||||
*/
|
||||
List<EnterpriseUserSingleInfoVO> getInvestmentManagerList(String type,String userId,String keyword);
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户角色已用户管辖的员工范围
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
UserPositionAndUserScopeDTO getUserIdsByScope(String userId);
|
||||
|
||||
|
||||
|
||||
List<EnterpriseUserSingleInfoVO> getDevelopmentDirectorList(String wantShopArea);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
import com.cool.store.request.QualificationCallbackReq;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
@@ -10,4 +11,6 @@ import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
*/
|
||||
public interface FlowService {
|
||||
void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException;
|
||||
|
||||
void qualificationCallback(QualificationCallbackReq request);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface WechatMiniAppService {
|
||||
|
||||
PartnerUserInfoVO miniProgramLogin(MiniProgramLoginDTO param);
|
||||
|
||||
Boolean updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO);
|
||||
String updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO);
|
||||
|
||||
PartnerUserInfoVO getUserInfo(String mobile, String openId);
|
||||
}
|
||||
|
||||
@@ -243,9 +243,20 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||
break;
|
||||
case DEPARTMENT_DELETED:
|
||||
boolean leafNode = regionDAO.isLeafNode(departmentDetail.getId());
|
||||
if(leafNode){
|
||||
boolean isExistUser = enterpriseUserDAO.isExistDeptUser(departmentDetail.getId());
|
||||
if(leafNode && !isExistUser){
|
||||
//叶子节点的时候会删除部门
|
||||
regionDAO.deleteRegionByRegionId(departmentDetail.getId());
|
||||
//清除负责人信息
|
||||
List<EnterpriseUserDO> leaderUserList = enterpriseUserDAO.getUserListByDeptLeader(departmentDetail.getId());
|
||||
for (EnterpriseUserDO enterpriseUser : leaderUserList) {
|
||||
List<String> existDeptIds = JSONObject.parseArray(enterpriseUser.getLeaderDeptIds()).stream().map(String::valueOf).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(existDeptIds)){
|
||||
existDeptIds.remove(departmentDetail.getId());
|
||||
}
|
||||
enterpriseUser.setLeaderDeptIds(JSONObject.toJSONString(existDeptIds));
|
||||
}
|
||||
enterpriseUserDAO.batchInsertOrUpdate(leaderUserList);
|
||||
}else{
|
||||
syncAll();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.buser.UserPositionAndUserScopeDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.UserPositionEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.service.EnterpriseUserService;
|
||||
import com.cool.store.service.ZoneService;
|
||||
import com.cool.store.vo.EnterpriseUserSingleInfoVO;
|
||||
@@ -10,10 +15,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -31,11 +34,13 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
||||
@Resource
|
||||
private EnterpriseUserRoleDAO enterpriseUserRoleDAO;
|
||||
@Resource
|
||||
ZoneService zoneService;
|
||||
private ZoneService zoneService;
|
||||
@Resource
|
||||
RegionDAO regionDAO;
|
||||
private RegionDAO regionDAO;
|
||||
@Resource
|
||||
UserRegionMappingDAO userRegionMappingDAO;
|
||||
private UserRegionMappingDAO userRegionMappingDAO;
|
||||
@Resource
|
||||
private HyIntendDevZoneInfoDAO hyIntendDevZoneInfoDAO;
|
||||
|
||||
|
||||
|
||||
@@ -87,4 +92,52 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
||||
});
|
||||
return enterpriseUserSingleInfoVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserPositionAndUserScopeDTO getUserIdsByScope(String userId) {
|
||||
EnterpriseUserDO userInfo = enterpriseUserDAO.getUserInfoById(userId);
|
||||
if(Objects.isNull(userInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.USER_NOT_EXIST);
|
||||
}
|
||||
UserPositionAndUserScopeDTO result = new UserPositionAndUserScopeDTO();
|
||||
if(!userInfo.getIsLeader()){
|
||||
result.setDevelopmentUserIds(Arrays.asList(userId));
|
||||
result.setInvestmentUserIds(Arrays.asList(userId));
|
||||
return result;
|
||||
}
|
||||
List<String> leadDeptIds = JSONObject.parseArray(userInfo.getLeaderDeptIds()).stream().map(String::valueOf).collect(Collectors.toList());
|
||||
//获取这些区域的子节点
|
||||
List<String> subRegionIds = regionDAO.getSubRegionIds(leadDeptIds);
|
||||
//这些部门是否关联了意向区域
|
||||
List<HyIntendDevZoneInfoDO> zoneInfoList = hyIntendDevZoneInfoDAO.getZoneInfoByRegionIds(subRegionIds);
|
||||
if(CollectionUtils.isEmpty(zoneInfoList)){
|
||||
result.setDevelopmentUserIds(Arrays.asList(userId));
|
||||
result.setInvestmentUserIds(Arrays.asList(userId));
|
||||
return result;
|
||||
}
|
||||
//意向区域
|
||||
List<String> intendList = zoneInfoList.stream().filter(o -> "intent".equals(o.getType())).flatMap(o->JSONObject.parseArray(o.getAssociatedRegionId(), String.class).stream()).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(intendList)){
|
||||
//获取负责的区域
|
||||
intendList.retainAll(subRegionIds);
|
||||
List<String> userList = userRegionMappingDAO.getUserListByRegionIds(intendList);
|
||||
userList.add(userId);
|
||||
result.setInvestmentUserIds(userList);
|
||||
}
|
||||
//开发区域
|
||||
List<String> developementList = zoneInfoList.stream().filter(o -> "developement".equals(o.getType())).flatMap(o->JSONObject.parseArray(o.getAssociatedRegionId(), String.class).stream()).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(developementList)){
|
||||
//获取负责的区域
|
||||
developementList.retainAll(subRegionIds);
|
||||
List<String> userList = userRegionMappingDAO.getUserListByRegionIds(developementList);
|
||||
userList.add(userId);
|
||||
result.setDevelopmentUserIds(userList);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnterpriseUserSingleInfoVO> getDevelopmentDirectorList(String wantShopArea) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,9 +96,8 @@ public class FeiShuServiceImpl implements FeiShuService {
|
||||
long endTimeLong = DateUtil.parse(endStr).getTime();
|
||||
|
||||
for (UserFreeBusyInfoDTO userFreeBusyInfoDTO : UserFreeBusyInfoList) {
|
||||
//如果查询结果中的开始时间和结束时间在时间段内,则设置为忙碌
|
||||
if (( userFreeBusyInfoDTO.getStartTime()>startTimeLong && userFreeBusyInfoDTO.getStartTime() < endTimeLong)
|
||||
|| (userFreeBusyInfoDTO.getEndTime() > startTimeLong && userFreeBusyInfoDTO.getEndTime() < endTimeLong)) {
|
||||
//比较两个时间段是否有重叠
|
||||
if(!(endTimeLong <= userFreeBusyInfoDTO.getStartTime() || startTimeLong >= userFreeBusyInfoDTO.getEndTime())){
|
||||
freeBusyInfo.setFree(false);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@ package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dto.login.UserIdInfoDTO;
|
||||
import com.cool.store.dto.mdm.AccessTokenDTO;
|
||||
import com.cool.store.dto.response.MDMResultDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.DataSourceEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
@@ -17,18 +18,28 @@ import com.cool.store.mapper.DingdingUserMapper;
|
||||
import com.cool.store.mapper.HyPartnerCertificationInfoMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.mapper.HyPartnerLineInfoMapper;
|
||||
import com.cool.store.oss.OSSServer;
|
||||
import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
import com.cool.store.request.QualificationCallbackReq;
|
||||
import com.cool.store.request.RpcCreateQualifyVerfyReq;
|
||||
import com.cool.store.request.RpcGetMdmTokenReq;
|
||||
import com.cool.store.service.FlowService;
|
||||
import com.cool.store.utils.PDFUtils;
|
||||
import com.cool.store.utils.PassLetterUtils;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.RestTemplateUtil;
|
||||
import com.cool.store.vo.PartnerPassLetterDetailVO;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -63,7 +74,11 @@ public class FlowServiceImpl implements FlowService {
|
||||
@Autowired
|
||||
private HyPartnerCertificationInfoMapper hyPartnerCertificationInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private OSSServer ossServer;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException {
|
||||
//1.发起加盟商资质审核
|
||||
RpcCreateQualifyVerfyReq rpcRequest = new RpcCreateQualifyVerfyReq();
|
||||
@@ -96,7 +111,8 @@ public class FlowServiceImpl implements FlowService {
|
||||
rpcRequest.setIntendedSigner(request.getIntentionSignerUsername());
|
||||
rpcRequest.setIntendedSignerTel(request.getIntentionSignerMobile());
|
||||
|
||||
String qualifyVerifyId = createQualifyVerify(rpcRequest);
|
||||
//通过 rpc 请求审核系统获取返回数据
|
||||
Map<String, String> qualifyVerifyRespData = JSON.parseObject(createQualifyVerify(rpcRequest), new TypeReference<HashMap<String,String>>() {});
|
||||
//2.更新审核信息
|
||||
HyPartnerCertificationInfoDO partnerCertificationInfoDO = new HyPartnerCertificationInfoDO();
|
||||
partnerCertificationInfoDO.setPartnerId(request.getPartnerId());
|
||||
@@ -118,6 +134,10 @@ public class FlowServiceImpl implements FlowService {
|
||||
partnerCertificationInfoDO.setSignerRealControlRelationCert(request.getSignerRealControlRelationCert());
|
||||
partnerCertificationInfoDO.setCreateTime(new Date());
|
||||
partnerCertificationInfoDO.setUpdateTime(new Date());
|
||||
//set 资质审核流程id
|
||||
partnerCertificationInfoDO.setQualifyVerifyId(qualifyVerifyRespData.get("id"));
|
||||
//set 意向合同编号
|
||||
partnerCertificationInfoDO.setIntentionContractNo(qualifyVerifyRespData.get("sequenceNo"));
|
||||
hyPartnerCertificationInfoMapper.updateByPrimaryKeySelective(partnerCertificationInfoDO);
|
||||
//3.更新面试信息
|
||||
//根据面试id获取面试信息
|
||||
@@ -125,7 +145,6 @@ public class FlowServiceImpl implements FlowService {
|
||||
if (Objects.isNull(hyPartnerInterviewDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
}
|
||||
hyPartnerInterviewDO.setQualifyVerifyId(qualifyVerifyId);
|
||||
hyPartnerInterviewDO.setUpdateTime(new Date());
|
||||
//更新
|
||||
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_4.getCode()));
|
||||
@@ -133,12 +152,56 @@ public class FlowServiceImpl implements FlowService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void qualificationCallback(QualificationCallbackReq request) {
|
||||
//1. 信息是否完整
|
||||
if (null == request.getSequenceStatus() || "".equals(request.getSequenceStatus())) {
|
||||
log.error("MDM回调入参缺失,request{}", JSON.toJSONString(request));
|
||||
throw new ServiceException("MDM回调错误!");
|
||||
}
|
||||
//根据审核流程 id 获取面试会议 id
|
||||
String interviewId = hyPartnerCertificationInfoMapper.getInterviewIdByQualifyVerifyId(request.getInstanceId());
|
||||
if (StringUtils.isEmpty(interviewId)) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
}
|
||||
HyPartnerInterviewDO interviewDO = new HyPartnerInterviewDO();
|
||||
interviewDO.setId(Long.parseLong(interviewId));
|
||||
//审核通过
|
||||
if ("FINISHED".equals(request.getSequenceStatus())) {
|
||||
interviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_6.getCode()));
|
||||
//2. 准备需要的信息
|
||||
String partnerName = request.getIntendedSigner();
|
||||
String verifyCity = hyPartnerInterviewMapper.getVerifyCityByInterviewId(interviewId);
|
||||
String[] split = verifyCity.split("/");
|
||||
//根据长度来取市级行政区域
|
||||
if (split.length == 2) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 3) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 4) {
|
||||
verifyCity = split[2];
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_INFO_NOT_EXIST);
|
||||
}
|
||||
// TODO pass_reason 暂无
|
||||
Date passDate = new Date(request.getModifiedTime());
|
||||
//3. 生成通过函并修改数据库相关信息
|
||||
genPassLetterAndUpdateDB(partnerName, verifyCity, passDate, interviewId);
|
||||
//审核未通过
|
||||
} else if ("CANCELED".equals(request.getSequenceStatus())) {
|
||||
interviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_7.getCode()));
|
||||
}
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(interviewDO);
|
||||
}
|
||||
|
||||
|
||||
public String createQualifyVerify(RpcCreateQualifyVerfyReq rpcRequest) throws ApiException{
|
||||
String url = mdmBaseUrl + "/api/openapi/runtime/form/startFraQualExam";
|
||||
String url = mdmBaseUrl + "/api/openapi/runtime/form/startFraQualExamWithData";
|
||||
ResponseEntity<MDMResultDTO> responseEntity = null;
|
||||
try {
|
||||
RpcGetMdmTokenReq rpcGetMDMTokenReq = new RpcGetMdmTokenReq();
|
||||
// TODO set appKey 与 appSecret
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Authorization", getMdmAccessToken(rpcGetMDMTokenReq));
|
||||
responseEntity = RestTemplateUtil.post(url, headers, rpcRequest, MDMResultDTO.class);
|
||||
@@ -185,4 +248,41 @@ public class FlowServiceImpl implements FlowService {
|
||||
String prefix = jobNumber + DateUtil.format(new Date(), "yyyyMMdd");
|
||||
return prefix + redisUtilPool.incrby(prefix, 1, 60 * 60 * 25);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成通知函上传 OSS 和修改数据库相应数据
|
||||
* @return passCode
|
||||
*/
|
||||
private void genPassLetterAndUpdateDB(String partnerName, String verifyCity, Date passTime, String interviewId) {
|
||||
try {
|
||||
String passCode = PassLetterUtils.genPassCode(passTime);
|
||||
//生成的 pdf 通过函内存输出流
|
||||
ByteArrayOutputStream pdfOut = PassLetterUtils.genPassLetter(partnerName, passCode, verifyCity, passTime);
|
||||
//生成的 pdf 通过函内存输入流
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(pdfOut.toByteArray());
|
||||
String passPdfUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + passCode + ".pdf");
|
||||
//转换为图片
|
||||
inputStream.reset();
|
||||
ByteArrayOutputStream imageOut = PDFUtils.pdf2Img(inputStream, 2.0f);
|
||||
inputStream = new ByteArrayInputStream(imageOut.toByteArray());
|
||||
//上传 OSS
|
||||
String passImageUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + passCode + ".png");
|
||||
//计算有效期截止日期
|
||||
DateTime expiryDate = DateUtil.offsetDay(passTime, 60);
|
||||
HyPartnerInterviewDO interviewDO = new HyPartnerInterviewDO();
|
||||
interviewDO.setId(Long.parseLong(interviewId));
|
||||
interviewDO.setPassCode(passCode);
|
||||
interviewDO.setPassTime(passTime);
|
||||
interviewDO.setExpiryDate(expiryDate);
|
||||
interviewDO.setPassPdfUrl(passPdfUrl);
|
||||
interviewDO.setPassImageUrl(passImageUrl);
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(interviewDO);
|
||||
inputStream.close();
|
||||
pdfOut.close();
|
||||
imageOut.close();
|
||||
} catch (Exception e) {
|
||||
log.error("资格面试通过函生成失败 e{}", e.getMessage());
|
||||
throw new ServiceException("通过函生成失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@@ -74,9 +75,11 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
public InterviewVO getInterviewInfo(String interviewPlanId) {
|
||||
InterviewVO vo = hyPartnerInterviewPlanMapper.getInterviewInfo(interviewPlanId);
|
||||
//将 processInfo 解析为 List
|
||||
if (!StringUtils.isEmpty(vo.getProcessInfo())) {
|
||||
List<String> split = Arrays.asList(vo.getProcessInfo().split(","));
|
||||
vo.setProcessInfoList(split);
|
||||
vo.setVedioList(split);
|
||||
vo.setProcessInfo("");
|
||||
}
|
||||
//查询面试官和记录人信息
|
||||
EnterpriseUserBaseInfoVO interviewerInfo = hyPartnerInterviewPlanMapper.getEnterpriseUserBaseInfo(vo.getInterviewerId());
|
||||
vo.setInterviewerName(interviewerInfo.getName());
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.cool.store.service.impl;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
|
||||
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
|
||||
import com.cool.store.dto.partner.EnterInterviewDto;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
@@ -14,27 +11,23 @@ import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.cool.store.oss.OSSServer;
|
||||
import com.cool.store.request.ModifyInterviewTimeReq;
|
||||
import com.cool.store.service.PartnerInterviewService;
|
||||
import com.cool.store.utils.PDFUtils;
|
||||
import com.cool.store.utils.PassLetterUtils;
|
||||
import com.cool.store.utils.TRTCUtils;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
import com.cool.store.vo.PartnerPassLetterDetailVO;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.cool.store.utils.PDFUtils.pdf2Img;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
|
||||
@Autowired
|
||||
@@ -43,9 +36,6 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
@Autowired
|
||||
private HyPartnerInterviewPlanMapper interviewPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private OSSServer ossServer;
|
||||
|
||||
@Value("${trtc.sdkAppId}")
|
||||
private Long sdkAppId;
|
||||
|
||||
@@ -110,17 +100,8 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
} else if (split.length == 4) {
|
||||
vo.setVerifyCity(split[2]);
|
||||
} else {
|
||||
System.out.println("wrong");
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_INFO_NOT_EXIST);
|
||||
}
|
||||
verifyCity = vo.getVerifyCity();
|
||||
// 调用生成通过函和修改数据库数据的方法
|
||||
String passCode = genPassLetterAndUpdateDB(vo, interviewPlanId);
|
||||
//再查一次 vo
|
||||
vo = interviewMapper.getPassLetterDetail(interviewPlanId);
|
||||
//有效期为审批通过次日起第 60 天的 23:59:59,由此倒推 createTime
|
||||
DateTime expiryDate = DateUtil.parseDate(vo.getExpiryDate());
|
||||
DateTime createTime = DateUtil.offsetDay(expiryDate, -60);
|
||||
vo.setCreateTime(DateUtil.format(createTime, "yyyy-MM-dd"));
|
||||
vo.setVerifyCity((verifyCity));
|
||||
return vo;
|
||||
}
|
||||
@@ -143,37 +124,4 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
interviewPlanMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成通知函上传 OSS 和修改数据库相应数据
|
||||
* @return passCode
|
||||
*/
|
||||
private String genPassLetterAndUpdateDB(PartnerPassLetterDetailVO passLetterDetail, String interviewId) {
|
||||
//已经有文件 URL 的话就不要再生成了,默认上游全部数据都正确
|
||||
if (ObjectUtil.isEmpty(passLetterDetail.getPassPdfUrl()) || ObjectUtil.isEmpty(passLetterDetail.getPassImageUrl())) {
|
||||
try {
|
||||
DateTime createTime = DateUtil.date();
|
||||
String code = passLetterDetail.getPassCode() == null ? PassLetterUtils.genPassCode(createTime) : passLetterDetail.getPassCode();
|
||||
//生成的 pdf 通过函内存输出流
|
||||
ByteArrayOutputStream pdfOut = PassLetterUtils.genPassLetter(passLetterDetail.getPartnerName(), code, passLetterDetail.getVerifyCity(), createTime);
|
||||
//生成的 pdf 通过函内存输入流
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(pdfOut.toByteArray());
|
||||
String passPdfUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + code + ".pdf");
|
||||
//转换为图片
|
||||
inputStream.reset();
|
||||
ByteArrayOutputStream imageOut = PDFUtils.pdf2Img(inputStream, 2.0f);
|
||||
inputStream = new ByteArrayInputStream(imageOut.toByteArray());
|
||||
//上传 OSS
|
||||
String passImageUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + code + ".png");
|
||||
//计算有效期截止日期
|
||||
DateTime expiryDate = DateUtil.offsetDay(createTime, 60);
|
||||
String expiryDateStr = DateUtil.format(expiryDate, "yyyy-MM-dd") + " 23:59:59";
|
||||
interviewMapper.updatePassLetterInfo(code, passPdfUrl, passImageUrl, expiryDateStr, interviewId);
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return passLetterDetail.getPassCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -120,7 +120,8 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO) {
|
||||
public String updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO) {
|
||||
String newMobile = "";
|
||||
HyPartnerUserInfoDO oldUserInfo = hyPartnerUserInfoDAO.selectByMobile(userInfoVO.getMobile());
|
||||
if (oldUserInfo == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_USER_NOT_EXIST);
|
||||
@@ -130,19 +131,26 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
// 获取手机号码
|
||||
PhoneInfoDTO phoneInfoDTO = wechatRest.getUserPhoneNumber(request.getMobileCode(), accessToken);
|
||||
if(phoneInfoDTO != null && phoneInfoDTO.getPhoneInfo() != null && StringUtils.isNotBlank(phoneInfoDTO.getPhoneInfo().getPhoneNumber())){
|
||||
HyPartnerUserInfoDO newUserInfo = hyPartnerUserInfoDAO.selectByMobile(phoneInfoDTO.getPhoneInfo().getPhoneNumber());
|
||||
newMobile = phoneInfoDTO.getPhoneInfo().getPhoneNumber();
|
||||
HyPartnerUserInfoDO newUserInfo = hyPartnerUserInfoDAO.selectByMobile(newMobile);
|
||||
if (newUserInfo != null) {
|
||||
throw new ServiceException(ErrorCodeEnum.NEW_MOBILE_HAS_EXIST);
|
||||
}
|
||||
oldUserInfo.setMobile(phoneInfoDTO.getPhoneInfo().getPhoneNumber());
|
||||
oldUserInfo.setMobile(newMobile);
|
||||
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(oldUserInfo);
|
||||
}
|
||||
return true;
|
||||
return newMobile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerUserInfoVO getUserInfo(String mobile, String openId) {
|
||||
PartnerUserInfoVO userInfoVO = new PartnerUserInfoVO();
|
||||
if(CommonConstants.FIX_MOBILE_OPENID_TEST.equals(mobile) || CommonConstants.FIX_MOBILE_OPENID_ONLINE.equals(mobile) ){
|
||||
userInfoVO.setMobile(mobile);
|
||||
userInfoVO.setOpenid(mobile);
|
||||
userInfoVO.setPartnerId("");
|
||||
return userInfoVO;
|
||||
}
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByMobile(mobile);
|
||||
BeanUtil.copyProperties(hyPartnerUserInfoDO, userInfoVO);
|
||||
HyPartnerUserPlatformBindDO hyPartnerUserPlatformBindDO = hyPartnerUserPlatformBindDAO.getByPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
||||
|
||||
@@ -51,6 +51,11 @@
|
||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
@@ -88,8 +93,6 @@
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:tea:1.2.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.cool.store.service.ContentService;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -18,6 +19,7 @@ import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("news")
|
||||
@Api(tags = "动态")
|
||||
@Slf4j
|
||||
public class ContentController {
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.controller;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
import com.cool.store.request.FinishInterviewReq;
|
||||
import com.cool.store.request.QualificationCallbackReq;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.FlowService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -34,8 +35,9 @@ public class FlowController {
|
||||
|
||||
@PostMapping("/qualificationReview/callback")
|
||||
@ApiOperation("流程信息回调接口")
|
||||
public ResponseResult qualificationCallback() {
|
||||
return null;
|
||||
public ResponseResult qualificationCallback(@RequestBody QualificationCallbackReq request) {
|
||||
flowService.qualificationCallback(request);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dto.buser.UserPositionAndUserScopeDTO;
|
||||
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
|
||||
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
|
||||
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
|
||||
@@ -223,4 +224,9 @@ public class TestController {
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("getUserIdsByScope")
|
||||
public ResponseResult getUserIdsByScope(@RequestParam("userId") String userId){
|
||||
return ResponseResult.success(enterpriseUserService.getUserIdsByScope(userId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,11 @@
|
||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.icepdf.os:icepdf-core:6.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.54" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.media:jai-core:1.1.3" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
@@ -88,8 +93,6 @@
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:tea:1.2.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-12 10:35
|
||||
* @Description:
|
||||
*/
|
||||
public class BodyWrapperFilter implements Filter {
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
ServletRequest requestWrapper = null;
|
||||
if(servletRequest instanceof HttpServletRequest) {
|
||||
requestWrapper = new CustomHttpServletRequestWrapper((HttpServletRequest) servletRequest);
|
||||
}
|
||||
if(requestWrapper == null) {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} else {
|
||||
filterChain.doFilter(requestWrapper, servletResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-12 10:36
|
||||
* @Description: 重写一个自己的 RequestWrapper 拿出body给自己用
|
||||
*/
|
||||
|
||||
public class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
private byte[] body;
|
||||
public CustomHttpServletRequestWrapper(HttpServletRequest request) throws IOException {
|
||||
super(request);
|
||||
BufferedReader reader = request.getReader();
|
||||
try (StringWriter writer = new StringWriter()) {
|
||||
int read;
|
||||
char[] buf = new char[1024 * 8];
|
||||
while ((read = reader.read(buf)) != -1) {
|
||||
writer.write(buf, 0, read);
|
||||
}
|
||||
this.body = writer.getBuffer().toString().getBytes();
|
||||
}
|
||||
}
|
||||
public String getBody(){
|
||||
return new String(body, StandardCharsets.UTF_8);
|
||||
}
|
||||
@Override
|
||||
public ServletInputStream getInputStream() {
|
||||
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body);
|
||||
return new ServletInputStream() {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener readListener) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() {
|
||||
return byteArrayInputStream.read();
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public BufferedReader getReader() {
|
||||
return new BufferedReader(new InputStreamReader(this.getInputStream()));
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,7 @@ import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.WechatMiniAppService;
|
||||
import com.cool.store.utils.AesUtil;
|
||||
import com.cool.store.utils.Md5Utils;
|
||||
import com.cool.store.utils.Sha1Utils;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.cool.store.utils.*;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -26,8 +23,10 @@ import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ydw
|
||||
@@ -81,41 +80,51 @@ public class SignValidateFilter implements Filter {
|
||||
MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get32UUID());
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
CustomHttpServletRequestWrapper wrapper = (CustomHttpServletRequestWrapper) request;
|
||||
String uri = request.getRequestURI();
|
||||
String method = request.getMethod();
|
||||
String userStr = "";
|
||||
boolean isInWhiteList = excludePath(uri);
|
||||
log.info("url:{}", uri);
|
||||
/* if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
String jsonStr = JSONObject.toJSONString(parameterMap);
|
||||
JSONObject obj = JSONObject.parseObject(jsonStr);
|
||||
log.info("params:{}", obj.toJSONString());
|
||||
String params = obj.toJSONString();
|
||||
if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
String params = "";
|
||||
if("GET".equalsIgnoreCase(method)){
|
||||
Map<String, String> parameterMap = new HashMap();
|
||||
Map<String, String[]> requestMap = request.getParameterMap();
|
||||
for(String key : requestMap.keySet()){
|
||||
parameterMap.put(key, requestMap.get(key)[0]);
|
||||
}
|
||||
params = JSONObject.toJSONString(parameterMap);
|
||||
}else if("POST".equalsIgnoreCase(method)){
|
||||
params = wrapper.getBody();
|
||||
// params = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
|
||||
}
|
||||
log.info("params:{}", params);
|
||||
String sign = request.getHeader("SIGN");
|
||||
String nonce = request.getHeader("NONCE");
|
||||
String timestamp = request.getHeader("TIMESTAMP");
|
||||
String aesPhone = request.getHeader("PHONE");
|
||||
String openid = request.getHeader("OPENID");
|
||||
String phone = AesUtil.decrypt(aesPhone, signKey);
|
||||
String md5Value = phone + Md5Utils.md5(Md5Utils.md5(openid));
|
||||
log.info("sign:{}, nonce:{}, timestamp:{},aesPhone:{}, openid:{}, 解密后的手机号:{}, md5Value:{}",
|
||||
sign, nonce, timestamp, aesPhone, openid, phone, md5Value);
|
||||
String phone = AESDecryptor.decrypt(aesPhone, signKey);
|
||||
String plaintextOpenid = AESDecryptor.decrypt(openid, signKey);
|
||||
String md5Value = phone + Md5Utils.md5(Md5Utils.md5(plaintextOpenid));
|
||||
log.info("sign:{}, nonce:{}, timestamp:{},aesPhone:{}, openid:{}, 解密后的手机号:{}, md5Value:{}, 明文plaintextOpenid:{}",
|
||||
sign, nonce, timestamp, aesPhone, openid, phone, md5Value, plaintextOpenid);
|
||||
String signStr = timestamp + nonce + params + signKey + md5Value;
|
||||
String newSign = Sha1Utils.getSha1(signStr.getBytes());
|
||||
log.info("newSign: {}", newSign);
|
||||
log.info("signStr: {}, newSign: {}", signStr, newSign);
|
||||
// 前后端验签不等
|
||||
if (!newSign.equals(sign)) {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL)));
|
||||
return;
|
||||
}
|
||||
PartnerUserInfoVO partnerUserInfoVO = wechatMiniAppService.getUserInfo(phone, openid);
|
||||
PartnerUserInfoVO partnerUserInfoVO = wechatMiniAppService.getUserInfo(phone, plaintextOpenid);
|
||||
if(partnerUserInfoVO != null){
|
||||
userStr = JSONObject.toJSONString(partnerUserInfoVO);
|
||||
log.info("url:{}, userStr:{}", uri, userStr);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
try {
|
||||
PartnerUserHolder.setUser(userStr);
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-23 10:52
|
||||
* @Description:
|
||||
*/
|
||||
@Configuration
|
||||
public class WebApplicationConfig {
|
||||
|
||||
@Bean
|
||||
BodyWrapperFilter getBodyWrapperFilter(){
|
||||
return new BodyWrapperFilter();
|
||||
}
|
||||
@Bean("bodyWrapperFilter")
|
||||
public FilterRegistrationBean<BodyWrapperFilter> checkUserFilter(BodyWrapperFilter bodyWrapperFilter) {
|
||||
FilterRegistrationBean<BodyWrapperFilter> registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(bodyWrapperFilter);
|
||||
registrationBean.addUrlPatterns("/*");
|
||||
registrationBean.setOrder(1);
|
||||
registrationBean.setAsyncSupported(true);
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.dto.content.ContentQueryListDto;
|
||||
import com.cool.store.entity.HyContentInfoDO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ContentService;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("news")
|
||||
@Api(tags = "动态")
|
||||
@Slf4j
|
||||
public class ContentController {
|
||||
|
||||
@Autowired
|
||||
private ContentService contentService;
|
||||
|
||||
@PostMapping("/queryContentList")
|
||||
@ApiOperation("查询动态列表")
|
||||
public ResponseResult<PageInfo<HyContentInfoVO>> queryContentList(@RequestBody ContentQueryListDto dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<HyContentInfoVO> list = contentService.queryContentList(dto);
|
||||
PageInfo<HyContentInfoVO> page = new PageInfo<>(list);
|
||||
return ResponseResult.success(page);
|
||||
}
|
||||
|
||||
@PostMapping("/detail")
|
||||
@ApiOperation("动态详情")
|
||||
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestParam String contentId) {
|
||||
return ResponseResult.success(contentService.queryContentInfo(contentId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,16 +38,15 @@ public class MiniProgramAppController {
|
||||
|
||||
@ApiOperation("更新手机号")
|
||||
@PostMapping("/updateUserPhoneNumber")
|
||||
public ResponseResult<Boolean> updateUserPhoneNumber(@RequestBody @Valid MobileUpdateRequest request) {
|
||||
public ResponseResult<String> updateUserPhoneNumber(@RequestBody @Valid MobileUpdateRequest request) {
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(wechatMiniAppService.updateUserPhoneNumber(request, userInfoVO));
|
||||
}
|
||||
|
||||
@ApiOperation("根据mobile和openId获取用户信息")
|
||||
@PostMapping("/getUserInfo")
|
||||
public ResponseResult<PartnerUserInfoVO> getUserInfo(@RequestParam(value = "mobile",required = false) String mobile,
|
||||
@RequestParam(value = "openId",required = false) String openId){
|
||||
PartnerUserInfoVO userInfoVO = wechatMiniAppService.getUserInfo(mobile, openId);
|
||||
@GetMapping("/getUserInfo")
|
||||
public ResponseResult<PartnerUserInfoVO> getUserInfo(){
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(userInfoVO);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user