feat: 东区缴费分支初始化
This commit is contained in:
-5
@@ -18,11 +18,6 @@ public class ListLogDTO extends BaseDTO {
|
||||
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 操作时请求参数
|
||||
*/
|
||||
private String operateParams;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
package com.yida.data.system.dto;
|
||||
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.common.core.enums.QywxCallbackTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业微信回调处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/10/27 16:25
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QywxCallbackHandleDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 820667804126969451L;
|
||||
|
||||
/**
|
||||
* 回调返回的节点信息
|
||||
*/
|
||||
private Element root;
|
||||
|
||||
/**
|
||||
* 对应的企业微信corpId
|
||||
*/
|
||||
private String corpId;
|
||||
|
||||
/**
|
||||
* 学校信息
|
||||
*/
|
||||
private Dept school;
|
||||
|
||||
/**
|
||||
* 企业微信服务商信息
|
||||
*/
|
||||
private EduQywxServiceProvider eduQywxServiceProvider;
|
||||
|
||||
/**
|
||||
* 企业微信服务商-学校密文corpId对照信息
|
||||
*/
|
||||
private EduQywxServiceProviderSchool providerSchool;
|
||||
|
||||
/**
|
||||
* 回调类型枚举
|
||||
*/
|
||||
private QywxCallbackTypeEnum qywxCallbackTypeEnum;
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
@Data
|
||||
public class SchoolInformationDTO {
|
||||
|
||||
@ApiModelProperty("")
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("学校id")
|
||||
|
||||
-12
@@ -3,8 +3,6 @@ package com.yida.data.system.fallback;
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduApp;
|
||||
import com.yida.data.common.core.entity.system.EduAppTemplate;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.system.feign.RemoteAppService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -28,16 +26,6 @@ public class RemoteAppServiceFallback implements FallbackFactory<RemoteAppServic
|
||||
public ResultBean<EduApp> getAppBySchoolOrCorpIdAndCode(Long schoolId, String corpId, String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<EduAppTemplate> getAppTemplateByTemplateId(String templateId, String serviceCorpId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<EduQywxServiceProvider> getServiceProviderByServiceCorpId(String serviceCorpId) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.BaiduApiConfig;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
import com.yida.data.system.feign.RemoteBaiDuApiConfigService;
|
||||
import com.yida.data.system.feign.RemoteConstructionPayConfigService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteBaiDuApiConfigService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/6/20
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteBaiDuApiConfigServiceFallback implements FallbackFactory<RemoteBaiDuApiConfigService> {
|
||||
|
||||
@Override
|
||||
public RemoteBaiDuApiConfigService create(Throwable throwable) {
|
||||
log.error("RemoteBaiDuApiConfigService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteBaiDuApiConfigService() {
|
||||
@Override
|
||||
public ResultBean<BaiduApiConfig> getBaiDuApiConfigByDept(Long deptId, String moduleName) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduBaseApp;
|
||||
import com.yida.data.system.feign.RemoteBaseAppService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteBaseAppServiceFallback implements FallbackFactory<RemoteBaseAppService> {
|
||||
|
||||
@Override
|
||||
public RemoteBaseAppService create(Throwable throwable) {
|
||||
log.error("RemoteBaseAppService fallback reason:{}", throwable.getMessage());
|
||||
return new RemoteBaseAppService() {
|
||||
@Override
|
||||
public ResultBean<EduBaseApp> getById(Long id) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
import com.yida.data.common.core.entity.system.UnionPayConfig;
|
||||
import com.yida.data.system.feign.RemoteConstructionPayConfigService;
|
||||
import com.yida.data.system.feign.RemoteUnionPayConfigService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteConstructionPayConfigService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/6/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteConstructionPayConfigServiceFallback implements FallbackFactory<RemoteConstructionPayConfigService> {
|
||||
|
||||
@Override
|
||||
public RemoteConstructionPayConfigService create(Throwable throwable) {
|
||||
log.error("RemoteConstructionPayConfigService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteConstructionPayConfigService() {
|
||||
@Override
|
||||
public ResultBean<ConstructionPayConfig> getConstructionPayConfigByDept(Long deptId) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.consume.EduConsumeConfig;
|
||||
import com.yida.data.system.feign.RemoteConsumeConfigService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteConsumeConfigService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/4/6
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteConsumeConfigServiceFallback implements FallbackFactory<RemoteConsumeConfigService> {
|
||||
|
||||
@Override
|
||||
public RemoteConsumeConfigService create(Throwable throwable) {
|
||||
log.error("RemoteConsumeConfigService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteConsumeConfigService() {
|
||||
@Override
|
||||
public ResultBean<EduConsumeConfig> getConsumeConfigByDept(Long deptId) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduDeptFunction;
|
||||
import com.yida.data.system.feign.RemoteDeptFunctionService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteDeptFunctionService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/2/21
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteDeptFunctionServiceFallback implements FallbackFactory<RemoteDeptFunctionService> {
|
||||
|
||||
@Override
|
||||
public RemoteDeptFunctionService create(Throwable throwable) {
|
||||
log.error("RemoteDeptFunctionService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteDeptFunctionService() {
|
||||
@Override
|
||||
public ResultBean<EduDeptFunction> getDeptFunction(String functionName, Long deptId) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-10
@@ -122,16 +122,6 @@ public class RemoteDeptUserviceFallback implements FallbackFactory<RemoteDeptSer
|
||||
public ResultBean<List<Dept>> listDept(List<Long> ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<Dept>> listParentDeptByChild(List<Long> ids) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List> getDeptTree(List<Long> deptIds) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduDeptPayType;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.system.feign.RemotePayTypeService;
|
||||
import com.yida.data.system.feign.RemoteQywxService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteQywxService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/8/26
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteQywxServiceFallback implements FallbackFactory<RemoteQywxService> {
|
||||
|
||||
@Override
|
||||
public RemoteQywxService create(Throwable throwable) {
|
||||
log.error("RemoteQywxService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteQywxService() {
|
||||
@Override
|
||||
public ResultBean<EduQywxServiceProviderSchool> getCorpByOriginalData(String providerCorpId, String deptOriginalCorpId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<EduQywxServiceProviderSchool> getCorpByEncryptionData(String providerCorpId, String deptEncryptionCorpId) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.UPayConfig;
|
||||
import com.yida.data.system.feign.RemoteUPayConfigService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteUPayConfigService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/3/21
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteUPayConfigServiceFallback implements FallbackFactory<RemoteUPayConfigService> {
|
||||
|
||||
@Override
|
||||
public RemoteUPayConfigService create(Throwable throwable) {
|
||||
log.error("RemoteUPayConfigService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteUPayConfigService() {
|
||||
@Override
|
||||
public ResultBean<UPayConfig> getUPayConfigByDept(Long deptId) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.yida.data.system.fallback;
|
||||
|
||||
import com.yida.data.common.core.annotation.Fallback;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.WhiteList;
|
||||
import com.yida.data.system.feign.RemoteWhiteListService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* RemoteWhiteListService fallback处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/8/26
|
||||
*/
|
||||
@Slf4j
|
||||
@Fallback
|
||||
public class RemoteWhiteListServiceFallback implements FallbackFactory<RemoteWhiteListService> {
|
||||
|
||||
@Override
|
||||
public RemoteWhiteListService create(Throwable throwable) {
|
||||
log.error("RemoteWhiteListService fallback reason:{}", throwable.getMessage());
|
||||
|
||||
return new RemoteWhiteListService() {
|
||||
@Override
|
||||
public ResultBean<WhiteList> getWhiteList(String functionName) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-9
@@ -3,8 +3,6 @@ package com.yida.data.system.feign;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.EduApp;
|
||||
import com.yida.data.common.core.entity.system.EduAppTemplate;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.system.fallback.RemoteAppServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -18,11 +16,4 @@ public interface RemoteAppService {
|
||||
ResultBean<EduApp> getAppBySchoolOrCorpIdAndCode(@RequestParam("schoolId") Long schoolId,
|
||||
@RequestParam("corpId") String corpId,
|
||||
@RequestParam("code") String code);
|
||||
|
||||
@GetMapping("/in/app/getAppTemplateByTemplateId")
|
||||
ResultBean<EduAppTemplate> getAppTemplateByTemplateId(@RequestParam("templateId") String templateId,
|
||||
@RequestParam("serviceCorpId") String serviceCorpId);
|
||||
|
||||
@GetMapping("/in/app/getServiceProviderByServiceCorpId")
|
||||
ResultBean<EduQywxServiceProvider> getServiceProviderByServiceCorpId(@RequestParam("serviceCorpId") String serviceCorpId);
|
||||
}
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.BaiduApiConfig;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
import com.yida.data.system.fallback.RemoteBaiDuApiConfigServiceFallback;
|
||||
import com.yida.data.system.fallback.RemoteConstructionPayConfigServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "baiDuApiConfigServiceClient",
|
||||
fallbackFactory = RemoteBaiDuApiConfigServiceFallback.class)
|
||||
public interface RemoteBaiDuApiConfigService {
|
||||
|
||||
/**
|
||||
* 根据学校id查询百度api配置
|
||||
*/
|
||||
@GetMapping("/in/baiDuApiConfig/getBaiDuApiConfigByDept")
|
||||
ResultBean<BaiduApiConfig> getBaiDuApiConfigByDept(@RequestParam("deptId") Long deptId,
|
||||
@RequestParam("moduleName") String moduleName);
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.EduBaseApp;
|
||||
import com.yida.data.system.fallback.RemoteBaseAppServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "baseAppServiceClient",
|
||||
fallbackFactory = RemoteBaseAppServiceFallback.class)
|
||||
public interface RemoteBaseAppService {
|
||||
|
||||
@GetMapping("/in/deptHomeApp/getById")
|
||||
ResultBean<EduBaseApp> getById(@RequestParam("id") Long id);
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
import com.yida.data.common.core.entity.system.UnionPayConfig;
|
||||
import com.yida.data.system.fallback.RemoteConstructionPayConfigServiceFallback;
|
||||
import com.yida.data.system.fallback.RemoteUnionPayConfigServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "constructionPayConfigServiceClient",
|
||||
fallbackFactory = RemoteConstructionPayConfigServiceFallback.class)
|
||||
public interface RemoteConstructionPayConfigService {
|
||||
|
||||
@GetMapping("/in/constructionPayConfig/getConstructionPayConfigByDept")
|
||||
ResultBean<ConstructionPayConfig> getConstructionPayConfigByDept(@RequestParam("deptId") Long deptId);
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.consume.EduConsumeConfig;
|
||||
import com.yida.data.system.fallback.RemoteConsumeConfigServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "consumeConfigServiceClient",
|
||||
fallbackFactory = RemoteConsumeConfigServiceFallback.class)
|
||||
public interface RemoteConsumeConfigService {
|
||||
|
||||
@GetMapping("/in/consumeConfig/getConsumeConfigByDept")
|
||||
ResultBean<EduConsumeConfig> getConsumeConfigByDept(@RequestParam("deptId") Long deptId);
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.EduDeptFunction;
|
||||
import com.yida.data.system.fallback.RemoteDeptFunctionServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "deptFunctionServiceClient", fallbackFactory =
|
||||
RemoteDeptFunctionServiceFallback.class)
|
||||
public interface RemoteDeptFunctionService {
|
||||
|
||||
/**
|
||||
* 获取部门是否开通当前功能
|
||||
*
|
||||
* @param functionName 功能名称
|
||||
* @param deptId 部门id
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.yida.data.common.core.entity.system.EduDeptFunction>
|
||||
* @author ZYJ
|
||||
* @date 2023/2/21 15:06
|
||||
*/
|
||||
@GetMapping("/in/function/getDeptFunction")
|
||||
ResultBean<EduDeptFunction> getDeptFunction(@RequestParam("functionName") String functionName,
|
||||
@RequestParam("deptId") Long deptId);
|
||||
}
|
||||
+8
-21
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "deptServiceClient", fallbackFactory =
|
||||
RemoteDeptUserviceFallback.class)
|
||||
RemoteDeptUserviceFallback.class)
|
||||
public interface RemoteDeptService {
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ public interface RemoteDeptService {
|
||||
*/
|
||||
@GetMapping("/dept/getSchoolByArea")
|
||||
ResultBean<List<Dept>> getSchoolByArea(@RequestParam("areaId") Long areaId,
|
||||
@RequestParam("schoolName") String schoolName);
|
||||
@RequestParam("schoolName") String schoolName);
|
||||
|
||||
/**
|
||||
* 根据corpid获取学校
|
||||
@@ -78,7 +78,7 @@ public interface RemoteDeptService {
|
||||
*/
|
||||
@GetMapping("/in/dept/getDeptBySchoolAndName")
|
||||
ResultBean<Dept> getDeptBySchoolAndName(@RequestParam("schoolId") Long schoolId,
|
||||
@RequestParam("deptName") String deptName);
|
||||
@RequestParam("deptName") String deptName);
|
||||
|
||||
/**
|
||||
* 获取学校和区域信息
|
||||
@@ -91,9 +91,9 @@ public interface RemoteDeptService {
|
||||
*/
|
||||
@GetMapping("/dept/getPageSchoolByArea")
|
||||
ResultBean<IPage<Dept>> getPageSchoolByArea(@ApiParam("类型") @RequestParam(required = false) Long areaId,
|
||||
@ApiParam("搜索关键词 学校名") @RequestParam(required = false) String schoolName,
|
||||
@ApiParam("当前页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@ApiParam("页面大小") @RequestParam(defaultValue = "10") Integer pageSize);
|
||||
@ApiParam("搜索关键词 学校名") @RequestParam(required = false) String schoolName,
|
||||
@ApiParam("当前页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@ApiParam("页面大小") @RequestParam(defaultValue = "10") Integer pageSize);
|
||||
|
||||
/**
|
||||
* 获取学校地区
|
||||
@@ -106,7 +106,7 @@ public interface RemoteDeptService {
|
||||
|
||||
@GetMapping("/dept/findChildByParent")
|
||||
ResultBean<List<Dept>> findChildByParent(@RequestParam("deptId") Long deptId,
|
||||
@RequestParam("type") Integer type);
|
||||
@RequestParam("type") Integer type);
|
||||
|
||||
/**
|
||||
* 根据学校类型查询学校
|
||||
@@ -135,7 +135,7 @@ public interface RemoteDeptService {
|
||||
*/
|
||||
@GetMapping("/in/dept/getDeptBySchoolAndWxId")
|
||||
ResultBean<Dept> getDeptBySchoolAndWxId(@RequestParam("schoolId") Long schoolId,
|
||||
@RequestParam("wxId") Long wxId);
|
||||
@RequestParam("wxId") Long wxId);
|
||||
|
||||
/**
|
||||
* 查询部门列表
|
||||
@@ -145,17 +145,4 @@ public interface RemoteDeptService {
|
||||
*/
|
||||
@PostMapping("/in/dept/listDept")
|
||||
ResultBean<List<Dept>> listDept(@RequestBody List<Long> ids);
|
||||
|
||||
/**
|
||||
* 向上查询父级部门集合,包含子部门
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/in/dept/findParentDeptByChilds")
|
||||
ResultBean<List<Dept>> listParentDeptByChild(@RequestBody List<Long> ids);
|
||||
|
||||
|
||||
@PostMapping("/in/dept/getDeptTree")
|
||||
ResultBean<List> getDeptTree(@RequestBody List<Long> deptIds);
|
||||
}
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.Dict;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.system.fallback.RemoteAreaServiceFallback;
|
||||
import java.util.List;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "dictServiceClient",
|
||||
fallbackFactory = RemoteAreaServiceFallback.class)
|
||||
public interface RemoteDictService {
|
||||
|
||||
@GetMapping("/in/dict/selectDict")
|
||||
ResultBean<List<Dict>> selectDict(@RequestParam String type);
|
||||
|
||||
|
||||
@GetMapping("/in/dict/getDictByTypeAndValueOrLabel")
|
||||
ResultBean<Dict> getDictByTypeAndValueOrLabel(@RequestParam String type, @RequestParam String value,
|
||||
@RequestParam String label);
|
||||
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.system.fallback.RemoteQywxServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "qywxServiceClient",
|
||||
fallbackFactory = RemoteQywxServiceFallback.class)
|
||||
public interface RemoteQywxService {
|
||||
|
||||
/**
|
||||
* 服务商对应学校加密corpId数据(原始值为key)
|
||||
*
|
||||
* @param providerCorpId 服务商corpId
|
||||
* @param deptOriginalCorpId 部门原始corpId
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool>
|
||||
* @author ZYJ
|
||||
* @date 2023/9/25 17:48
|
||||
*/
|
||||
@GetMapping("/in/qywx/getCorpByOriginalData")
|
||||
ResultBean<EduQywxServiceProviderSchool> getCorpByOriginalData(@RequestParam("providerCorpId") String providerCorpId,
|
||||
@RequestParam("deptOriginalCorpId") String deptOriginalCorpId);
|
||||
|
||||
/**
|
||||
* 服务商对应学校加密corpId数据(加密值为key)
|
||||
*
|
||||
* @param providerCorpId 服务商corpId
|
||||
* @param deptEncryptionCorpId 部门加密corpId
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool>
|
||||
* @author ZYJ
|
||||
* @date 2023/9/25 17:48
|
||||
*/
|
||||
@GetMapping("/in/qywx/getCorpByEncryptionData")
|
||||
ResultBean<EduQywxServiceProviderSchool> getCorpByEncryptionData(@RequestParam("providerCorpId") String providerCorpId,
|
||||
@RequestParam("deptEncryptionCorpId") String deptEncryptionCorpId);
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.UPayConfig;
|
||||
import com.yida.data.system.fallback.RemoteUnionPayConfigServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "uPayConfigServiceClient",
|
||||
fallbackFactory = RemoteUnionPayConfigServiceFallback.class)
|
||||
public interface RemoteUPayConfigService {
|
||||
|
||||
@GetMapping("/in/uPayConfig/getUPayConfigByDept")
|
||||
ResultBean<UPayConfig> getUPayConfigByDept(@RequestParam("deptId") Long deptId);
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.yida.data.system.feign;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.FebsServerConstant;
|
||||
import com.yida.data.common.core.entity.system.WhiteList;
|
||||
import com.yida.data.system.fallback.RemoteWhiteListServiceFallback;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "whiteListServiceClient", fallbackFactory =
|
||||
RemoteWhiteListServiceFallback.class)
|
||||
public interface RemoteWhiteListService {
|
||||
|
||||
/**
|
||||
* 根据功能名称获取对应的白名单信息
|
||||
*
|
||||
* @param functionName 功能名称
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.yida.data.common.core.entity.system.WhiteList>
|
||||
* @author ZYJ
|
||||
* @date 2023/2/21 15:05
|
||||
*/
|
||||
@GetMapping("/in/whiteList/getWhiteList")
|
||||
ResultBean<WhiteList> getWhiteList(@RequestParam("functionName") String functionName);
|
||||
}
|
||||
+1
-8
@@ -11,12 +11,5 @@ com.yida.data.system.fallback.RemotePayWxConfigServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteRoleServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteUnionPayConfigServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteUserUserviceFallback,\
|
||||
com.yida.data.system.fallback.RemoteWhiteListServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteYidaAppAccountServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteYidaAppServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteDeptFunctionServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteUPayConfigServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteConsumeConfigServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteConstructionPayConfigServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteBaiDuApiConfigServiceFallback,\
|
||||
com.yida.data.system.fallback.RemoteQywxServiceFallback
|
||||
com.yida.data.system.fallback.RemoteYidaAppServiceFallback
|
||||
+16
-35
@@ -86,10 +86,6 @@
|
||||
* 针对org.apache.commons.codec.binary.Base64,
|
||||
* 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
|
||||
* 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
|
||||
* <p>
|
||||
* 针对org.apache.commons.codec.binary.Base64,
|
||||
* 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
|
||||
* 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
|
||||
*/
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -153,11 +149,11 @@ public class WXBizMsgCrypt {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// WXBizMsgCrypt wxcpt = new WXBizMsgCrypt("yta6ad", "n0KuvcacrFw761RqgNTsN3UwHFw3KYptFij2XWrWW4s", "wxfc7961cd4039bc6d");
|
||||
// wxcpt.DecryptMsg("dd57e9c2b26b073d5777497e8dd43f940d90d8e2", "1635322300", "203081013", "<xml>\n" +
|
||||
// " <ToUserName><![CDATA[gh_d688014af56d]]></ToUserName>\n" +
|
||||
// " <Encrypt><![CDATA[hY3vFoh9E1Dtb8e6MbAwmLwlul0MEWRk0idIsJvI5iavXpnuGJneYFIfysSTqAx/ZOc8yCo8XKd8dNeYExxOmtJ2i39yvLgXXHx3GOeWAo5t2q0lGgt1B31snJSIvp9XALaNXBcYmQYF0XgInaQmc1yW1HXxVL5Q/2OXkmdup7e+O2st4MMUvfowyOoHoxBWhN8GHJmetvyt7hb+Ize6yyruOvoZRX7E8jQlF2BFX+M46mUlXwD9a6XQo3t/AjX7ebJBWeHbVILeeBOHe4TynPlrhAXuEMOxIttM6KpTmC+PX+pbV3xJUkKs78T+HPBsrLkWXOfCyyN3pBIIorAUdTtFwWcteUP6Xa4Kj6Dhn+RutMieIYBGMGS8LczxxxeKSjbgEEDIkXhe3OkF53MTwOttiN6CyoJ9bGYD3ksvLkMi6frJWAHAWj9sRGYOzKKo6yEMxp6b7cHkjiqjl6Bf3KtGEBVrV0N5Rq+uv1Yvev+NUfLN2rYnPQNWxZZen+kEeZod8VC3MPLetID9kpHNE6XtIZ7ZgNtvC0GrC5h9zswtGjDIq1aSNlt5XivKuAu4BIYnt7xAb5O7CtQgUv3G0VnxncQjeO8fw/zIeqT2nJhd17nfz0KMCZZkN5fO/cbD]]></Encrypt>\n" +
|
||||
// "</xml>");
|
||||
WXBizMsgCrypt wxcpt = new WXBizMsgCrypt("yta6ad", "n0KuvcacrFw761RqgNTsN3UwHFw3KYptFij2XWrWW4s", "wxfc7961cd4039bc6d");
|
||||
wxcpt.DecryptMsg("dd57e9c2b26b073d5777497e8dd43f940d90d8e2", "1635322300", "203081013", "<xml>\n" +
|
||||
" <ToUserName><![CDATA[gh_d688014af56d]]></ToUserName>\n" +
|
||||
" <Encrypt><![CDATA[hY3vFoh9E1Dtb8e6MbAwmLwlul0MEWRk0idIsJvI5iavXpnuGJneYFIfysSTqAx/ZOc8yCo8XKd8dNeYExxOmtJ2i39yvLgXXHx3GOeWAo5t2q0lGgt1B31snJSIvp9XALaNXBcYmQYF0XgInaQmc1yW1HXxVL5Q/2OXkmdup7e+O2st4MMUvfowyOoHoxBWhN8GHJmetvyt7hb+Ize6yyruOvoZRX7E8jQlF2BFX+M46mUlXwD9a6XQo3t/AjX7ebJBWeHbVILeeBOHe4TynPlrhAXuEMOxIttM6KpTmC+PX+pbV3xJUkKs78T+HPBsrLkWXOfCyyN3pBIIorAUdTtFwWcteUP6Xa4Kj6Dhn+RutMieIYBGMGS8LczxxxeKSjbgEEDIkXhe3OkF53MTwOttiN6CyoJ9bGYD3ksvLkMi6frJWAHAWj9sRGYOzKKo6yEMxp6b7cHkjiqjl6Bf3KtGEBVrV0N5Rq+uv1Yvev+NUfLN2rYnPQNWxZZen+kEeZod8VC3MPLetID9kpHNE6XtIZ7ZgNtvC0GrC5h9zswtGjDIq1aSNlt5XivKuAu4BIYnt7xAb5O7CtQgUv3G0VnxncQjeO8fw/zIeqT2nJhd17nfz0KMCZZkN5fO/cbD]]></Encrypt>\n" +
|
||||
"</xml>");
|
||||
}
|
||||
|
||||
// 生成4个字节的网络字节序
|
||||
@@ -239,10 +235,6 @@ public class WXBizMsgCrypt {
|
||||
}
|
||||
}
|
||||
|
||||
String decrypt(String text) throws AesException {
|
||||
return decrypt(text, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对密文进行解密.
|
||||
* 应用消息回调时receiveid应该为corpid,应对比receiveid与corpid是否一致
|
||||
@@ -256,7 +248,7 @@ public class WXBizMsgCrypt {
|
||||
* @return 解密得到的明文
|
||||
* @throws AesException aes解密失败
|
||||
*/
|
||||
String decrypt(String text, boolean flag) throws AesException {
|
||||
String decrypt(String text) throws AesException {
|
||||
byte[] original;
|
||||
try {
|
||||
// 设置解密模式为AES的CBC模式
|
||||
@@ -292,14 +284,12 @@ public class WXBizMsgCrypt {
|
||||
e.printStackTrace();
|
||||
throw new AesException(AesException.IllegalBuffer);
|
||||
}
|
||||
|
||||
log.info("解密后的密文, encrypt: {}", xmlContent);
|
||||
log.info("解密后的from_receiveid: {}", from_receiveid);
|
||||
// 判断是否对比receiveid
|
||||
if (flag) {
|
||||
// receiveid不相同的情况
|
||||
if (!from_receiveid.equals(receiveid)) {
|
||||
throw new AesException(AesException.ValidateCorpidError);
|
||||
}
|
||||
// receiveid不相同的情况
|
||||
if (!from_receiveid.equals(receiveid) && !xmlContent.contains("SuiteId")) {
|
||||
throw new AesException(AesException.ValidateCorpidError);
|
||||
}
|
||||
return xmlContent;
|
||||
|
||||
@@ -337,12 +327,7 @@ public class WXBizMsgCrypt {
|
||||
return result;
|
||||
}
|
||||
|
||||
public String DecryptMsg(String msgSignature, String timeStamp, String nonce, String postData) {
|
||||
return DecryptMsg(msgSignature, timeStamp, nonce, postData, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商待开发应用回调验证
|
||||
* 检验消息的真实性,并且获取解密后的明文.
|
||||
* <ol>
|
||||
* <li>利用收到的密文生成安全签名,进行签名验证</li>
|
||||
@@ -358,7 +343,7 @@ public class WXBizMsgCrypt {
|
||||
* @return 解密后的原文
|
||||
* @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
|
||||
*/
|
||||
public String DecryptMsg(String msgSignature, String timeStamp, String nonce, String postData, boolean flag)
|
||||
public String DecryptMsg(String msgSignature, String timeStamp, String nonce, String postData)
|
||||
throws AesException {
|
||||
|
||||
// 密钥,公众账号的app secret
|
||||
@@ -376,16 +361,11 @@ public class WXBizMsgCrypt {
|
||||
}
|
||||
|
||||
// 解密
|
||||
return decrypt(encrypt[1].toString(), flag);
|
||||
}
|
||||
|
||||
public String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr)
|
||||
throws AesException {
|
||||
return VerifyURL(msgSignature, timeStamp, nonce, echoStr, true);
|
||||
String result = decrypt(encrypt[1].toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商待开发应用回调验证
|
||||
* 验证URL
|
||||
* @param msgSignature 签名串,对应URL参数的msg_signature
|
||||
* @param timeStamp 时间戳,对应URL参数的timestamp
|
||||
@@ -395,7 +375,7 @@ public class WXBizMsgCrypt {
|
||||
* @return 解密之后的echostr
|
||||
* @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
|
||||
*/
|
||||
public String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr, boolean flag)
|
||||
public String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr)
|
||||
throws AesException {
|
||||
String signature = SHA1.getSHA1(token, timeStamp, nonce, echoStr);
|
||||
|
||||
@@ -403,7 +383,8 @@ public class WXBizMsgCrypt {
|
||||
throw new AesException(AesException.ValidateSignatureError);
|
||||
}
|
||||
|
||||
return decrypt(echoStr, flag);
|
||||
String result = decrypt(echoStr);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
+6
-68
@@ -1,21 +1,9 @@
|
||||
package com.yida.data.system.configure;
|
||||
|
||||
import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.entity.constant.QywxServiceProviderConstant;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.common.core.utils.WxServiceProviderUtil;
|
||||
import com.yida.data.common.service.CommonService;
|
||||
import com.yida.data.system.service.EduQywxServiceProviderSchoolService;
|
||||
import com.yida.data.system.service.EduQywxServiceProviderService;
|
||||
import com.yida.data.system.service.IDeptService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
@@ -24,7 +12,10 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
@@ -33,14 +24,10 @@ import java.util.Objects;
|
||||
public class InitializeRunner implements ApplicationRunner {
|
||||
|
||||
private final RedisService redisService;
|
||||
private final WxServiceProviderUtil wxServiceProviderUtil;
|
||||
|
||||
private final IDeptService deptService;
|
||||
private final EduQywxServiceProviderService eduQywxServiceProviderService;
|
||||
private final EduQywxServiceProviderSchoolService eduQywxServiceProviderSchoolService;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
log.info("初始化部门缓存");
|
||||
List<Dept> allDept = deptService.list();
|
||||
Map<Object, Object> items = new HashMap<>();
|
||||
@@ -49,54 +36,5 @@ public class InitializeRunner implements ApplicationRunner {
|
||||
items.put(dept.getDeptId().toString(), dept);
|
||||
}
|
||||
redisService.hmset(CachePrefixConstant.SYS_DEPT_DATA, items);
|
||||
// initProviderSchool();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化服务商对应学校加密corpId
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/10 9:13
|
||||
*/
|
||||
// public void initProviderSchool() {
|
||||
// // 查询所有服务商
|
||||
// List<EduQywxServiceProvider> providerList = eduQywxServiceProviderService.list();
|
||||
// // 查询所有企业微信学校
|
||||
// List<Dept> deptList = deptService.list(Wrappers.lambdaQuery(new Dept()).eq(Dept::getSchoolType, Dept.TYPE_QYWX));
|
||||
// // 加密key缓存map
|
||||
// Map<Object, Object> items = new HashMap<>(16);
|
||||
// // 原始key缓存map
|
||||
// Map<Object, Object> originalItems = new HashMap<>(16);
|
||||
//
|
||||
// // 处理关联数据
|
||||
// for (EduQywxServiceProvider provider : providerList) {
|
||||
// for (Dept dept : deptList) {
|
||||
// // 查询是否有关联数据
|
||||
// EduQywxServiceProviderSchool providerSchool = eduQywxServiceProviderSchoolService
|
||||
// .getOne(Wrappers.lambdaQuery(new EduQywxServiceProviderSchool())
|
||||
// .eq(EduQywxServiceProviderSchool::getProviderCorpId, provider.getCorpId())
|
||||
// .eq(EduQywxServiceProviderSchool::getDeptOriginalCorpId, dept.getCorpId()));
|
||||
// if (Objects.isNull(providerSchool)) {
|
||||
// continue;
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(providerSchool.getDeptEncryptionCorpId())) {
|
||||
// providerSchool = new EduQywxServiceProviderSchool();
|
||||
// providerSchool.setProviderCorpId(provider.getCorpId());
|
||||
// providerSchool.setDeptOriginalCorpId(dept.getCorpId());
|
||||
// // 转换corpId
|
||||
// String providerToken = wxServiceProviderUtil
|
||||
// .getProviderToken(provider.getCorpId(), provider.getServiceProviderSecret());
|
||||
// String convertCorpId = wxServiceProviderUtil.convertCorpId(providerToken, dept.getCorpId());
|
||||
// providerSchool.setDeptEncryptionCorpId(convertCorpId);
|
||||
// eduQywxServiceProviderSchoolService.save(providerSchool);
|
||||
// }
|
||||
// items.put(provider.getCorpId() + "." + providerSchool.getDeptEncryptionCorpId(), providerSchool);
|
||||
// originalItems.put(provider.getCorpId() + "." + providerSchool.getDeptOriginalCorpId(), providerSchool);
|
||||
// }
|
||||
// }
|
||||
// if (CollUtil.isNotEmpty(items)) {
|
||||
// redisService.hmset(QywxServiceProviderConstant.PROVIDER_SCHOOL_CORP_DATA, items);
|
||||
// redisService.hmset(QywxServiceProviderConstant.PROVIDER_SCHOOL_CORP_ORIGINAL_DATA, originalItems);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
package com.yida.data.system.configure;
|
||||
|
||||
import com.rabbitmq.client.Channel;
|
||||
import com.yida.data.common.core.entity.WxPublicQr;
|
||||
import com.yida.data.common.core.exception.FebsException;
|
||||
import com.yida.data.rabbit.constant.RabbitConstant;
|
||||
import com.yida.data.system.dto.QywxCallbackHandleDTO;
|
||||
import com.yida.data.system.service.EduAgentWxPublicReceiverService;
|
||||
import com.yida.data.system.service.QywxHandleService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 企业微信回调mq处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/10/26
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class QywxHandleRabbitReceiver {
|
||||
|
||||
private final QywxHandleService qywxHandleService;
|
||||
|
||||
/**
|
||||
* 企业微信处理接收者
|
||||
*/
|
||||
@RabbitListener(bindings = @QueueBinding(
|
||||
value = @Queue(RabbitConstant.QYWX_HANDLE_QUEUE),
|
||||
exchange = @Exchange(RabbitConstant.QYWX_HANDLE_EXCHANGE)
|
||||
))
|
||||
public void qywxHandleRabbitReceiver(QywxCallbackHandleDTO dto, Channel channel, Message message) throws IOException {
|
||||
long deliveryTag = message.getMessageProperties().getDeliveryTag();
|
||||
try {
|
||||
// 处理企业微信回调信息
|
||||
switch (dto.getQywxCallbackTypeEnum()) {
|
||||
// 自开发回调
|
||||
case POST:
|
||||
qywxHandleService.handlePostCallback(dto);
|
||||
break;
|
||||
// 代开发应用模板回调
|
||||
case POST_NORMAL:
|
||||
qywxHandleService.handlePostNormalCallback(dto);
|
||||
break;
|
||||
// 处理企业微信代开发应用回调信息
|
||||
case POST_EVENT:
|
||||
qywxHandleService.handlePostEventCallback(dto);
|
||||
break;
|
||||
default:
|
||||
throw new FebsException("回调类型错误");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("rabbitmq处理企业微信回调消息失败, msg: {}", dto, e);
|
||||
// 重新回到队列
|
||||
// channel.basicNack(deliveryTag, false, true);
|
||||
} finally {
|
||||
// 确认收到消息,只确认当前消费者的一个消息收到
|
||||
channel.basicAck(deliveryTag, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-24
@@ -9,9 +9,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
public class RabbitConfig {
|
||||
|
||||
@@ -40,7 +37,7 @@ public class RabbitConfig {
|
||||
*/
|
||||
@Bean
|
||||
public Binding agentReceiveMsgBinding(@Qualifier("agentReceiveMsgQueue") Queue queue,
|
||||
@Qualifier("wxPublicQrExchange") DirectExchange exchange) {
|
||||
@Qualifier("wxPublicQrExchange") DirectExchange exchange) {
|
||||
return BindingBuilder.bind(queue).to(exchange).with(RabbitConstant.AGENT_RECEIVE_MSG_KEY);
|
||||
}
|
||||
|
||||
@@ -59,26 +56,7 @@ public class RabbitConfig {
|
||||
*/
|
||||
@Bean
|
||||
public Binding visitorInviteCodeBinding(@Qualifier("visitorInviteCodeQueue") Queue queue,
|
||||
@Qualifier("wxPublicQrExchange") DirectExchange exchange) {
|
||||
@Qualifier("wxPublicQrExchange") DirectExchange exchange) {
|
||||
return BindingBuilder.bind(queue).to(exchange).with(RabbitConstant.VISITOR_INVITE_CODE_KEY);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DirectExchange qywxHandleExchange() {
|
||||
return new DirectExchange(RabbitConstant.QYWX_HANDLE_EXCHANGE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue qywxHandleQueue() {
|
||||
Map<String, Object> args = new HashMap<>();
|
||||
// 设置同时只能一个消费者进行消费
|
||||
args.put("x-single-active-consumer", true);
|
||||
return new Queue(RabbitConstant.QYWX_HANDLE_QUEUE, true, false, false, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding qywxHandleBinding(@Qualifier("qywxHandleQueue") Queue queue,
|
||||
@Qualifier("qywxHandleExchange") DirectExchange exchange) {
|
||||
return BindingBuilder.bind(queue).to(exchange).with(RabbitConstant.QYWX_HANDLE_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ public class SysRabbitReceiver {
|
||||
|
||||
/**
|
||||
* 区域后台消息接收者
|
||||
*
|
||||
* @param wxPublicQr
|
||||
* @param channel
|
||||
* @param message
|
||||
*/
|
||||
@RabbitListener(bindings = @QueueBinding(
|
||||
value = @Queue(RabbitConstant.AGENT_RECEIVE_MSG_QUEUE),
|
||||
|
||||
+4
-19
@@ -6,14 +6,15 @@ import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduSysFile;
|
||||
import com.yida.data.common.core.exception.FebsException;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.school.vo.smart.WxConfigVO;
|
||||
import com.yida.data.system.service.CommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Api(tags = "通用接口")
|
||||
@@ -42,20 +43,4 @@ public class CommonController {
|
||||
}
|
||||
return ResultBean.buildSuccess(stringBuilder.toString());
|
||||
}
|
||||
|
||||
@GetMapping("/getWxJsConfig")
|
||||
@ApiOperation("获取企业微信JS-SDK配置")
|
||||
ResultBean<WxConfigVO> getWxJsConfig(
|
||||
@RequestParam @ApiParam(value = "部门id", required = true) Long deptId,
|
||||
@RequestParam @ApiParam(value = "当前网页的URL,不包含#及其后面部分", required = true) String url) {
|
||||
return ResultBean.buildSuccess(commonService.getWxJsConfig(deptId, url));
|
||||
}
|
||||
|
||||
@GetMapping("/getWxPublicJsConfig")
|
||||
@ApiOperation("获取微信JS-SDK配置")
|
||||
ResultBean<WxConfigVO> getWxPublicJsConfig(
|
||||
@RequestParam @ApiParam(value = "部门id", required = true) Long deptId,
|
||||
@RequestParam @ApiParam(value = "当前网页的URL,不包含#及其后面部分", required = true) String url) {
|
||||
return ResultBean.buildSuccess(commonService.getWxPublicJsConfig(deptId, url));
|
||||
}
|
||||
}
|
||||
|
||||
+34
-26
@@ -57,45 +57,52 @@ public class DeptController {
|
||||
*/
|
||||
@ApiOperation("查询父级部门")
|
||||
@GetMapping("/getParent")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "查询父级部门")
|
||||
public ResultBean<Dept> getParent(@ApiParam("部门id") Long deptId) {
|
||||
return ResultBean.buildSuccess(deptService.getById(deptService.getById(deptId).getParentId()));
|
||||
}
|
||||
|
||||
@ApiOperation("向上查询父级部门")
|
||||
@GetMapping("/findParentUp")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "向上查询父级部门")
|
||||
public ResultBean<AllDeptInfoVO> findParentUp(@ApiParam("部门id") Long deptId,
|
||||
@ApiParam("最上级部门类型,0表示学校,1表示班级,2表示年级,3表示学段,4表示校区,5公司,6" +
|
||||
"学校部门") Integer type) {
|
||||
@ApiParam("最上级部门类型,0表示学校,1表示班级,2表示年级,3表示学段,4表示校区,5公司,6" +
|
||||
"学校部门") Integer type) {
|
||||
return ResultBean.buildSuccess(deptService.findParentUp(deptId, type));
|
||||
}
|
||||
|
||||
@GetMapping("/findListByParent")
|
||||
@ApiOperation("查询所有子节点")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "查询所有子节点")
|
||||
public ResultBean<List<Dept>> findListByParent(Long deptId) {
|
||||
return ResultBean.buildSuccess(deptService.findListByParent(Arrays.asList(deptId), 0));
|
||||
}
|
||||
|
||||
@ApiOperation("查询直接子节点")
|
||||
@GetMapping("/findChildByParent")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "查询子节点")
|
||||
public ResultBean findChildByParent(@ApiParam("父节点id,不能为空") @RequestParam Long deptId,
|
||||
@ApiParam("子节点类型,0表示学校,5公司,6部门,7教育局,默认所有直接子节点") Integer type) {
|
||||
@ApiParam("子节点类型,0表示学校,5公司,6部门,7教育局,默认所有直接子节点") Integer type) {
|
||||
return ResultBean.buildSuccess(deptService.findChildByParent(deptId, type));
|
||||
}
|
||||
|
||||
@ApiOperation("向下查询到要查询的部门类别的子部门(可查询非直接子部门)")
|
||||
@GetMapping("/findChildByParentAndType")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "向下查询到要查询的部门类别的子部门")
|
||||
public ResultBean<List<Dept>> findChildByParentAndType(@ApiParam("父节点id,不能为空") Long parentId,
|
||||
@ApiParam("子节点类型,0表示学校,5公司,6部门,7教育局,默认所有直接子节点") Integer type) {
|
||||
@ApiParam("子节点类型,0表示学校,5公司,6部门,7教育局,默认所有直接子节点") Integer type) {
|
||||
return ResultBean.buildSuccess(deptService.findChildByParentAndType(Arrays.asList(parentId), type));
|
||||
}
|
||||
|
||||
@ApiOperation("根据部门id查询所属学校")
|
||||
@GetMapping("findSchoolByDept")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "根据部门id查询所属学校")
|
||||
public ResultBean<Dept> findSchoolByDept(Long deptId) {
|
||||
return ResultBean.buildSuccess(deptService.findSchooleByDept(deptId));
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "查询部门")
|
||||
public FebsResponse deptList(QueryRequest request, Dept dept) {
|
||||
Map<String, Object> depts = this.deptService.findDepts(request, dept);
|
||||
return new FebsResponse().data(depts);
|
||||
@@ -103,14 +110,14 @@ public class DeptController {
|
||||
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAuthority('dept:add')")
|
||||
@OperationLog(module = ModuleName.DEPT, methods = "新增部门", type = OperationLogTypeEnum.INSERT)
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "新增部门", type = OperationLogTypeEnum.INSERT)
|
||||
public void addDept(@Valid Dept dept) {
|
||||
this.deptService.createDept(dept);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{deptIds}")
|
||||
@PreAuthorize("hasAuthority('dept:delete')")
|
||||
@OperationLog(module = ModuleName.DEPT, methods = "删除部门", type = OperationLogTypeEnum.DELETE)
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "删除部门", type = OperationLogTypeEnum.DELETE)
|
||||
public void deleteDepts(@NotBlank(message = "{required}") @PathVariable String deptIds) {
|
||||
String[] ids = deptIds.split(StringConstant.COMMA);
|
||||
this.deptService.deleteDepts(ids);
|
||||
@@ -118,13 +125,14 @@ public class DeptController {
|
||||
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAuthority('dept:update')")
|
||||
@OperationLog(module = ModuleName.DEPT, methods = "修改部门", type = OperationLogTypeEnum.UPDATE)
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "修改部门", type = OperationLogTypeEnum.UPDATE)
|
||||
public void updateDept(@Valid Dept dept) {
|
||||
this.deptService.updateDept(dept);
|
||||
}
|
||||
|
||||
@PostMapping("excel")
|
||||
@PreAuthorize("hasAuthority('dept:export')")
|
||||
@ControllerLog(operation = "导出部门数据", exceptionMessage = "导出Excel失败")
|
||||
public void export(Dept dept, QueryRequest request, HttpServletResponse response) {
|
||||
List<Dept> depts = this.deptService.findDepts(dept, request);
|
||||
//ExcelKit.$Export(Dept.class, response).downXlsx(depts, false);
|
||||
@@ -138,17 +146,19 @@ public class DeptController {
|
||||
|
||||
@ApiOperation("根据区域查询学校列表")
|
||||
@GetMapping("/getSchoolByArea")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "根据区域查询学校列表")
|
||||
public ResultBean<List<Dept>> getSchoolByArea(@ApiParam("区域id") @RequestParam(required = false) Long areaId,
|
||||
@ApiParam("搜索关键词 学校名") @RequestParam(required = false) String schoolName) throws NoSuchMethodException {
|
||||
@ApiParam("搜索关键词 学校名") @RequestParam(required = false) String schoolName) throws NoSuchMethodException {
|
||||
return ResultBean.buildSuccess(deptService.getSchoolByArea(areaId, schoolName));
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询学校列表")
|
||||
@GetMapping("/getPageSchoolByArea")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "分页查询学校列表")
|
||||
public ResultBean<IPage<Dept>> getPageSchoolByArea(@ApiParam("类型") @RequestParam(required = false) Long areaId,
|
||||
@ApiParam("搜索关键词 学校名") @RequestParam(required = false) String schoolName,
|
||||
@ApiParam("当前页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@ApiParam("页面大小") @RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
@ApiParam("搜索关键词 学校名") @RequestParam(required = false) String schoolName,
|
||||
@ApiParam("当前页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@ApiParam("页面大小") @RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
Page<Dept> page = new Page<>();
|
||||
page.setSize(pageSize);
|
||||
page.setCurrent(pageNum);
|
||||
@@ -157,9 +167,10 @@ public class DeptController {
|
||||
|
||||
@ApiOperation("部门树")
|
||||
@GetMapping("/getDeptTree")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "部门树")
|
||||
public ResultBean<List> getDeptTree(@ApiParam("根节点Id") Long deptId,
|
||||
@ApiParam("0-包含学校的企业部门(后勤部等)与学校部门(校区学段等),1-仅学校部门,2-仅企业部门,默认0") @RequestParam(defaultValue =
|
||||
"0") Integer type) {
|
||||
@ApiParam("0-包含学校的企业部门(后勤部等)与学校部门(校区学段等),1-仅学校部门,2-仅企业部门,默认0") @RequestParam(defaultValue =
|
||||
"0") Integer type) {
|
||||
if (deptId == null) {
|
||||
deptId = FebsUtil.getCurrentUser().getDeptId();
|
||||
}
|
||||
@@ -174,6 +185,7 @@ public class DeptController {
|
||||
|
||||
@ApiOperation("查询部门区域")
|
||||
@GetMapping("/findAreaById")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "查询部门区域")
|
||||
public ResultBean<AreaVO> findAreaById(@RequestParam Long id) {
|
||||
Long byId = deptService.getById(id).getAreaId();
|
||||
return ResultBean.buildSuccess(eduAreaMapper.findAreaById(byId));
|
||||
@@ -183,15 +195,14 @@ public class DeptController {
|
||||
* 查询代理商管理的学校列表数据
|
||||
*
|
||||
* @param agentSchoolSelectPageDTO 查询代理商管理的学校列表数据请求类
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.baomidou.mybatisplus.core.metadata.IPage <
|
||||
* com.yida.data.system.vo.AgentSchoolVO>>
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.baomidou.mybatisplus.core.metadata.IPage < com.yida.data.system.vo.AgentSchoolVO>>
|
||||
* @author ZYJ
|
||||
* @date 2021/9/27 17:03
|
||||
*/
|
||||
@GetMapping(value = "/listAgentSchoolPage")
|
||||
@ApiOperation(value = "查询代理商管理的学校列表数据", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
public ResultBean<IPage<AgentSchoolSelectPageVO>> listAgentSchoolPage(
|
||||
@Valid AgentSchoolSelectPageDTO agentSchoolSelectPageDTO) {
|
||||
@Valid AgentSchoolSelectPageDTO agentSchoolSelectPageDTO) {
|
||||
return this.deptService.listAgentSchoolPage(agentSchoolSelectPageDTO);
|
||||
}
|
||||
|
||||
@@ -207,7 +218,7 @@ public class DeptController {
|
||||
@PostMapping(value = "/saveAgentSchool", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ApiOperation(value = "代理商保存学校数据", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResultBean<String> saveAgentSchool(
|
||||
@Valid @RequestBody AgentSchoolSaveDTO agentSchoolSaveDTO) {
|
||||
@Valid @RequestBody AgentSchoolSaveDTO agentSchoolSaveDTO) {
|
||||
return this.deptService.saveAgentSchool(agentSchoolSaveDTO);
|
||||
}
|
||||
|
||||
@@ -223,7 +234,7 @@ public class DeptController {
|
||||
@PostMapping(value = "/getAgentSchoolInfo")
|
||||
@ApiOperation(value = "查询学校信息", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
public ResultBean<AgentSchoolDetailVO> getAgentSchoolInfo(
|
||||
@ApiParam(value = "学校id", required = true) @RequestParam Long schoolId) {
|
||||
@ApiParam(value = "学校id", required = true) @RequestParam Long schoolId) {
|
||||
return this.deptService.getAgentSchoolInfo(schoolId);
|
||||
}
|
||||
|
||||
@@ -239,10 +250,9 @@ public class DeptController {
|
||||
// @PreAuthorize("hasRole('role:agent:admin')")
|
||||
@PostMapping(value = "/updateEnableStatus")
|
||||
@ApiOperation(value = "启用或停用学校", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
@OperationLog(module = ModuleName.DEPT, methods = "启用或停用学校", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean<String> updateEnableStatus(
|
||||
@ApiParam(value = "学校id", required = true) @RequestParam Long schoolId,
|
||||
@ApiParam(value = "需要设置的启用或停用状态. 启用: 1, 停用: 0", required = true) @RequestParam Integer enableStatus) {
|
||||
@ApiParam(value = "学校id", required = true) @RequestParam Long schoolId,
|
||||
@ApiParam(value = "需要设置的启用或停用状态. 启用: 1, 停用: 0", required = true) @RequestParam Integer enableStatus) {
|
||||
return this.deptService.updateEnableStatus(schoolId, enableStatus);
|
||||
}
|
||||
|
||||
@@ -252,15 +262,14 @@ public class DeptController {
|
||||
* 代理商查询学校管理员账号列表数据
|
||||
*
|
||||
* @param schoolAdminAccountSelectPageDTO 代理商查询学校管理员账号列表数据请求类
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.baomidou.mybatisplus.core.metadata.IPage <
|
||||
* com.yida.data.system.vo.SchoolAdminAccountSelectPageVO>>
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.baomidou.mybatisplus.core.metadata.IPage < com.yida.data.system.vo.SchoolAdminAccountSelectPageVO>>
|
||||
* @author ZYJ
|
||||
* @date 2021/9/29 17:34
|
||||
*/
|
||||
@PostMapping(value = "/listSchoolAdminAccountPage")
|
||||
@ApiOperation(value = "查询学校管理员账号列表数据", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
public ResultBean<IPage<SchoolAdminAccountSelectPageVO>> listSchoolAdminAccountPage(
|
||||
@Valid SchoolAdminAccountSelectPageDTO schoolAdminAccountSelectPageDTO) {
|
||||
@Valid SchoolAdminAccountSelectPageDTO schoolAdminAccountSelectPageDTO) {
|
||||
return ResultBean.buildSuccess(this.userService.listSchoolAdminAccountPage(schoolAdminAccountSelectPageDTO));
|
||||
}
|
||||
|
||||
@@ -275,9 +284,8 @@ public class DeptController {
|
||||
// @PreAuthorize("hasRole('role:agent:admin')")
|
||||
@PostMapping(value = "/saveSchoolAdminAccount", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ApiOperation(value = "保存学校负责人账号", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@OperationLog(module = ModuleName.DEPT, methods = "保存学校负责人账号", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean<String> saveSchoolAdminAccount(
|
||||
@Valid @RequestBody SchoolAdminAccountSaveDTO schoolAdminAccountSaveDTO) {
|
||||
@Valid @RequestBody SchoolAdminAccountSaveDTO schoolAdminAccountSaveDTO) {
|
||||
return this.userService.saveSchoolAdminAccount(schoolAdminAccountSaveDTO);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-20
@@ -1,6 +1,5 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
@@ -46,8 +45,8 @@ public class DictController {
|
||||
@ApiOperation("分页查询字典类型")
|
||||
@GetMapping("/listDictTypePage")
|
||||
public ResultBean<IPage<DictTypePageVO>> listDictGroup(@RequestParam(required = false) String typeName,
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
return ResultBean.buildSuccess(dictService.listDictTypePage(typeName, pageNum, pageSize));
|
||||
}
|
||||
|
||||
@@ -56,7 +55,7 @@ public class DictController {
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "查询字典")
|
||||
public ResultBean<List<Dict>> selectDict(@ApiParam("类型") @RequestParam String type) {
|
||||
return ResultBean.buildSuccess(dictService.list(Wrappers.lambdaQuery(new Dict())
|
||||
.eq(Dict::getType, type).orderByAsc(Dict::getSort)));
|
||||
.eq(Dict::getType, type).orderByAsc(Dict::getSort)));
|
||||
}
|
||||
|
||||
@PostMapping("/insertDict")
|
||||
@@ -77,22 +76,7 @@ public class DictController {
|
||||
@GetMapping("/delDictByType")
|
||||
public ResultBean delDictByType(String type) {
|
||||
dictService.remove(Wrappers.<Dict>lambdaQuery()
|
||||
.eq(Dict::getType, type));
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@GetMapping("/getDictByTypeAndValueOrLabel")
|
||||
public ResultBean getDictCode(String type, String value, String Label) {
|
||||
if (ObjectUtil.isNotNull(value)) {
|
||||
return ResultBean
|
||||
.buildSuccess(
|
||||
dictService.getOne(Wrappers.lambdaQuery(new Dict()).eq(Dict::getType, type).eq(Dict::getValue, value)));
|
||||
}
|
||||
if (ObjectUtil.isNotNull(Label)) {
|
||||
return ResultBean
|
||||
.buildSuccess(
|
||||
dictService.getOne(Wrappers.lambdaQuery(new Dict()).eq(Dict::getType, type).eq(Dict::getLabel, Label)));
|
||||
}
|
||||
.eq(Dict::getType, type));
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduBaseApp;
|
||||
import com.yida.data.system.service.EduBaseAppService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础应用信息(本地配置) Controller
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-28 14:57:58
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("eduBaseApp")
|
||||
@Api(tags = "基础应用信息配置信息")
|
||||
public class EduBaseAppController {
|
||||
|
||||
private final EduBaseAppService eduBaseAppService;
|
||||
|
||||
@PostMapping(value = "listBaseApp")
|
||||
@ApiOperation(value = "查询基础应用列表数据")
|
||||
public ResultBean<List<EduBaseApp>> listBaseApp() {
|
||||
return ResultBean.buildSuccess(eduBaseAppService.list());
|
||||
}
|
||||
}
|
||||
+10
-12
@@ -3,13 +3,10 @@ package com.yida.data.system.controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.common.ResultMsgType;
|
||||
import com.yida.data.common.core.entity.instructions.EduInstructionsContent;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.system.service.EduInstructionsContentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -40,15 +37,15 @@ public class EduInstructionsContentController {
|
||||
|
||||
@ApiOperation("分页获取系统指南内容LIST")
|
||||
@GetMapping("/findPageList")
|
||||
@ControllerLog(operation = "分页获取系统指南内容LIST")
|
||||
public ResultBean<IPage<EduInstructionsContent>> findPageList(
|
||||
@ApiParam("指南类型") @RequestParam(required = false) String typeCode,
|
||||
@ApiParam("指南标题") @RequestParam(required = false) String title,
|
||||
@ApiParam("当前页码,默认1") @RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@ApiParam("分页大小,默认10") @RequestParam(defaultValue = "10") Integer pageSize
|
||||
@ApiParam("指南类型") @RequestParam(required = false) String typeCode,
|
||||
@ApiParam("指南标题") @RequestParam(required = false) String title,
|
||||
@ApiParam("当前页码,默认1") @RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@ApiParam("分页大小,默认10") @RequestParam(defaultValue = "10") Integer pageSize
|
||||
) {
|
||||
try {
|
||||
return ResultBean.buildSuccess(
|
||||
eduInstructionsContentService.listPageEduInstructionsContent(new Page(pageNum, pageSize), typeCode, title));
|
||||
return ResultBean.buildSuccess(eduInstructionsContentService.listPageEduInstructionsContent(new Page(pageNum, pageSize), typeCode, title));
|
||||
} catch (Exception e) {
|
||||
log.error("分页获取系统指南内容LIST失败: {}", e.getMessage(), e);
|
||||
return ResultBean.buildError(ResultMsgType.QUERY_FAIL.getValue());
|
||||
@@ -57,8 +54,9 @@ public class EduInstructionsContentController {
|
||||
|
||||
@ApiOperation("根据typeCode或者Id获取单条指南内容")
|
||||
@PostMapping("/getOneEduInstructionsContent")
|
||||
@ControllerLog(operation = "根据typeCode或者Id获取单条指南内容")
|
||||
public ResultBean<EduInstructionsContent> getOneEduInstructionsContent(@RequestParam(required = false) String typeCode,
|
||||
@RequestParam(required = false) Integer id
|
||||
@RequestParam(required = false) Integer id
|
||||
) {
|
||||
try {
|
||||
return ResultBean.buildSuccess(eduInstructionsContentService.getOneEduInstructionsContent(typeCode, id));
|
||||
@@ -71,7 +69,7 @@ public class EduInstructionsContentController {
|
||||
|
||||
@ApiOperation("新增或修改系统指南内容")
|
||||
@PostMapping("/saveOrUpdateInstructions")
|
||||
@OperationLog(module = ModuleName.INSTRUCTION, methods = "新增或修改系统指南内容", type = OperationLogTypeEnum.SAVE)
|
||||
@ControllerLog(operation = "新增或修改系统指南内容")
|
||||
public ResultBean saveOrUpdateInstructions(@RequestBody EduInstructionsContent eduInstructionsContent) {
|
||||
try {
|
||||
boolean b = eduInstructionsContentService.saveInstructionsContent(eduInstructionsContent, FebsUtil.getCurrentUser());
|
||||
@@ -89,7 +87,7 @@ public class EduInstructionsContentController {
|
||||
|
||||
@ApiOperation("删除系统指南内容")
|
||||
@PostMapping("/removeBatch")
|
||||
@OperationLog(module = ModuleName.INSTRUCTION, methods = "删除系统指南内容", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除系统指南内容")
|
||||
public ResultBean selectProduct(@ApiParam("系统指南内容id") @RequestBody List<Integer> ids) {
|
||||
try {
|
||||
eduInstructionsContentService.deleteByIds(ids);
|
||||
|
||||
+3
-5
@@ -1,13 +1,10 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.common.ResultMsgType;
|
||||
import com.yida.data.common.core.entity.instructions.EduInstructionsType;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.system.service.EduInstructionsTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -38,6 +35,7 @@ public class EduInstructionsTypeController {
|
||||
|
||||
@ApiOperation("系统指南类型列表")
|
||||
@GetMapping("/findList")
|
||||
@ControllerLog(operation = "系统指南类型列表")
|
||||
public ResultBean<List<EduInstructionsType>> selectInstructionsList() {
|
||||
try {
|
||||
return ResultBean.buildSuccess(eduInstructionsTypeService.selectInstructionsTypeList());
|
||||
@@ -50,7 +48,7 @@ public class EduInstructionsTypeController {
|
||||
|
||||
@ApiOperation("新增或修改系统指南类型")
|
||||
@PostMapping("/save")
|
||||
@OperationLog(module = ModuleName.INSTRUCTION, methods = "新增或修改系统指南类型", type = OperationLogTypeEnum.SAVE)
|
||||
@ControllerLog(operation = "新增或修改系统指南类型")
|
||||
public ResultBean insertInstructionsList(@RequestBody EduInstructionsType eduInstructionsType) {
|
||||
try {
|
||||
eduInstructionsTypeService.saveData(eduInstructionsType, FebsUtil.getCurrentUser());
|
||||
@@ -64,7 +62,7 @@ public class EduInstructionsTypeController {
|
||||
|
||||
@ApiOperation("删除系统指南类型")
|
||||
@PostMapping("/removeBatch")
|
||||
@OperationLog(module = ModuleName.INSTRUCTION, methods = "删除系统指南类型", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除系统指南类型")
|
||||
public ResultBean removeBatch(@ApiParam("系统指南类型id") @RequestBody List<Integer> ids) {
|
||||
try {
|
||||
eduInstructionsTypeService.removeByIds(ids);
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.BaiduApiConfig;
|
||||
import com.yida.data.common.core.entity.system.UnionPayConfig;
|
||||
import com.yida.data.common.core.utils.Asserts;
|
||||
import com.yida.data.system.service.BaiduApiConfigService;
|
||||
import com.yida.data.system.service.UnionPayConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 百度api配置信息 Controller
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/6/20
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "百度api配置信息(无鉴权)")
|
||||
@RequestMapping("/in/baiDuApiConfig")
|
||||
public class InBaiDuApiConfigController {
|
||||
|
||||
private final BaiduApiConfigService baiduApiConfigService;
|
||||
|
||||
@ApiOperation("根据学校id查询百度api配置")
|
||||
@GetMapping("/getBaiDuApiConfigByDept")
|
||||
public ResultBean<BaiduApiConfig> getBaiDuApiConfigByDept(@RequestParam Long deptId, @RequestParam String moduleName) {
|
||||
Asserts.isNotNull(deptId, "部门不能为空");
|
||||
return ResultBean.buildSuccess(baiduApiConfigService.getOne(Wrappers.lambdaQuery(new BaiduApiConfig())
|
||||
.eq(BaiduApiConfig::getSchoolId, deptId)
|
||||
.eq(BaiduApiConfig::getModuleName, moduleName)
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduBaseApp;
|
||||
import com.yida.data.system.service.EduBaseAppService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 基础app管理(无鉴权)
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-28 15:24:25
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "基础app管理(无鉴权)")
|
||||
@RestController
|
||||
@RequestMapping("/in/deptHomeApp")
|
||||
@RequiredArgsConstructor
|
||||
public class InBaseDeptHomeAppController {
|
||||
|
||||
private final EduBaseAppService eduBaseAppService;
|
||||
|
||||
@ApiOperation("根据id查询基础应用")
|
||||
@GetMapping("/getById")
|
||||
public ResultBean<EduBaseApp> getById(@RequestParam Long id) {
|
||||
return ResultBean.buildSuccess(eduBaseAppService.getById(id));
|
||||
}
|
||||
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
import com.yida.data.common.core.entity.system.UnionPayConfig;
|
||||
import com.yida.data.common.core.utils.Asserts;
|
||||
import com.yida.data.system.service.ConstructionPayConfigService;
|
||||
import com.yida.data.system.service.UnionPayConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 建行学习支付配置信息 Controller
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/6/19
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "建行学习支付配置信息(无鉴权)")
|
||||
@RequestMapping("/in/constructionPayConfig")
|
||||
public class InConstructionPayConfigController {
|
||||
|
||||
private final ConstructionPayConfigService constructionPayConfigService;
|
||||
|
||||
@ApiOperation("根据部门查询建行支付配置")
|
||||
@GetMapping("/getConstructionPayConfigByDept")
|
||||
public ResultBean<ConstructionPayConfig> getConstructionPayConfigByDept(Long deptId) {
|
||||
Asserts.isNotNull(deptId, "部门不能为空");
|
||||
return ResultBean.buildSuccess(constructionPayConfigService.getOne(Wrappers.lambdaQuery(new ConstructionPayConfig())
|
||||
.eq(ConstructionPayConfig::getDeptId, deptId)));
|
||||
}
|
||||
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.consume.EduConsumeConfig;
|
||||
import com.yida.data.common.core.utils.Asserts;
|
||||
import com.yida.data.system.service.EduConsumeConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 学校消费机服务器信息 Controller
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/4/6
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "学校消费机服务器信息(无鉴权)")
|
||||
@RequestMapping("/in/consumeConfig")
|
||||
public class InConsumeConfigController {
|
||||
|
||||
private final EduConsumeConfigService eduConsumeConfigService;
|
||||
|
||||
@ApiOperation("根据部门查询收钱吧支付配置信息")
|
||||
@GetMapping("/getConsumeConfigByDept")
|
||||
public ResultBean<EduConsumeConfig> getConsumeConfigByDept(Long deptId) {
|
||||
Asserts.isNotNull(deptId, "部门不能为空");
|
||||
return ResultBean.buildSuccess(eduConsumeConfigService.getOne(Wrappers.lambdaQuery(new EduConsumeConfig())
|
||||
.eq(EduConsumeConfig::getDeptId, deptId))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
+22
-27
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduDeptWxPublic;
|
||||
import com.yida.data.common.core.entity.system.EduHotWord;
|
||||
@@ -20,6 +21,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -67,7 +69,7 @@ public class InDeptController {
|
||||
@GetMapping("/getSchoolByName")
|
||||
public ResultBean<Dept> getSchoolByName(String schoolName) {
|
||||
return ResultBean.buildSuccess(deptService
|
||||
.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getDeptName, schoolName)));
|
||||
.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getDeptName, schoolName).eq(Dept::getDeptType, 0)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,15 +99,7 @@ public class InDeptController {
|
||||
@GetMapping("/syncQywxDept")
|
||||
public ResultBean syncQywxDept() {
|
||||
log.info("进入同步企业微信");
|
||||
deptService.syncQywxDept(null);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("同步指定学校企业微信部门")
|
||||
@GetMapping("/syncSchoolDept")
|
||||
public ResultBean<String> syncSchoolDept(@RequestParam Long schoolId) {
|
||||
log.info("同步企业微信部门数据: schoolId: [{}]", schoolId);
|
||||
deptService.syncQywxDept(schoolId);
|
||||
deptService.syncQywxDept();
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@@ -183,12 +177,29 @@ public class InDeptController {
|
||||
|
||||
@ApiOperation("根据名称和类型查询教育局学校列表")
|
||||
@PostMapping("/listSchoolPage")
|
||||
// @Cacheable(value = CachePrefixConstant.SCHOOL_LIST_SEARCH, key = "#dto.deptId + '-' + #dto.schoolName")
|
||||
public ResultBean<IPage<SchoolInformationDTO>> listSchoolPage(@RequestBody SchoolPageDTO dto) {
|
||||
IPage<SchoolInformationDTO> page = deptService.listSchoolPage(dto);
|
||||
return ResultBean.buildSuccess(page);
|
||||
}
|
||||
|
||||
@ApiOperation("根据名称查询教育局缴费学校列表")
|
||||
@GetMapping("/listPaySchool")
|
||||
public ResultBean<List<SchoolInformationDTO>> listPaySchool(
|
||||
@ApiParam(value = "教育局或代理商id", required = true) @RequestParam Long deptId,
|
||||
@ApiParam(value = "学校名称") String schoolName) {
|
||||
List<SchoolInformationDTO> list = deptService.listPaySchool(deptId, schoolName);
|
||||
return ResultBean.buildSuccess(list);
|
||||
}
|
||||
|
||||
@ApiOperation("查询:1幼儿园,2小学,3初中,4高中,5大学")
|
||||
@PostMapping("/listSchoolPageByNature")
|
||||
@Cacheable(value = CachePrefixConstant.SCHOOL_LIST_SEARCH, key = "#dto.deptId + '-' + #dto.natureType + '-' + #dto.schoolName")
|
||||
public ResultBean<IPage<SchoolInformationDTO>> listSchoolPageByNature(@RequestBody SchoolPageDTO dto) {
|
||||
IPage<SchoolInformationDTO> page = deptService.listSchoolPage(dto);
|
||||
return ResultBean.buildSuccess(page);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据住所查询对应可读学校")
|
||||
@GetMapping("/findSchoolByAddress")
|
||||
public ResultBean<Page<SchoolInformationDTO>> findSchoolByAddress(
|
||||
@@ -246,20 +257,4 @@ public class InDeptController {
|
||||
|
||||
return ResultBean.buildSuccess(deptService.findHotWord(num, type, deptId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询父级部门集合")
|
||||
@PostMapping("/findParentDeptByChilds")
|
||||
public ResultBean<List<Dept>> findParentDeptByChilds(@RequestBody List<Long> deptIds) {
|
||||
return ResultBean.buildSuccess(deptService.findParentDeptByChild(deptIds));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取部门树")
|
||||
@PostMapping("/getDeptTree")
|
||||
public ResultBean<List> getDeptTree(@RequestBody List<Long> deptIds) {
|
||||
return ResultBean.buildSuccess(deptService.getDeptTree(deptIds));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduDeptFunction;
|
||||
import com.yida.data.system.service.EduDeptFunctionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 系统功能 Controller
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/2/21
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "系统功能(无鉴权)")
|
||||
@RequestMapping("/in/function")
|
||||
public class InDeptFunctionController {
|
||||
|
||||
private final EduDeptFunctionService eduDeptFunctionService;
|
||||
|
||||
@ApiOperation("获取部门是否开通当前功能")
|
||||
@GetMapping("/getDeptFunction")
|
||||
public ResultBean<EduDeptFunction> getDeptFunction(String functionName, Long deptId) {
|
||||
return ResultBean.buildSuccess(eduDeptFunctionService.getOne(Wrappers.lambdaQuery(new EduDeptFunction())
|
||||
.eq(EduDeptFunction::getFunctionName, functionName)
|
||||
.eq(EduDeptFunction::getDeptId, deptId)
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.Dict;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.system.service.DictService;
|
||||
import com.yida.data.system.vo.DictTypePageVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 字典crud
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/in/dict")
|
||||
public class InDictController {
|
||||
|
||||
@Resource
|
||||
private DictService dictService;
|
||||
|
||||
@GetMapping("/selectDict")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "查询字典")
|
||||
public ResultBean<List<Dict>> selectDict(@ApiParam("类型") @RequestParam String type) {
|
||||
return ResultBean.buildSuccess(dictService.list(Wrappers.lambdaQuery(new Dict())
|
||||
.eq(Dict::getType, type).orderByAsc(Dict::getSort)));
|
||||
}
|
||||
|
||||
@GetMapping("/getDictByTypeAndValueOrLabel")
|
||||
public ResultBean getDictCode(String type, String value, String label) {
|
||||
log.info("参数信息: {},{},{}", type, value, label);
|
||||
if (ObjectUtil.isNotNull(value)) {
|
||||
return ResultBean
|
||||
.buildSuccess(
|
||||
dictService.getOne(Wrappers.lambdaQuery(new Dict()).eq(Dict::getType, type).eq(Dict::getValue, value)));
|
||||
}
|
||||
if (ObjectUtil.isNotNull(label)) {
|
||||
return ResultBean
|
||||
.buildSuccess(
|
||||
dictService.getOne(Wrappers.lambdaQuery(new Dict()).eq(Dict::getType, type).eq(Dict::getLabel, label)));
|
||||
}
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
-22
@@ -1,14 +1,9 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduApp;
|
||||
import com.yida.data.common.core.entity.system.EduAppTemplate;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.system.service.EduAppService;
|
||||
|
||||
import com.yida.data.system.service.EduAppTemplateService;
|
||||
import com.yida.data.system.service.EduQywxServiceProviderService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -22,26 +17,9 @@ import lombok.RequiredArgsConstructor;
|
||||
@RequiredArgsConstructor
|
||||
public class InEduAppController {
|
||||
private final EduAppService eduAppService;
|
||||
private final EduAppTemplateService eduAppTemplateService;
|
||||
private final EduQywxServiceProviderService eduQywxServiceProviderService;
|
||||
|
||||
@GetMapping("/getAppBySchoolOrCorpIdAndCode")
|
||||
public ResultBean<EduApp> getAppBySchoolOrCorpIdAndCode(Long schoolId, String corpId, String code) {
|
||||
return ResultBean.buildSuccess(eduAppService.getAppBySchoolOrCorpIdAndCode(schoolId, corpId, code));
|
||||
}
|
||||
|
||||
@GetMapping("/getAppTemplateByTemplateId")
|
||||
public ResultBean<EduAppTemplate> getAppTemplateByTemplateId(String templateId, String serviceCorpId) {
|
||||
return ResultBean.buildSuccess(eduAppTemplateService.getOne(Wrappers.lambdaQuery(new EduAppTemplate())
|
||||
.eq(EduAppTemplate::getTemplateId, templateId)
|
||||
.eq(EduAppTemplate::getServiceCorpId, serviceCorpId)
|
||||
));
|
||||
}
|
||||
|
||||
@GetMapping("/getServiceProviderByServiceCorpId")
|
||||
public ResultBean<EduQywxServiceProvider> getServiceProviderByServiceCorpId(String serviceCorpId) {
|
||||
return ResultBean.buildSuccess(eduQywxServiceProviderService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProvider())
|
||||
.eq(EduQywxServiceProvider::getCorpId, serviceCorpId)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
+11
-122
@@ -1,17 +1,19 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.system.service.EduQywxServiceProviderSchoolService;
|
||||
import com.yida.data.system.service.QywxCallbackService;
|
||||
import com.yida.data.system.service.QywxServiceProviderService;
|
||||
|
||||
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 org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "企业微信同步")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@@ -19,8 +21,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class InQywxController {
|
||||
|
||||
private final QywxCallbackService qywxCallbackService;
|
||||
private final QywxServiceProviderService qywxServiceProviderService;
|
||||
private final EduQywxServiceProviderSchoolService eduQywxServiceProviderSchoolService;
|
||||
|
||||
@GetMapping("/callback/{corpId}")
|
||||
public String get(@PathVariable String corpId,
|
||||
@@ -33,124 +33,13 @@ public class InQywxController {
|
||||
}
|
||||
|
||||
@PostMapping("/callback/{corpId}")
|
||||
public String post(@PathVariable String corpId,
|
||||
public Object post(@PathVariable String corpId,
|
||||
@RequestParam("msg_signature") String msgSignature,
|
||||
@RequestParam("timestamp") String timestamp,
|
||||
@RequestParam("nonce") String nonce,
|
||||
@RequestBody String body) {
|
||||
return qywxCallbackService.post(corpId, msgSignature, timestamp, nonce, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商代开发应用模板验证URL回调
|
||||
*/
|
||||
@GetMapping("/normal/callback/{corpId}")
|
||||
public String getNormal(@PathVariable String corpId,
|
||||
@RequestParam("msg_signature") String msgSignature,
|
||||
@RequestParam("timestamp") String timestamp,
|
||||
@RequestParam("nonce") String nonce,
|
||||
@RequestParam("echostr") String echostr) {
|
||||
return qywxCallbackService.getNormal(corpId, msgSignature, timestamp, nonce, echostr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商代开发应用模板接口回调
|
||||
*/
|
||||
@PostMapping("/normal/callback/{corpId}")
|
||||
public String postNormal(@PathVariable String corpId,
|
||||
@RequestParam("msg_signature") String msgSignature,
|
||||
@RequestParam("timestamp") String timestamp,
|
||||
@RequestParam("nonce") String nonce,
|
||||
@RequestBody String body) {
|
||||
return qywxCallbackService.postNormal(corpId, msgSignature, timestamp, nonce, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商代开发应用客户验证URL回调
|
||||
*/
|
||||
@GetMapping("/normal/customer/callback/{providerCorpId}/{corpId}")
|
||||
public String getNormalCustomer(@PathVariable String providerCorpId,
|
||||
@PathVariable String corpId,
|
||||
@RequestParam("msg_signature") String msgSignature,
|
||||
@RequestParam("timestamp") String timestamp,
|
||||
@RequestParam("nonce") String nonce,
|
||||
@RequestParam("echostr") String echostr) {
|
||||
return qywxCallbackService.getNormalCustomer(providerCorpId, corpId, msgSignature, timestamp, nonce, echostr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商代开发应用客户接口回调
|
||||
* 此回调暂不做任何处理
|
||||
*/
|
||||
@PostMapping("/normal/customer/callback/{providerCorpId}/{corpId}")
|
||||
public String postNormalCustomer(
|
||||
@PathVariable String providerCorpId,
|
||||
@PathVariable String corpId,
|
||||
@RequestParam("msg_signature") String msgSignature,
|
||||
@RequestParam("timestamp") String timestamp,
|
||||
@RequestParam("nonce") String nonce,
|
||||
@RequestBody String body) {
|
||||
return qywxCallbackService.postNormalCustomer(providerCorpId, corpId, msgSignature, timestamp, nonce, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商代开发应用验证URL回调
|
||||
*/
|
||||
@GetMapping("/event/callback/{providerCorpId}/{corpId}")
|
||||
public String getEvent(@PathVariable String providerCorpId,
|
||||
@PathVariable String corpId,
|
||||
@RequestParam("msg_signature") String msgSignature,
|
||||
@RequestParam("timestamp") String timestamp,
|
||||
@RequestParam("nonce") String nonce,
|
||||
@RequestParam("echostr") String echostr) {
|
||||
return qywxCallbackService.getEvent(providerCorpId, corpId, msgSignature, timestamp, nonce, echostr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商代开发应用回调
|
||||
*/
|
||||
@PostMapping("/event/callback/{providerCorpId}/{corpId}")
|
||||
public String postEvent(
|
||||
@PathVariable String providerCorpId,
|
||||
@PathVariable String corpId,
|
||||
@RequestParam("msg_signature") String msgSignature,
|
||||
@RequestParam("timestamp") String timestamp,
|
||||
@RequestParam("nonce") String nonce,
|
||||
@RequestBody String body) {
|
||||
return qywxCallbackService.postEvent(providerCorpId, corpId, msgSignature, timestamp, nonce, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密对应服务商的学校corpId
|
||||
*/
|
||||
@GetMapping("/changeCorpId/{providerCorpId}/{corpId}")
|
||||
public ResultBean<String> changeCorpId(@PathVariable String providerCorpId, @PathVariable String corpId) {
|
||||
qywxServiceProviderService.changeCorpId(providerCorpId, corpId);
|
||||
qywxCallbackService.post(corpId, msgSignature, timestamp, nonce, body);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商对应学校加密corpId数据(原始值为key)
|
||||
*/
|
||||
@GetMapping("/getCorpByOriginalData")
|
||||
public ResultBean<EduQywxServiceProviderSchool> getCorpByOriginalData(@RequestParam String providerCorpId,
|
||||
@RequestParam String deptOriginalCorpId) {
|
||||
EduQywxServiceProviderSchool providerSchool = eduQywxServiceProviderSchoolService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProviderSchool())
|
||||
.eq(EduQywxServiceProviderSchool::getProviderCorpId, providerCorpId)
|
||||
.eq(EduQywxServiceProviderSchool::getDeptOriginalCorpId, deptOriginalCorpId));
|
||||
return ResultBean.buildSuccess(providerSchool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务商对应学校加密corpId数据(加密值为key)
|
||||
*/
|
||||
@GetMapping("/getCorpByEncryptionData")
|
||||
public ResultBean<EduQywxServiceProviderSchool> getCorpByEncryptionData(@RequestParam String providerCorpId,
|
||||
@RequestParam String deptEncryptionCorpId) {
|
||||
EduQywxServiceProviderSchool providerSchool = eduQywxServiceProviderSchoolService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProviderSchool())
|
||||
.eq(EduQywxServiceProviderSchool::getProviderCorpId, providerCorpId)
|
||||
.eq(EduQywxServiceProviderSchool::getDeptEncryptionCorpId, deptEncryptionCorpId));
|
||||
return ResultBean.buildSuccess(providerSchool);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.UPayConfig;
|
||||
import com.yida.data.common.core.utils.Asserts;
|
||||
import com.yida.data.system.service.UPayConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 收钱吧支付配置信息 Controller
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/3/21
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "收钱吧支付配置信息(无鉴权)")
|
||||
@RequestMapping("/in/uPayConfig")
|
||||
public class InUPayConfigController {
|
||||
|
||||
private final UPayConfigService uPayConfigService;
|
||||
|
||||
@ApiOperation("根据部门查询收钱吧支付配置信息")
|
||||
@GetMapping("/getUPayConfigByDept")
|
||||
public ResultBean<UPayConfig> getUPayConfigByDept(Long deptId) {
|
||||
Asserts.isNotNull(deptId, "部门不能为空");
|
||||
return ResultBean.buildSuccess(uPayConfigService.getOne(Wrappers.lambdaQuery(new UPayConfig())
|
||||
.eq(UPayConfig::getDeptId, deptId))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
+7
-11
@@ -6,12 +6,16 @@ import com.yida.data.system.service.IUserRoleService;
|
||||
import com.yida.data.system.service.IUserService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Slf4j
|
||||
@Validated
|
||||
@@ -64,12 +68,4 @@ public class InUserController {
|
||||
userService.updateUserRoleByRoleName(userId, roleNames);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("获取企业微信用户授权后创建职工用户信息")
|
||||
@GetMapping("createStaff")
|
||||
public ResultBean<String> createStaff(@ApiParam("学校Id") Long schoolId,
|
||||
@ApiParam("通过成员授权获取到的code") String code) {
|
||||
userService.createStaff(schoolId, code);
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.WhiteList;
|
||||
import com.yida.data.system.service.WhiteListService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 白名单 Controller
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/2/21
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "白名单(无鉴权)")
|
||||
@RequestMapping("/in/whiteList")
|
||||
public class InWhiteListController {
|
||||
|
||||
private final WhiteListService whiteListService;
|
||||
|
||||
@ApiOperation("根据功能名称获取对应的白名单信息")
|
||||
@GetMapping("/getWhiteList")
|
||||
public ResultBean<WhiteList> getWhiteList(String functionName) {
|
||||
return ResultBean.buildSuccess(whiteListService.getOne(Wrappers.lambdaQuery(new WhiteList())
|
||||
.eq(WhiteList::getFunctionName, functionName)));
|
||||
}
|
||||
|
||||
}
|
||||
+2
-4
@@ -1,14 +1,11 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.entity.FebsResponse;
|
||||
import com.yida.data.common.core.entity.QueryRequest;
|
||||
import com.yida.data.common.core.entity.constant.StringConstant;
|
||||
import com.yida.data.common.core.entity.system.LoginLog;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.system.service.ILoginLogService;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -54,7 +51,7 @@ public class LoginLogController {
|
||||
|
||||
@DeleteMapping("{ids}")
|
||||
@PreAuthorize("hasAuthority('loginlog:delete')")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "删除登录日志", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除登录日志", exceptionMessage = "删除登录日志失败")
|
||||
public void deleteLogs(@NotBlank(message = "{required}") @PathVariable String ids) {
|
||||
String[] loginLogIds = ids.split(StringConstant.COMMA);
|
||||
this.loginLogService.deleteLoginLogs(loginLogIds);
|
||||
@@ -62,6 +59,7 @@ public class LoginLogController {
|
||||
|
||||
@PostMapping("excel")
|
||||
@PreAuthorize("hasAuthority('loginlog:export')")
|
||||
@ControllerLog(operation = "导出登录日志数据", exceptionMessage = "导出Excel失败")
|
||||
public void export(QueryRequest request, LoginLog loginLog, HttpServletResponse response) {
|
||||
List<LoginLog> loginLogs = this.loginLogService.findLoginLogs(loginLog, request).getRecords();
|
||||
//ExcelKit.$Export(LoginLog.class, response).downXlsx(loginLogs, false);
|
||||
|
||||
+10
-13
@@ -1,14 +1,11 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.entity.FebsResponse;
|
||||
import com.yida.data.common.core.entity.constant.StringConstant;
|
||||
import com.yida.data.common.core.entity.router.VueRouter;
|
||||
import com.yida.data.common.core.entity.system.Menu;
|
||||
import com.yida.data.common.core.entity.system.Role;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.system.service.IMenuService;
|
||||
import com.yida.data.system.service.IRoleService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -42,7 +39,6 @@ public class MenuController {
|
||||
private final IMenuService menuService;
|
||||
|
||||
private final IRoleService roleService;
|
||||
|
||||
@GetMapping("/{username}")
|
||||
public FebsResponse getUserRouters(@NotBlank(message = "{required}") @PathVariable String username) {
|
||||
Map<String, Object> result = new HashMap<>(4);
|
||||
@@ -60,9 +56,9 @@ public class MenuController {
|
||||
String[] roleArray = new String[0];
|
||||
if (!CollectionUtils.isEmpty(userRoleList)) {
|
||||
String userRoles = userRoleList.stream()
|
||||
.filter(role -> Objects.nonNull(role) && StringUtils.isNotBlank(role.getRolePerms()))
|
||||
.map(Role::getRolePerms)
|
||||
.collect(Collectors.joining(StringConstant.COMMA));
|
||||
.filter(role -> Objects.nonNull(role) && StringUtils.isNotBlank(role.getRolePerms()))
|
||||
.map(Role::getRolePerms)
|
||||
.collect(Collectors.joining(StringConstant.COMMA));
|
||||
if (StringUtils.isNoneBlank(userPermissions)) {
|
||||
roleArray = StringUtils.splitByWholeSeparatorPreserveAllTokens(userRoles, StringConstant.COMMA);
|
||||
}
|
||||
@@ -71,9 +67,9 @@ public class MenuController {
|
||||
String[] mainRoleArray = new String[0];
|
||||
if (!CollectionUtils.isEmpty(mainRoleList)) {
|
||||
String mainRoles = mainRoleList.stream()
|
||||
.filter(role -> Objects.nonNull(role) && StringUtils.isNotBlank(role.getRolePerms()))
|
||||
.map(Role::getRolePerms)
|
||||
.collect(Collectors.joining(StringConstant.COMMA));
|
||||
.filter(role -> Objects.nonNull(role) && StringUtils.isNotBlank(role.getRolePerms()))
|
||||
.map(Role::getRolePerms)
|
||||
.collect(Collectors.joining(StringConstant.COMMA));
|
||||
if (StringUtils.isNoneBlank(mainRoles)) {
|
||||
mainRoleArray = StringUtils.splitByWholeSeparatorPreserveAllTokens(mainRoles, StringConstant.COMMA);
|
||||
}
|
||||
@@ -99,14 +95,14 @@ public class MenuController {
|
||||
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAuthority('menu:add')")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "新增菜单/按钮", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增菜单/按钮", exceptionMessage = "新增菜单/按钮失败")
|
||||
public void addMenu(@Valid Menu menu) {
|
||||
this.menuService.createMenu(menu);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{menuIds}")
|
||||
@PreAuthorize("hasAuthority('menu:delete')")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "删除菜单/按钮", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除菜单/按钮", exceptionMessage = "删除菜单/按钮失败")
|
||||
public void deleteMenus(@NotBlank(message = "{required}") @PathVariable String menuIds) {
|
||||
String[] ids = menuIds.split(StringConstant.COMMA);
|
||||
this.menuService.deleteMeuns(ids);
|
||||
@@ -114,13 +110,14 @@ public class MenuController {
|
||||
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAuthority('menu:update')")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "修改菜单/按钮", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改菜单/按钮", exceptionMessage = "修改菜单/按钮失败")
|
||||
public void updateMenu(@Valid Menu menu) {
|
||||
this.menuService.updateMenu(menu);
|
||||
}
|
||||
|
||||
@PostMapping("excel")
|
||||
@PreAuthorize("hasAuthority('menu:export')")
|
||||
@ControllerLog(operation = "导出菜单数据", exceptionMessage = "导出Excel失败")
|
||||
public void export(Menu menu, HttpServletResponse response) {
|
||||
List<Menu> menus = this.menuService.findMenuList(menu);
|
||||
//ExcelKit.$Export(Menu.class, response).downXlsx(menus, false);
|
||||
|
||||
+14
@@ -4,17 +4,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduDeptWxPublic;
|
||||
import com.yida.data.system.dto.SchoolInformationDTO;
|
||||
import com.yida.data.system.mapper.EduDeptWxPublicMapper;
|
||||
import com.yida.data.system.service.IDeptService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Validated
|
||||
@Api(tags = "部门管理(无鉴权 外部使用)")
|
||||
@@ -37,4 +42,13 @@ public class OutDeptController {
|
||||
}
|
||||
return ResultBean.buildSuccess(school);
|
||||
}
|
||||
|
||||
@ApiOperation("根据名称查询教育局缴费学校列表")
|
||||
@GetMapping("/listPaySchool")
|
||||
public ResultBean<List<SchoolInformationDTO>> listPaySchool(
|
||||
@ApiParam(value = "教育局或代理商id", required = true) @RequestParam Long deptId,
|
||||
@ApiParam(value = "学校名称") String schoolName) {
|
||||
List<SchoolInformationDTO> list = deptService.listPaySchool(deptId, schoolName);
|
||||
return ResultBean.buildSuccess(list);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-6
@@ -1,15 +1,12 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.FebsResponse;
|
||||
import com.yida.data.common.core.entity.QueryRequest;
|
||||
import com.yida.data.common.core.entity.constant.StringConstant;
|
||||
import com.yida.data.common.core.entity.system.Role;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
import com.yida.data.log.annotation.OperationLog;
|
||||
import com.yida.data.system.service.IRoleService;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -67,14 +64,14 @@ public class RoleController {
|
||||
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAuthority('role:add')")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "新增角色", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增角色", exceptionMessage = "新增角色失败")
|
||||
public void addRole(@Valid Role role) {
|
||||
this.roleService.createRole(role);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{roleIds}")
|
||||
@PreAuthorize("hasAuthority('role:delete')")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "删除角色失败", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除角色", exceptionMessage = "删除角色失败")
|
||||
public void deleteRoles(@NotBlank(message = "{required}") @PathVariable String roleIds) {
|
||||
String[] ids = roleIds.split(StringConstant.COMMA);
|
||||
this.roleService.deleteRoles(ids);
|
||||
@@ -82,13 +79,14 @@ public class RoleController {
|
||||
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAuthority('role:update')")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "修改角色", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改角色", exceptionMessage = "修改角色失败")
|
||||
public void updateRole(@Valid Role role) {
|
||||
this.roleService.updateRole(role);
|
||||
}
|
||||
|
||||
@PostMapping("excel")
|
||||
@PreAuthorize("hasAuthority('role:export')")
|
||||
@ControllerLog(operation = "导出角色数据", exceptionMessage = "导出Excel失败")
|
||||
public void export(QueryRequest queryRequest, Role role, HttpServletResponse response) {
|
||||
List<Role> roles = this.roleService.findRoles(role, queryRequest).getRecords();
|
||||
//ExcelKit.$Export(Role.class, response).downXlsx(roles, false);
|
||||
|
||||
+13
-19
@@ -1,6 +1,7 @@
|
||||
package com.yida.data.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.annotation.ControllerLog;
|
||||
import com.yida.data.common.core.common.ModuleName;
|
||||
import com.yida.data.common.core.common.ResultBean;
|
||||
import com.yida.data.common.core.entity.FebsResponse;
|
||||
@@ -11,7 +12,6 @@ import com.yida.data.common.core.entity.system.LoginLog;
|
||||
import com.yida.data.common.core.entity.system.SystemUser;
|
||||
import com.yida.data.common.core.entity.system.SystemUserMenu;
|
||||
import com.yida.data.common.core.entity.system.UserRole;
|
||||
import com.yida.data.common.core.entity.system.enums.OperationLogTypeEnum;
|
||||
import com.yida.data.common.core.exception.FebsException;
|
||||
import com.yida.data.common.core.utils.ExcelUtil;
|
||||
import com.yida.data.common.core.utils.FebsUtil;
|
||||
@@ -116,14 +116,14 @@ public class UserController {
|
||||
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAuthority('user:add')")
|
||||
@OperationLog(module = ModuleName.USER, methods = "新增用户", type = OperationLogTypeEnum.INSERT)
|
||||
@ControllerLog(operation = "新增用户", exceptionMessage = "新增用户失败")
|
||||
public void addUser(@Valid SystemUser user) {
|
||||
userService.createUser(user);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAuthority('user:update')")
|
||||
@OperationLog(module = ModuleName.USER, methods = "修改用户", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改用户", exceptionMessage = "修改用户失败")
|
||||
public void updateUser(@Valid SystemUser user) {
|
||||
userService.updateUser(user);
|
||||
}
|
||||
@@ -137,32 +137,33 @@ public class UserController {
|
||||
|
||||
@DeleteMapping("/{userIds}")
|
||||
@PreAuthorize("hasAuthority('user:delete')")
|
||||
@OperationLog(module = ModuleName.USER, methods = "删除用户", type = OperationLogTypeEnum.DELETE)
|
||||
@ControllerLog(operation = "删除用户", exceptionMessage = "删除用户失败")
|
||||
public void deleteUsers(@NotBlank(message = "{required}") @PathVariable String userIds) {
|
||||
String[] ids = userIds.split(StringConstant.COMMA);
|
||||
userService.deleteUsers(ids);
|
||||
}
|
||||
|
||||
@GetMapping("/updatePassword")
|
||||
@OperationLog(module = ModuleName.USER, methods = "修改密码", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改密码", exceptionMessage = "修改密码失败")
|
||||
public void updatePassword(String password, String newPassword, String repeatPassword) {
|
||||
userService.updatePassword(password, newPassword, repeatPassword, FebsUtil.getCurrentUsername());
|
||||
}
|
||||
|
||||
@GetMapping("/validatePassword")
|
||||
@ControllerLog(operation = "校验密码", exceptionMessage = "密码校验失败")
|
||||
public ResultBean validatePassword(String password) {
|
||||
userService.validatePassword(password, FebsUtil.getCurrentUsername());
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@PutMapping("profile")
|
||||
@OperationLog(module = ModuleName.USER, methods = "修改个人信息", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(exceptionMessage = "修改个人信息失败")
|
||||
public void updateProfile(@Valid SystemUser user) throws FebsException {
|
||||
userService.updateProfile(user);
|
||||
}
|
||||
|
||||
@PutMapping("avatar")
|
||||
@OperationLog(module = ModuleName.USER, methods = "修改头像", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(exceptionMessage = "修改头像失败")
|
||||
public void updateAvatar(@NotBlank(message = "{required}") String avatar) {
|
||||
userService.updateAvatar(avatar);
|
||||
}
|
||||
@@ -175,14 +176,14 @@ public class UserController {
|
||||
}
|
||||
|
||||
@PutMapping("password")
|
||||
@OperationLog(module = ModuleName.USER, methods = "修改密码", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(exceptionMessage = "修改密码失败")
|
||||
public void updatePassword(@NotBlank(message = "{required}") String password) {
|
||||
userService.updatePassword(password);
|
||||
}
|
||||
|
||||
@PutMapping("password/reset")
|
||||
@PreAuthorize("hasAuthority('user:reset')")
|
||||
@OperationLog(module = ModuleName.USER, methods = "重置用户密码", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(exceptionMessage = "重置用户密码失败")
|
||||
public void resetPassword(@NotBlank(message = "{required}") String usernames) {
|
||||
String[] usernameArr = usernames.split(StringConstant.COMMA);
|
||||
userService.resetPassword(usernameArr);
|
||||
@@ -190,6 +191,8 @@ public class UserController {
|
||||
|
||||
@PostMapping("excel")
|
||||
@PreAuthorize("hasAuthority('user:export')")
|
||||
@ControllerLog(operation = "导出用户数据", exceptionMessage = "导出Excel失败")
|
||||
@OperationLog(module = ModuleName.SYSTEM, methods = "导出用户数据")
|
||||
public void export(QueryRequest queryRequest, SystemUser user, HttpServletResponse response) {
|
||||
List<SystemUser> users = userService.findUserDetailList(user, queryRequest).getRecords();
|
||||
List<ExportUserInfoVO> userInfoVOS = users.stream().map(x -> {
|
||||
@@ -219,7 +222,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("锁定或解锁用户")
|
||||
@GetMapping("/lockUser")
|
||||
@OperationLog(module = ModuleName.USER, methods = "锁定或解锁用户", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean lockUser(Long id) {
|
||||
userService.lockUser(id);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -227,7 +229,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("重置密码")
|
||||
@GetMapping("/resetPwd")
|
||||
@OperationLog(module = ModuleName.USER, methods = "重置密码", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean resetPwd(Long id) {
|
||||
userService.resetPwd(id);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -235,13 +236,12 @@ public class UserController {
|
||||
|
||||
@ApiOperation("添加用户")
|
||||
@PostMapping("/add")
|
||||
@OperationLog(module = ModuleName.USER, methods = "添加用户", type = OperationLogTypeEnum.INSERT)
|
||||
public ResultBean add(@RequestBody SystemUser systemUser) {
|
||||
return ResultBean.buildSuccess(userService.createUser(systemUser));
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@OperationLog(module = ModuleName.USER, methods = "修改用户", type = OperationLogTypeEnum.UPDATE)
|
||||
@ControllerLog(operation = "修改用户", exceptionMessage = "修改用户失败")
|
||||
public ResultBean updateUserWithName(@RequestBody SystemUser user) {
|
||||
userService.updateUserWithName(user);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -249,7 +249,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("批量删除用户")
|
||||
@PostMapping("/delUser")
|
||||
@OperationLog(module = ModuleName.USER, methods = "批量删除用户", type = OperationLogTypeEnum.DELETE)
|
||||
public ResultBean delUser(@RequestBody String[] ids) {
|
||||
userService.deleteUsers(ids);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -257,7 +256,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("添加用户角色")
|
||||
@PostMapping("/addUserRole")
|
||||
@OperationLog(module = ModuleName.USER, methods = "添加用户角色", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean addUserRole(@RequestBody UserRole[] userRole) {
|
||||
userRoleService.bindRoleByRoleName(userRole);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -276,7 +274,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("新增用户对应菜单")
|
||||
@PostMapping("/saveUserMenu")
|
||||
@OperationLog(module = ModuleName.USER, methods = "新增用户对应菜单", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean saveUserMenu(@RequestBody MenuForUserDTO menuForUserDTO) {
|
||||
systemUserMenuService.saveUserMenu(menuForUserDTO);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -284,7 +281,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("修改用户对应菜单")
|
||||
@PostMapping("/updateUserMenu")
|
||||
@OperationLog(module = ModuleName.USER, methods = "修改用户对应菜单", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean updateUserMenu(@RequestBody MenuForUserDTO menuForUserDTO) {
|
||||
systemUserMenuService.updateUserMenu(menuForUserDTO);
|
||||
return ResultBean.buildSuccess();
|
||||
@@ -292,7 +288,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("删除用户对应菜单")
|
||||
@GetMapping("/removeUserMenu")
|
||||
@OperationLog(module = ModuleName.USER, methods = "删除用户对应菜单", type = OperationLogTypeEnum.UPDATE)
|
||||
public ResultBean removeUserMenu(@ApiParam("用户id") @RequestParam Long userId) {
|
||||
systemUserMenuService.remove(Wrappers.lambdaQuery(new SystemUserMenu())
|
||||
.eq(SystemUserMenu::getUserId, userId));
|
||||
@@ -313,7 +308,6 @@ public class UserController {
|
||||
|
||||
@ApiOperation("保存logo")
|
||||
@PostMapping("/saveLogo")
|
||||
@OperationLog(module = ModuleName.USER, methods = "保存logo", type = OperationLogTypeEnum.INSERT)
|
||||
public ResultBean saveLogo(@RequestBody EduUserLogo logo) {
|
||||
eduUserLogoService.saveOrUpdate(logo);
|
||||
return ResultBean.buildSuccess();
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.BaiduApiConfig;
|
||||
|
||||
/**
|
||||
* 百度api配置信息 Mapper
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-20 20:42:47
|
||||
*/
|
||||
public interface BaiduApiConfigMapper extends BaseMapper<BaiduApiConfig> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
|
||||
/**
|
||||
* 建行学校信息配置 Mapper
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-19 16:30:18
|
||||
*/
|
||||
public interface ConstructionPayConfigMapper extends BaseMapper<ConstructionPayConfig> {
|
||||
|
||||
}
|
||||
+16
-3
@@ -18,12 +18,13 @@ public interface DeptSchoolInformationMapper extends BaseMapper<DeptSchoolInform
|
||||
|
||||
/**
|
||||
* 分页查询学校
|
||||
* @param deptId 教育局或代理商id
|
||||
*
|
||||
* @param deptId 教育局或代理商id
|
||||
* @param schoolName 学校名称
|
||||
* @param schoolType 学校类型
|
||||
* @param natureType 学校性质
|
||||
* @param areaId 区域id
|
||||
* @param tag 标签
|
||||
* @param areaId 区域id
|
||||
* @param tag 标签
|
||||
* @return
|
||||
*/
|
||||
Page<SchoolInformationDTO> findSchoolListByDeptId(@Param("deptId") Long deptId, @Param("schoolName") String schoolName,
|
||||
@@ -41,4 +42,16 @@ public interface DeptSchoolInformationMapper extends BaseMapper<DeptSchoolInform
|
||||
List<Long> findDeptSchoolId(@Param("tags") String[] tags);
|
||||
|
||||
IPage<SchoolInformationDTO> listSchoolPage(Page<Dept> page, @Param("dto") SchoolPageDTO dto);
|
||||
|
||||
/**
|
||||
* 根据名称查询教育局缴费学校列表
|
||||
*
|
||||
* @param deptId 教育局或代理商id
|
||||
* @param schoolName 学校名称
|
||||
* @return java.util.List<com.yida.data.system.dto.SchoolInformationDTO>
|
||||
* @author ZYJ
|
||||
* @date 2023/8/30 14:23
|
||||
*/
|
||||
List<SchoolInformationDTO> listPaySchool(@Param("deptId") Long deptId,
|
||||
@Param("schoolName") String schoolName);
|
||||
}
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.EduAppTemplate;
|
||||
|
||||
/**
|
||||
* 企业微信服务商代开发应用模板dao
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3
|
||||
*/
|
||||
public interface EduAppTemplateMapper extends BaseMapper<EduAppTemplate> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.EduBaseApp;
|
||||
|
||||
/**
|
||||
* 基础应用信息(本地配置) Mapper
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-28 14:57:58
|
||||
*/
|
||||
public interface EduBaseAppMapper extends BaseMapper<EduBaseApp> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.consume.EduConsumeConfig;
|
||||
|
||||
/**
|
||||
* 学校消费机服务器信息Mapper
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-04-06 17:31:11
|
||||
*/
|
||||
public interface EduConsumeConfigMapper extends BaseMapper<EduConsumeConfig> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.EduDeptFunction;
|
||||
|
||||
/**
|
||||
* 部门对应的第三方系统功能Mapper
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-02-20 15:29:05
|
||||
*/
|
||||
public interface EduDeptFunctionMapper extends BaseMapper<EduDeptFunction> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
|
||||
/**
|
||||
* 企业微信服务商dao
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3
|
||||
*/
|
||||
public interface EduQywxServiceProviderMapper extends BaseMapper<EduQywxServiceProvider> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
|
||||
/**
|
||||
* 企业微信服务商-学校密文corpId对照表dao
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
public interface EduQywxServiceProviderSchoolMapper extends BaseMapper<EduQywxServiceProviderSchool> {
|
||||
|
||||
}
|
||||
-11
@@ -28,15 +28,4 @@ public interface MenuMapper extends BaseMapper<Menu> {
|
||||
*/
|
||||
List<Menu> findUserRealMenus(@Param("username") String username,
|
||||
@Param("selectType") Integer selectType);
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户绑定权限数据
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param selectType 查询类型 0菜单,1按钮,空查询所有
|
||||
* @return 用户菜单
|
||||
*/
|
||||
List<Menu> findUserMenus(@Param("username") String username,
|
||||
@Param("selectType") Integer selectType);
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.UPayConfig;
|
||||
|
||||
/**
|
||||
* 收钱吧学校信息配置Mapper
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-03-20 17:53:13
|
||||
*/
|
||||
public interface UPayConfigMapper extends BaseMapper<UPayConfig> {
|
||||
|
||||
}
|
||||
-2
@@ -38,8 +38,6 @@ public interface UserMapper extends BaseMapper<SystemUser> {
|
||||
|
||||
SystemUser findUserByUsername(String username);
|
||||
|
||||
SystemUser findUserByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 获取代理商管理员账号详情
|
||||
*
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yida.data.common.core.entity.system.WhiteList;
|
||||
|
||||
/**
|
||||
* 白名单Mapper
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-02-20 14:15:49
|
||||
*/
|
||||
public interface WhiteListMapper extends BaseMapper<WhiteList> {
|
||||
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.BaiduApiConfig;
|
||||
|
||||
/**
|
||||
* 百度api配置信息 Service接口
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-20 20:42:47
|
||||
*/
|
||||
public interface BaiduApiConfigService extends IService<BaiduApiConfig> {
|
||||
}
|
||||
-21
@@ -1,7 +1,6 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.yida.data.common.core.entity.system.EduSysFile;
|
||||
import com.yida.data.school.vo.smart.WxConfigVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
public interface CommonService {
|
||||
@@ -11,24 +10,4 @@ public interface CommonService {
|
||||
String uploadImg(String code);
|
||||
|
||||
void saveReceiveMsg();
|
||||
|
||||
/**
|
||||
* 获取企业微信配置唤起扫码功能
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @param url 当前网页的URL,不包含#及其后面部分
|
||||
* @return com.yida.data.school.vo.smart.WxConfigVO
|
||||
* @author ZYJ
|
||||
* @date 2023/6/5 14:24
|
||||
*/
|
||||
WxConfigVO getWxJsConfig(Long deptId, String url);
|
||||
|
||||
/**
|
||||
* 获取微信配置唤起扫码功能
|
||||
*
|
||||
* @param deptId
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
WxConfigVO getWxPublicJsConfig(Long deptId, String url);
|
||||
}
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
|
||||
/**
|
||||
* 建行学校信息配置 Service接口
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-19 16:30:18
|
||||
*/
|
||||
public interface ConstructionPayConfigService extends IService<ConstructionPayConfig> {
|
||||
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.EduAppTemplate;
|
||||
|
||||
/**
|
||||
* 企业微信服务商代开发应用模板service
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3
|
||||
*/
|
||||
public interface EduAppTemplateService extends IService<EduAppTemplate> {
|
||||
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.EduBaseApp;
|
||||
|
||||
/**
|
||||
* 基础应用信息(本地配置) Service接口
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-28 14:57:58
|
||||
*/
|
||||
public interface EduBaseAppService extends IService<EduBaseApp> {
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.consume.EduConsumeConfig;
|
||||
|
||||
/**
|
||||
* 学校消费机服务器信息Service接口
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-04-06 17:31:11
|
||||
*/
|
||||
public interface EduConsumeConfigService extends IService<EduConsumeConfig> {
|
||||
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.EduDeptFunction;
|
||||
|
||||
/**
|
||||
* 部门对应的第三方系统功能Service接口
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-02-20 15:29:05
|
||||
*/
|
||||
public interface EduDeptFunctionService extends IService<EduDeptFunction> {
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
|
||||
/**
|
||||
* 企业微信服务商-学校密文corpId对照表service
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
public interface EduQywxServiceProviderSchoolService extends IService<EduQywxServiceProviderSchool> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
|
||||
/**
|
||||
* 企业微信服务商service
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3
|
||||
*/
|
||||
public interface EduQywxServiceProviderService extends IService<EduQywxServiceProvider> {
|
||||
|
||||
}
|
||||
+11
-12
@@ -108,8 +108,6 @@ public interface IDeptService extends IService<Dept> {
|
||||
|
||||
List getDeptTree(Long deptId, Integer type);
|
||||
|
||||
List getDeptTree(List<Long> deptIds);
|
||||
|
||||
Dept getParentById(Long deptId);
|
||||
|
||||
List<Long> listClassByDept(List<Long> ids);
|
||||
@@ -143,7 +141,7 @@ public interface IDeptService extends IService<Dept> {
|
||||
* 同步企业微信部门
|
||||
*/
|
||||
@Async(FebsConstant.ASYNC_POOL)
|
||||
void syncQywxDept(Long schoolId);
|
||||
void syncQywxDept();
|
||||
|
||||
/**
|
||||
* 处理挂在学校下的部门
|
||||
@@ -155,7 +153,7 @@ public interface IDeptService extends IService<Dept> {
|
||||
*
|
||||
* @param agentSchoolSelectPageDTO 查询代理商管理的学校列表数据请求类
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.baomidou.mybatisplus.core.metadata.IPage <
|
||||
* com.yida.data.system.vo.AgentSchoolVO>>
|
||||
* com.yida.data.system.vo.AgentSchoolVO>>
|
||||
* @author ZYJ
|
||||
* @date 2021/9/27 17:05
|
||||
*/
|
||||
@@ -195,10 +193,9 @@ public interface IDeptService extends IService<Dept> {
|
||||
void saveOrUpdateDeptSchool(SchoolInformationDTO information);
|
||||
|
||||
Page<SchoolInformationDTO> findSchoolListByDeptId(Long deptId, String schoolName, Integer schoolType,
|
||||
Integer natureType, String address, String tag, Page<SchoolInformationDTO> page, Integer schoolOwnership);
|
||||
Integer natureType, String address, String tag, Page<SchoolInformationDTO> page, Integer schoolOwnership);
|
||||
|
||||
Page<SchoolInformationDTO> findSchoolPageList(String schoolName, List<Integer> schoolType, List<Integer> natureType,
|
||||
Page<SchoolInformationDTO> page, String tag, Long deptId, List<Integer> schoolOwnership);
|
||||
Page<SchoolInformationDTO> findSchoolPageList(String schoolName, List<Integer> schoolType, List<Integer> natureType, Page<SchoolInformationDTO> page, String tag, Long deptId, List<Integer> schoolOwnership);
|
||||
|
||||
Page<SchoolInformationDTO> findSchoolByAddress(Page<SchoolInformationDTO> page, String address, Long deptId);
|
||||
|
||||
@@ -220,12 +217,14 @@ public interface IDeptService extends IService<Dept> {
|
||||
*/
|
||||
IPage<SchoolInformationDTO> listSchoolPage(SchoolPageDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 根据子部门查询父级IDList
|
||||
* 根据名称查询教育局缴费学校列表
|
||||
*
|
||||
* @param deptIds
|
||||
* @return
|
||||
* @param deptId 教育局或代理商id
|
||||
* @param schoolName 学校名称
|
||||
* @return java.util.List<com.yida.data.system.dto.SchoolInformationDTO>
|
||||
* @author ZYJ
|
||||
* @date 2023/8/30 14:21
|
||||
*/
|
||||
List<Dept> findParentDeptByChild(List<Long> deptIds);
|
||||
List<SchoolInformationDTO> listPaySchool(Long deptId, String schoolName);
|
||||
}
|
||||
|
||||
+2
-1
@@ -75,7 +75,8 @@ public interface IMenuService extends IService<Menu> {
|
||||
void deleteMeuns(String[] menuIds);
|
||||
|
||||
/**
|
||||
* 根据登录账号查询菜单数 角色相关菜单数据
|
||||
* 根据登录账号查询菜单数
|
||||
* 角色相关菜单数据
|
||||
*
|
||||
* @param username 登录账号
|
||||
* @return java.util.Map<java.lang.String, java.lang.Object>
|
||||
|
||||
-13
@@ -25,14 +25,6 @@ public interface IUserService extends IService<SystemUser> {
|
||||
*/
|
||||
SystemUser findByName(String username);
|
||||
|
||||
/**
|
||||
* 通过手机号查找用户
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @return 用户
|
||||
*/
|
||||
SystemUser findByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 查找用户详细信息
|
||||
*
|
||||
@@ -147,9 +139,4 @@ public interface IUserService extends IService<SystemUser> {
|
||||
* 更新用户的角色
|
||||
*/
|
||||
void updateUserRoleByRoleName(Long userId, List<String> roleNames);
|
||||
|
||||
/**
|
||||
* 获取企业微信用户授权后创建职工用户信息
|
||||
*/
|
||||
void createStaff(Long schoolId, String code);
|
||||
}
|
||||
+6
-13
@@ -5,7 +5,6 @@ import com.yida.data.system.dto.ListLogDTO;
|
||||
import com.yida.data.system.repository.LogEsRepository;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.search.sort.SortBuilders;
|
||||
import org.elasticsearch.search.sort.SortOrder;
|
||||
@@ -65,9 +64,8 @@ public class LogService {
|
||||
Pageable pageable = PageRequest.of(dto.getPageNum() - 1, dto.getPageSize());
|
||||
//封装查询条件
|
||||
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
|
||||
.withPageable(pageable)
|
||||
.withSort(SortBuilders.fieldSort("createDate").order(SortOrder.DESC));
|
||||
|
||||
.withPageable(pageable)
|
||||
.withSort(SortBuilders.fieldSort("createDate").order(SortOrder.DESC));
|
||||
//日志类型
|
||||
String logType = dto.getLogType();
|
||||
if (StringUtils.isNotBlank(logType)) {
|
||||
@@ -83,24 +81,19 @@ public class LogService {
|
||||
if (StringUtils.isNotBlank(method)) {
|
||||
queryBuilder.withQuery(QueryBuilders.matchQuery("method", method));
|
||||
}
|
||||
|
||||
//操作参数
|
||||
String operateParams = dto.getOperateParams();
|
||||
if (StringUtils.isNotBlank(operateParams)) {
|
||||
queryBuilder.withQuery(QueryBuilders.matchQuery("operateParams", operateParams));
|
||||
}
|
||||
//操作开始时间
|
||||
LocalDateTime startTime = dto.getStartTime();
|
||||
//操作结束时间
|
||||
LocalDateTime endTime = dto.getEndTime();
|
||||
if (Optional.ofNullable(startTime).isPresent()) {
|
||||
queryBuilder.withQuery(QueryBuilders.rangeQuery("createDate").gte(startTime.toInstant(
|
||||
ZoneOffset.of("+8")
|
||||
ZoneOffset.of("+8")
|
||||
).toEpochMilli()).lte(endTime.toInstant(
|
||||
ZoneOffset.of("+8")
|
||||
ZoneOffset.of("+8")
|
||||
).toEpochMilli()));
|
||||
}
|
||||
//查询列表数据
|
||||
return logEsRepository.search(queryBuilder.build());
|
||||
Page<Log> page = logEsRepository.search(queryBuilder.build().getQuery(), pageable);
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-13
@@ -8,17 +8,6 @@ public interface QywxCallbackService {
|
||||
|
||||
String get(String corpId, String msgSignature, String timestamp, String nonce, String echostr);
|
||||
|
||||
String post(String corpId, String msgSignature, String timestamp, String nonce, String body);
|
||||
|
||||
String getNormal(String corpId, String msgSignature, String timestamp, String nonce, String echostr);
|
||||
|
||||
String postNormal(String corpId, String msgSignature, String timestamp, String nonce, String body);
|
||||
|
||||
String getNormalCustomer(String providerCorpId, String corpId, String msgSignature, String timestamp, String nonce, String echostr);
|
||||
|
||||
String postNormalCustomer(String providerCorpId, String corpId, String msgSignature, String timestamp, String nonce, String body);
|
||||
|
||||
String getEvent(String providerCorpId, String corpId, String msgSignature, String timestamp, String nonce, String echostr);
|
||||
|
||||
String postEvent(String providerCorpId, String corpId, String msgSignature, String timestamp, String nonce, String body);
|
||||
@Async(PoolConstant.QYWX_CALL_POOL)
|
||||
void post(String corpId, String msgSignature, String timestamp, String nonce, String body);
|
||||
}
|
||||
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.yida.data.system.dto.QywxCallbackHandleDTO;
|
||||
|
||||
/**
|
||||
* 企业微信回调mq处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/10/27 16:42
|
||||
*/
|
||||
public interface QywxHandleService {
|
||||
|
||||
/**
|
||||
* 处理企业微信自开发回调信息
|
||||
*
|
||||
* @param dto 企业微信回调处理类
|
||||
* @author ZYJ
|
||||
* @date 2023/10/27 16:49
|
||||
*/
|
||||
void handlePostCallback(QywxCallbackHandleDTO dto);
|
||||
|
||||
/**
|
||||
* 处理企业微信代开发应用模板回调信息
|
||||
*
|
||||
* @param dto 企业微信回调处理类
|
||||
* @author ZYJ
|
||||
* @date 2023/10/27 16:54
|
||||
*/
|
||||
void handlePostNormalCallback(QywxCallbackHandleDTO dto);
|
||||
|
||||
/**
|
||||
* 处理企业微信代开发应用回调信息
|
||||
*
|
||||
* @param dto 企业微信回调处理类
|
||||
* @author ZYJ
|
||||
* @date 2023/10/27 16:54
|
||||
*/
|
||||
void handlePostEventCallback(QywxCallbackHandleDTO dto);
|
||||
}
|
||||
-10
@@ -4,7 +4,6 @@ import com.yida.data.common.core.entity.CurrentUser;
|
||||
import com.yida.data.common.core.entity.constant.FebsConstant;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
|
||||
import com.yida.data.common.core.entity.system.EduApp;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
public interface QywxService {
|
||||
@@ -42,7 +41,6 @@ public interface QywxService {
|
||||
* @param deptId
|
||||
* @param school
|
||||
*/
|
||||
// @Async(FebsConstant.ASYNC_POOL)
|
||||
void createSchoolDept(String corpId, String accessToken, Long deptId, Dept school);
|
||||
|
||||
/**
|
||||
@@ -52,7 +50,6 @@ public interface QywxService {
|
||||
* @param deptId
|
||||
* @param school
|
||||
*/
|
||||
// @Async(FebsConstant.ASYNC_POOL)
|
||||
void updateSchoolDept(String accessToken, Long deptId, Dept school);
|
||||
|
||||
/**
|
||||
@@ -72,7 +69,6 @@ public interface QywxService {
|
||||
* @param order
|
||||
* @param school
|
||||
*/
|
||||
// @Async(FebsConstant.ASYNC_POOL)
|
||||
void createDept(String deptId, String deptName, String parentId, String order, Dept school);
|
||||
|
||||
/**
|
||||
@@ -83,7 +79,6 @@ public interface QywxService {
|
||||
* @param parentId
|
||||
* @param schoolId
|
||||
*/
|
||||
// @Async(FebsConstant.ASYNC_POOL)
|
||||
void updateDept(String deptId, String deptName, String parentId, Long schoolId);
|
||||
|
||||
/**
|
||||
@@ -176,9 +171,4 @@ public interface QywxService {
|
||||
* 家长关注事件
|
||||
*/
|
||||
void sendParentSubscribeMessage(String parentId, Long schoolId);
|
||||
|
||||
/**
|
||||
* 修改职工部门信息
|
||||
*/
|
||||
void updateUserInfo(String userId, Dept school, EduApp app);
|
||||
}
|
||||
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* 企业微信服务商处理方法service
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3
|
||||
*/
|
||||
public interface QywxServiceProviderService {
|
||||
|
||||
/**
|
||||
* 授权安装模板应用
|
||||
*
|
||||
* @param suiteId 模板id
|
||||
* @param authCode 临时授权码
|
||||
* @param serviceProvider 企业微信服务商信息
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3 16:22
|
||||
*/
|
||||
void installTemplateApp(String suiteId, String authCode, EduQywxServiceProvider serviceProvider);
|
||||
|
||||
/**
|
||||
* 处理服务商代开发应用模板ticket值
|
||||
*
|
||||
* @param suiteId 模板id
|
||||
* @param suiteTicket ticket值
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3 11:13
|
||||
*/
|
||||
void handleTemplateSuiteTicket(String suiteId, String suiteTicket);
|
||||
|
||||
/**
|
||||
* 客户删除应用
|
||||
*
|
||||
* @param suiteId 模板id
|
||||
* @param authCorpId 授权企业微信id
|
||||
* @param serviceProvider 企业微信服务商信息
|
||||
* @author ZYJ
|
||||
* @date 2022/11/11 14:26
|
||||
*/
|
||||
void deleteTemplateApp(String suiteId, String authCorpId, EduQywxServiceProvider serviceProvider);
|
||||
|
||||
/**
|
||||
* 代开发应用重置secret
|
||||
*
|
||||
* @param suiteId 模板id
|
||||
* @param resetAuthCode 临时授权码
|
||||
* @param serviceProvider 企业微信服务商信息
|
||||
* @author ZYJ
|
||||
* @date 2022/11/11 16:01
|
||||
*/
|
||||
void resetTemplateAppAuthCode(String suiteId, String resetAuthCode, EduQywxServiceProvider serviceProvider);
|
||||
|
||||
/**
|
||||
* 处理通讯录事件
|
||||
* 通讯录授权编辑回调
|
||||
*
|
||||
* @param root xml明文
|
||||
* @param serviceProvider 企业微信服务商信息
|
||||
* @param suiteId 模板id
|
||||
* @author ZYJ
|
||||
* @date 2022/11/21 16:10
|
||||
*/
|
||||
// @Async
|
||||
void handleConcat(Element root, EduQywxServiceProvider serviceProvider, String suiteId);
|
||||
|
||||
/**
|
||||
* 处理通讯录事件
|
||||
* 家校沟通应用回调
|
||||
*
|
||||
* @param root xml明文
|
||||
* @param providerSchool 企业微信服务商-学校密文
|
||||
* @author ZYJ
|
||||
* @date 2023/2/24 15:59
|
||||
*/
|
||||
void handleConcat(Element root, EduQywxServiceProviderSchool providerSchool);
|
||||
|
||||
/**
|
||||
* 处理家校沟通通讯录事件
|
||||
*
|
||||
* @param root xml明文
|
||||
* @param providerSchool 企业微信服务商-学校密文corpId
|
||||
* @param school 学校信息
|
||||
* @author ZYJ
|
||||
* @date 2022/12/6 10:57
|
||||
*/
|
||||
void handleSchoolConcat(Element root, EduQywxServiceProviderSchool providerSchool, Dept school);
|
||||
|
||||
/**
|
||||
* 加密对应服务商的学校corpId
|
||||
*
|
||||
* @param providerCorpId 服务商企业微信id
|
||||
* @param corpId 学校企业微信id
|
||||
* @author ZYJ
|
||||
* @date 2023/1/14 15:02
|
||||
*/
|
||||
void changeCorpId(String providerCorpId, String corpId);
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.UPayConfig;
|
||||
|
||||
/**
|
||||
* 收钱吧学校信息配置Service接口
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-03-20 17:53:13
|
||||
*/
|
||||
public interface UPayConfigService extends IService<UPayConfig> {
|
||||
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package com.yida.data.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yida.data.common.core.entity.system.WhiteList;
|
||||
|
||||
/**
|
||||
* 白名单Service接口
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-02-20 14:15:49
|
||||
*/
|
||||
public interface WhiteListService extends IService<WhiteList> {
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.system.BaiduApiConfig;
|
||||
import com.yida.data.system.mapper.BaiduApiConfigMapper;
|
||||
import com.yida.data.system.service.BaiduApiConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 百度api配置信息 Service实现
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-20 20:42:47
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
|
||||
public class BaiduApiConfigServiceImpl extends ServiceImpl
|
||||
<BaiduApiConfigMapper, BaiduApiConfig> implements BaiduApiConfigService {
|
||||
|
||||
|
||||
}
|
||||
+1
-90
@@ -1,45 +1,27 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import cc.mrbird.febs.common.redis.service.RedisService;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.yida.data.common.core.entity.ReceiveMsg;
|
||||
import com.yida.data.common.core.entity.constant.AppConstant;
|
||||
import com.yida.data.common.core.entity.constant.CachePrefixConstant;
|
||||
import com.yida.data.common.core.entity.system.*;
|
||||
import com.yida.data.common.core.exception.FebsException;
|
||||
import com.yida.data.common.core.entity.system.EduSysFile;
|
||||
import com.yida.data.common.core.utils.FileUtil;
|
||||
import com.yida.data.common.core.utils.WxPublicUtil;
|
||||
import com.yida.data.common.core.utils.WxUtil;
|
||||
import com.yida.data.school.vo.smart.WxConfigVO;
|
||||
import com.yida.data.system.mapper.EduSysFileMapper;
|
||||
import com.yida.data.system.repository.ReceiveMsgRepository;
|
||||
import com.yida.data.system.service.CommonService;
|
||||
import com.yida.data.system.service.IDeptService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@Service
|
||||
@RefreshScope
|
||||
@@ -47,14 +29,8 @@ import java.util.TreeMap;
|
||||
@RequiredArgsConstructor
|
||||
public class CommonServiceImpl implements CommonService {
|
||||
|
||||
private final IDeptService deptService;
|
||||
|
||||
private final EduSysFileMapper eduSysFileMapper;
|
||||
private final ReceiveMsgRepository receiveMsgRepository;
|
||||
private final com.yida.data.common.service.CommonService commonService;
|
||||
|
||||
private final WxUtil wxUtil;
|
||||
private final WxPublicUtil wxPublicUtil;
|
||||
private final RedisService redisService;
|
||||
|
||||
@Value("${febs.uploadUrl}")
|
||||
@@ -147,69 +123,4 @@ public class CommonServiceImpl implements CommonService {
|
||||
log.info("保存{}条接收数据", saveSize);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxConfigVO getWxJsConfig(Long deptId, String url) {
|
||||
Dept dept = deptService.getById(deptId);
|
||||
if (Objects.isNull(dept)) {
|
||||
throw new FebsException("当前学校配置信息错误!");
|
||||
}
|
||||
// 获取应用信息
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT_SELECT, null, deptId);
|
||||
String jsApiTicket = wxUtil.getJsApiTicket(wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret()), deptId);
|
||||
// 时间戳
|
||||
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
|
||||
// 随机字符串
|
||||
String nonceStr = RandomUtil.randomString(32);
|
||||
|
||||
// 请求参数
|
||||
JSONObject jsonObject = JSONUtil.createObj()
|
||||
.set("jsapi_ticket", jsApiTicket)
|
||||
.set("timestamp", timestamp)
|
||||
.set("noncestr", nonceStr)
|
||||
.set("url", url);
|
||||
TreeMap<String, Object> paramMap = MapUtil.sort(jsonObject);
|
||||
// 处理请求参数
|
||||
String paramsStr = Joiner.on("&").withKeyValueSeparator("=").join(paramMap);
|
||||
// 签名
|
||||
String signature = SecureUtil.sha1(paramsStr);
|
||||
return WxConfigVO.builder()
|
||||
.appId(dept.getCorpId())
|
||||
.timestamp(timestamp)
|
||||
.nonceStr(nonceStr)
|
||||
.signature(signature)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxConfigVO getWxPublicJsConfig(Long deptId, String url) {
|
||||
|
||||
Dept dept = deptService.getById(deptId);
|
||||
if (Objects.isNull(dept)) {
|
||||
throw new FebsException("当前学校配置信息错误!");
|
||||
}
|
||||
String jsApiTicket = wxPublicUtil.getJsApiTicket(dept.getWxPublicAppId(), dept.getWxPublicSecret());
|
||||
// 时间戳
|
||||
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
|
||||
// 随机字符串
|
||||
String nonceStr = RandomUtil.randomString(32);
|
||||
|
||||
// 请求参数
|
||||
JSONObject jsonObject = JSONUtil.createObj()
|
||||
.set("jsapi_ticket", jsApiTicket)
|
||||
.set("timestamp", timestamp)
|
||||
.set("noncestr", nonceStr)
|
||||
.set("url", url);
|
||||
TreeMap<String, Object> paramMap = MapUtil.sort(jsonObject);
|
||||
// 处理请求参数
|
||||
String paramsStr = Joiner.on("&").withKeyValueSeparator("=").join(paramMap);
|
||||
// 签名
|
||||
String signature = SecureUtil.sha1(paramsStr);
|
||||
return WxConfigVO.builder()
|
||||
.appId(dept.getWxPublicAppId())
|
||||
.timestamp(timestamp)
|
||||
.nonceStr(nonceStr)
|
||||
.signature(signature)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
|
||||
import com.yida.data.system.mapper.ConstructionPayConfigMapper;
|
||||
import com.yida.data.system.service.ConstructionPayConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 建行学校信息配置 Service实现
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-19 16:30:18
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ConstructionPayConfigServiceImpl extends ServiceImpl
|
||||
<ConstructionPayConfigMapper, ConstructionPayConfig> implements ConstructionPayConfigService {
|
||||
|
||||
|
||||
}
|
||||
+10
-8
@@ -29,18 +29,20 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class DeptSchoolInformationServiceImpl extends ServiceImpl<DeptSchoolInformationMapper, DeptSchoolInformation>
|
||||
implements DeptSchoolInformationService {
|
||||
implements DeptSchoolInformationService {
|
||||
|
||||
private final DeptSchoolLabelService labelService;
|
||||
private final CommonService commonService;
|
||||
|
||||
@Override
|
||||
public Page<SchoolInformationDTO> findSchoolListByDeptId(Long deptId, String schoolName, Integer schoolType,
|
||||
Integer natureType, String address, String tag, Page<SchoolInformationDTO> page,
|
||||
Integer schoolOwnership) {
|
||||
Page<SchoolInformationDTO> schoolListByDeptId = baseMapper.findSchoolListByDeptId(deptId, schoolName, schoolType, natureType, address, tag, page, schoolOwnership);
|
||||
Integer natureType, String address, String tag, Page<SchoolInformationDTO> page,
|
||||
Integer schoolOwnership) {
|
||||
Page<SchoolInformationDTO> schoolListByDeptId = baseMapper
|
||||
.findSchoolListByDeptId(deptId, schoolName, schoolType, natureType, address, tag, page, schoolOwnership);
|
||||
for (SchoolInformationDTO record : schoolListByDeptId.getRecords()) {
|
||||
List<DeptSchoolLabel> list = labelService.list(Wrappers.query(new DeptSchoolLabel()).lambda().eq(DeptSchoolLabel::getDeptSchoolId, record.getId()));
|
||||
List<DeptSchoolLabel> list = labelService
|
||||
.list(Wrappers.query(new DeptSchoolLabel()).lambda().eq(DeptSchoolLabel::getDeptSchoolId, record.getId()));
|
||||
List<String> tagList = new ArrayList<>();
|
||||
for (DeptSchoolLabel deptSchoolLabel : list) {
|
||||
tagList.add(deptSchoolLabel.getLabel());
|
||||
@@ -51,8 +53,9 @@ public class DeptSchoolInformationServiceImpl extends ServiceImpl<DeptSchoolInfo
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SchoolInformationDTO> findSchoolPageList(String schoolName, List<Integer> schoolType, List<Integer> natureType, Page<SchoolInformationDTO> page,
|
||||
String[] tags, Long deptId, List<Integer> schoolOwnership) {
|
||||
public Page<SchoolInformationDTO> findSchoolPageList(String schoolName, List<Integer> schoolType, List<Integer> natureType,
|
||||
Page<SchoolInformationDTO> page,
|
||||
String[] tags, Long deptId, List<Integer> schoolOwnership) {
|
||||
List<Long> deptSchoolId = new ArrayList<>();
|
||||
if (tags != null && tags.length > 0) {
|
||||
deptSchoolId = baseMapper.findDeptSchoolId(tags);
|
||||
@@ -65,7 +68,6 @@ public class DeptSchoolInformationServiceImpl extends ServiceImpl<DeptSchoolInfo
|
||||
|
||||
@Override
|
||||
public Page<SchoolInformationDTO> findSchoolByAddress(Page<SchoolInformationDTO> page, String address, Long deptId) {
|
||||
|
||||
return baseMapper.findSchoolByAddress(page, address, deptId);
|
||||
}
|
||||
|
||||
|
||||
+154
-200
@@ -24,7 +24,6 @@ import com.yida.data.common.core.entity.system.*;
|
||||
import com.yida.data.common.core.entity.system.enums.DeptTypeEnum;
|
||||
import com.yida.data.common.core.entity.system.enums.RoleEnum;
|
||||
import com.yida.data.common.core.entity.system.enums.UserStatusEnum;
|
||||
import com.yida.data.common.core.entity.user.enums.DeptVisibleTypeEnum;
|
||||
import com.yida.data.common.core.enums.EnableStatusEnum;
|
||||
import com.yida.data.common.core.exception.FebsException;
|
||||
import com.yida.data.common.core.utils.*;
|
||||
@@ -34,6 +33,7 @@ import com.yida.data.system.dto.AgentSchoolSelectPageDTO;
|
||||
import com.yida.data.system.dto.SchoolInformationDTO;
|
||||
import com.yida.data.system.dto.SchoolPageDTO;
|
||||
import com.yida.data.system.mapper.DeptMapper;
|
||||
import com.yida.data.system.mapper.DeptSchoolInformationMapper;
|
||||
import com.yida.data.system.mapper.DeptSchoolRelateMapper;
|
||||
import com.yida.data.system.mapper.EduAppMapper;
|
||||
import com.yida.data.system.service.*;
|
||||
@@ -70,7 +70,6 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
private final EduAppAccountService eduAppAccountService;
|
||||
private final CommonService commonService;
|
||||
private final EduPayWxConfigService eduPayWxConfigService;
|
||||
private final EduAgentSchoolRelateService eduAgentSchoolRelateService;
|
||||
private final IUserService userService;
|
||||
private final RedisService redisService;
|
||||
private final DeptSchoolRelateMapper deptSchoolRelateMapper;
|
||||
@@ -82,13 +81,15 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
private final DeptSchoolInformationService schoolInformationService;
|
||||
private final DeptSchoolInformationNatureService natureService;
|
||||
|
||||
private final DeptSchoolInformationMapper deptSchoolInformationMapper;
|
||||
|
||||
@Override
|
||||
public Dept getSchoolDeptByDeptAndWx(List<Long> deptId, Long wxId) {
|
||||
Dept exist = getOne(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId).eq(Dept::getWxId,
|
||||
wxId).ne(Dept::getDeptType, 6));
|
||||
wxId).ne(Dept::getDeptType, 6));
|
||||
if (exist == null) {
|
||||
List<Dept> deptList =
|
||||
list(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId).ne(Dept::getDeptType, 6));
|
||||
list(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId).ne(Dept::getDeptType, 6));
|
||||
if (CollUtil.isNotEmpty(deptList)) {
|
||||
List<Long> deptIds = deptList.stream().map(x -> x.getDeptId()).collect(Collectors.toList());
|
||||
exist = getSchoolDeptByDeptAndWx(deptIds, wxId);
|
||||
@@ -100,13 +101,12 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
@Override
|
||||
public Dept getSysDeptByDeptAndWx(List<Long> deptId, Long wxId) {
|
||||
Dept exist = getOne(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId).eq(Dept::getWxId,
|
||||
wxId).eq(Dept::getDeptType, DeptTypeEnum.DEPARTMENT_TYPE.getValue()));
|
||||
wxId).eq(Dept::getDeptType, 6));
|
||||
if (exist == null) {
|
||||
List<Dept> deptList =
|
||||
list(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId)
|
||||
.eq(Dept::getDeptType, DeptTypeEnum.DEPARTMENT_TYPE.getValue()));
|
||||
list(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId).eq(Dept::getDeptType, 6));
|
||||
if (CollUtil.isNotEmpty(deptList)) {
|
||||
List<Long> deptIds = deptList.stream().map(Dept::getDeptId).collect(Collectors.toList());
|
||||
List<Long> deptIds = deptList.stream().map(x -> x.getDeptId()).collect(Collectors.toList());
|
||||
exist = getSysDeptByDeptAndWx(deptIds, wxId);
|
||||
}
|
||||
}
|
||||
@@ -135,9 +135,9 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
} else {
|
||||
// 查询下级部门信息
|
||||
List<Long> childIdList = findListByParent(Collections.singletonList(currentUser.getDeptId()), 0)
|
||||
.stream().map(Dept::getDeptId).collect(Collectors.toList());
|
||||
.stream().map(Dept::getDeptId).collect(Collectors.toList());
|
||||
if (RoleEnum.ROLE_EDUCATION_PRINCIPAL.equals(roleEnum) ||
|
||||
RoleEnum.ROLE_AGENT_ADMIN.equals(roleEnum)) {
|
||||
RoleEnum.ROLE_AGENT_ADMIN.equals(roleEnum)) {
|
||||
childIdList.add(currentUser.getDeptId());
|
||||
}
|
||||
// 具有创建账号的数据 自己创建的账号+当前登陆账号部门以下的账号
|
||||
@@ -155,7 +155,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
List<Dept> res = new ArrayList<>();
|
||||
// 查询直接子部门
|
||||
LambdaQueryWrapper<Dept> condition = Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId)
|
||||
.orderByDesc(Dept::getOrderNum);
|
||||
.orderByDesc(Dept::getOrderNum);
|
||||
// if (type != null) {
|
||||
// if (type == 1) {
|
||||
// condition.ne(Dept::getDeptType, 6);
|
||||
@@ -187,12 +187,12 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
@Override
|
||||
public List<Dept> findChildByParentAndType(List<Long> deptId, Integer type) {
|
||||
List<Dept> res = list(Wrappers.<Dept>lambdaQuery().in(Dept::getParentId, deptId).eq(Dept::getDeptType, type)
|
||||
.orderByDesc(Dept::getOrderNum));
|
||||
.orderByDesc(Dept::getOrderNum));
|
||||
if (CollUtil.isEmpty(res)) {
|
||||
List<Dept> child = list(Wrappers.<Dept>lambdaQuery().in(Dept::getParentId, deptId));
|
||||
if (CollUtil.isNotEmpty(child)) {
|
||||
res = findChildByParentAndType(child.stream().map(x -> x.getDeptId()).collect(Collectors.toList()),
|
||||
type);
|
||||
type);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
@@ -220,8 +220,8 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
private Dept findSchoolOrEducationByDept(Long deptId) {
|
||||
Dept now = this.baseMapper.selectById(deptId);
|
||||
if (now != null &&
|
||||
(DeptTypeEnum.SCHOOL_TYPE.getValue().equals(now.getDeptType())
|
||||
|| DeptTypeEnum.EDUCATION_DEPT_TYPE.getValue().equals(now.getDeptType()))) {
|
||||
(DeptTypeEnum.SCHOOL_TYPE.getValue().equals(now.getDeptType())
|
||||
|| DeptTypeEnum.EDUCATION_DEPT_TYPE.getValue().equals(now.getDeptType()))) {
|
||||
return now;
|
||||
} else if (now != null) {
|
||||
return findSchoolOrEducationByDept(now.getParentId());
|
||||
@@ -275,10 +275,10 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
deptList.forEach(x -> {
|
||||
// 教育局、代理商查询对应的关联学校信息
|
||||
if (DeptTypeEnum.EDUCATION_DEPT_TYPE.getValue().equals(x.getDeptType()) ||
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(x.getDeptType())) {
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(x.getDeptType())) {
|
||||
x.setRelationSchoolList(this.deptSchoolRelateMapper.selectList(Wrappers.lambdaQuery(new DeptSchoolRelate())
|
||||
.eq(DeptSchoolRelate::getDeptId, x.getDeptId())).stream().map(DeptSchoolRelate::getSchoolId)
|
||||
.collect(Collectors.toList()));
|
||||
.eq(DeptSchoolRelate::getDeptId, x.getDeptId())).stream().map(DeptSchoolRelate::getSchoolId)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
return deptList;
|
||||
@@ -322,11 +322,13 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
Dept parent = findSchoolOrEducationByDept(dept.getParentId());
|
||||
// 挂在学校的部门需要同步企业微信
|
||||
if (parent != null && DeptTypeEnum.SCHOOL_TYPE.getValue().equals(parent.getDeptType())
|
||||
&& parent.getSchoolType().contains(Dept.TYPE_QYWX)
|
||||
&& dept.getWxId() == null) {
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT, null, parent.getDeptId());
|
||||
&& parent.getSchoolType().contains(Dept.TYPE_QYWX)
|
||||
&& dept.getWxId() == null) {
|
||||
EduApp app = eduAppMapper.selectOne(Wrappers.lambdaQuery(new EduApp()).eq(EduApp::getDeptId,
|
||||
parent.getDeptId()).eq(EduApp::getName, AppConstant.CONTACT));
|
||||
if (app != null) {
|
||||
Long wxId = wxUtil.createDept(commonService.getAddressListToken(app.getDeptId()), dept);
|
||||
Long wxId = wxUtil.createDept(wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret()),
|
||||
dept);
|
||||
dept.setWxId(wxId);
|
||||
}
|
||||
}
|
||||
@@ -339,19 +341,19 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
dept.setYidaAppColId(colId);
|
||||
}
|
||||
} else if (DeptTypeEnum.EDUCATION_DEPT_TYPE.getValue().equals(dept.getDeptType()) &&
|
||||
StrUtil.isNotBlank(dept.getSchoolType()) && dept.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
StrUtil.isNotBlank(dept.getSchoolType()) && dept.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
dept.setYidaAppColId(yidaApp.getAppColId());
|
||||
}
|
||||
this.save(dept);
|
||||
// 创建绑定易达的学校
|
||||
if (DeptTypeEnum.SCHOOL_TYPE.getValue().equals(dept.getDeptType())
|
||||
&& StrUtil.isNotBlank(dept.getSchoolType())
|
||||
&& dept.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
&& StrUtil.isNotBlank(dept.getSchoolType())
|
||||
&& dept.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
// 保存学校栏目到区域位下
|
||||
List<Dept> list = list(Wrappers.lambdaQuery(new Dept())
|
||||
.eq(Dept::getDeptType, 0)
|
||||
.eq(Dept::getYidaAppId, yidaApp.getId())
|
||||
.like(Dept::getSchoolType, Dept.TYPE_YIDA_APP));
|
||||
.eq(Dept::getDeptType, 0)
|
||||
.eq(Dept::getYidaAppId, yidaApp.getId())
|
||||
.like(Dept::getSchoolType, Dept.TYPE_YIDA_APP));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
JSONArray content = new JSONArray();
|
||||
for (Dept col : list) {
|
||||
@@ -363,8 +365,8 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
}});
|
||||
}
|
||||
String regionId = AppUtil.regionUpdate(yidaApp.getAppSchoolRegionId(), "热门学校", 0,
|
||||
yidaApp.getAppColId(),
|
||||
AppUtil.REGION_TYPE_HOT, content, yidaApp);
|
||||
yidaApp.getAppColId(),
|
||||
AppUtil.REGION_TYPE_HOT, content, yidaApp);
|
||||
if (StrUtil.isBlank(yidaApp.getAppSchoolRegionId())) {
|
||||
yidaApp.setAppSchoolRegionId(regionId);
|
||||
eduYidaAppService.updateById(yidaApp);
|
||||
@@ -382,22 +384,20 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
eduAppAccountService.save(appAccount);
|
||||
}
|
||||
} else if (DeptTypeEnum.EDUCATION_DEPT_TYPE.getValue().equals(dept.getDeptType()) ||
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(dept.getDeptType())) {
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(dept.getDeptType())) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
if (CollUtil.isNotEmpty(dept.getRelationSchoolList())) {
|
||||
// 处理关联学校数据
|
||||
dept.getRelationSchoolList().forEach(schoolId -> {
|
||||
DeptSchoolRelate deptSchoolRelate = DeptSchoolRelate.builder()
|
||||
.deptId(dept.getDeptId())
|
||||
.createDeptId(currentUser.getDeptId())
|
||||
.createId(currentUser.getUserId())
|
||||
.createDate(LocalDateTime.now())
|
||||
.schoolId(schoolId)
|
||||
.build();
|
||||
.deptId(dept.getDeptId())
|
||||
.createDeptId(currentUser.getDeptId())
|
||||
.createId(currentUser.getUserId())
|
||||
.createDate(LocalDateTime.now())
|
||||
.schoolId(schoolId)
|
||||
.build();
|
||||
this.deptSchoolRelateMapper.insert(deptSchoolRelate);
|
||||
List<DeptSchoolInformation> list = schoolInformationService.list(
|
||||
Wrappers.query(new DeptSchoolInformation()).lambda()
|
||||
.eq(DeptSchoolInformation::getSchoolId, deptSchoolRelate.getSchoolId()));
|
||||
List<DeptSchoolInformation> list = schoolInformationService.list(Wrappers.query(new DeptSchoolInformation()).lambda().eq(DeptSchoolInformation::getSchoolId, deptSchoolRelate.getSchoolId()));
|
||||
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
DeptSchoolInformation deptSchoolInformation = new DeptSchoolInformation();
|
||||
@@ -457,9 +457,9 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
dept.setYidaAppColId(colId);
|
||||
// 保存栏目到订阅号下
|
||||
List<Dept> list = list(Wrappers.lambdaQuery(new Dept())
|
||||
.eq(Dept::getDeptType, 0)
|
||||
.like(Dept::getSchoolType, Dept.TYPE_YIDA_APP)
|
||||
.eq(Dept::getYidaAppId, original.getYidaAppId()));
|
||||
.eq(Dept::getDeptType, 0)
|
||||
.like(Dept::getSchoolType, Dept.TYPE_YIDA_APP)
|
||||
.eq(Dept::getYidaAppId, original.getYidaAppId()));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
JSONArray content = new JSONArray();
|
||||
for (Dept col : list) {
|
||||
@@ -471,8 +471,8 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
}});
|
||||
}
|
||||
String regionId = AppUtil.regionUpdate(yidaApp.getAppSchoolRegionId(), "热门学校", 0,
|
||||
yidaApp.getAppColId(),
|
||||
AppUtil.REGION_TYPE_HOT, content, yidaApp);
|
||||
yidaApp.getAppColId(),
|
||||
AppUtil.REGION_TYPE_HOT, content, yidaApp);
|
||||
|
||||
if (StrUtil.isBlank(yidaApp.getAppSchoolRegionId())) {
|
||||
yidaApp.setAppSchoolRegionId(regionId);
|
||||
@@ -492,9 +492,9 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
// }
|
||||
for (int i = 0; i < 2; i++) {
|
||||
EduYidaAppAccount appAccount = eduAppAccountService
|
||||
.getOne(Wrappers.lambdaQuery(new EduYidaAppAccount())
|
||||
.eq(EduYidaAppAccount::getSchoolId, dept.getDeptId())
|
||||
.eq(EduYidaAppAccount::getType, i));
|
||||
.getOne(Wrappers.lambdaQuery(new EduYidaAppAccount())
|
||||
.eq(EduYidaAppAccount::getSchoolId, dept.getDeptId())
|
||||
.eq(EduYidaAppAccount::getType, i));
|
||||
if (appAccount == null) {
|
||||
appAccount = new EduYidaAppAccount();
|
||||
}
|
||||
@@ -512,23 +512,24 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
Dept parent = findSchoolOrEducationByDept(dept.getParentId());
|
||||
// 挂在学校的部门需要同步企业微信
|
||||
if (Objects.nonNull(parent) && DeptTypeEnum.SCHOOL_TYPE.getValue().equals(parent.getDeptType())
|
||||
&& parent.getSchoolType().contains(Dept.TYPE_QYWX)) {
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT, null, parent.getDeptId());
|
||||
&& parent.getSchoolType().contains(Dept.TYPE_QYWX)) {
|
||||
EduApp app = eduAppMapper.selectOne(Wrappers.lambdaQuery(new EduApp()).eq(EduApp::getDeptId,
|
||||
parent.getDeptId()).eq(EduApp::getName, AppConstant.CONTACT));
|
||||
if (app != null) {
|
||||
dept.setWxId(original.getWxId());
|
||||
wxUtil.updateDept(commonService.getAddressListToken(app.getDeptId()), dept);
|
||||
wxUtil.updateDept(wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret()), dept);
|
||||
}
|
||||
}
|
||||
} else if (DeptTypeEnum.EDUCATION_DEPT_TYPE.getValue().equals(dept.getDeptType()) ||
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(dept.getDeptType())) {
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(dept.getDeptType())) {
|
||||
// 教育局、代理商
|
||||
if (DeptTypeEnum.AGENT_TYPE.getValue().equals(dept.getDeptType()) &&
|
||||
CollectionUtils.isEmpty(dept.getRelationSchoolList())) {
|
||||
CollectionUtils.isEmpty(dept.getRelationSchoolList())) {
|
||||
throw new FebsException("请选择关联的学校");
|
||||
}
|
||||
// 删除关联学校数据
|
||||
this.deptSchoolRelateMapper.delete(Wrappers.lambdaQuery(new DeptSchoolRelate())
|
||||
.eq(DeptSchoolRelate::getDeptId, dept.getDeptId()));
|
||||
.eq(DeptSchoolRelate::getDeptId, dept.getDeptId()));
|
||||
// 绑定了易达app
|
||||
if (StrUtil.isNotBlank(dept.getSchoolType()) && dept.getSchoolType().contains(Dept.TYPE_YIDA_APP)) {
|
||||
// 设置教育局栏目id
|
||||
@@ -539,17 +540,15 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
// 处理关联学校数据
|
||||
dept.getRelationSchoolList().forEach(schoolId -> {
|
||||
DeptSchoolRelate deptSchoolRelate = DeptSchoolRelate.builder()
|
||||
.deptId(original.getDeptId())
|
||||
.createDeptId(currentUser.getDeptId())
|
||||
.createId(currentUser.getUserId())
|
||||
.createDate(LocalDateTime.now())
|
||||
.schoolId(schoolId)
|
||||
.build();
|
||||
.deptId(original.getDeptId())
|
||||
.createDeptId(currentUser.getDeptId())
|
||||
.createId(currentUser.getUserId())
|
||||
.createDate(LocalDateTime.now())
|
||||
.schoolId(schoolId)
|
||||
.build();
|
||||
this.deptSchoolRelateMapper.insert(deptSchoolRelate);
|
||||
//关联关系表学校放入学校信息表
|
||||
List<DeptSchoolInformation> list = schoolInformationService.list(
|
||||
Wrappers.query(new DeptSchoolInformation()).lambda()
|
||||
.eq(DeptSchoolInformation::getSchoolId, deptSchoolRelate.getSchoolId()));
|
||||
List<DeptSchoolInformation> list = schoolInformationService.list(Wrappers.query(new DeptSchoolInformation()).lambda().eq(DeptSchoolInformation::getSchoolId, deptSchoolRelate.getSchoolId()));
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
DeptSchoolInformation deptSchoolInformation = new DeptSchoolInformation();
|
||||
deptSchoolInformation.setSchoolName(getById(schoolId).getDeptName());
|
||||
@@ -569,60 +568,60 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
public void deleteDepts(String[] deptIds) {
|
||||
// 删除企业微信部门信息
|
||||
List<Dept> deptList =
|
||||
list(Wrappers.lambdaQuery(new Dept()).in(Dept::getDeptId, deptIds).notIn(Dept::getDeptType
|
||||
, 0, 5));
|
||||
list(Wrappers.lambdaQuery(new Dept()).in(Dept::getDeptId, deptIds).notIn(Dept::getDeptType
|
||||
, 0, 5));
|
||||
for (Dept dept : deptList) {
|
||||
Dept school = findSchooleByDept(dept.getDeptId());
|
||||
// 绑定了微信
|
||||
if (Objects.nonNull(school) && school.getSchoolType().contains(Dept.TYPE_QYWX)) {
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT, null,
|
||||
school.getDeptId());
|
||||
EduApp app = commonService.getAppByCodeAndSchool(dept.getDeptType() == 6 ? "通讯录" : "家校沟通", null,
|
||||
school.getDeptId());
|
||||
// 同步删除企业微信部门
|
||||
if (dept.getDeptType() == 6) {
|
||||
wxUtil.deleteDept(commonService.getAddressListToken(school.getDeptId()), dept.getWxId());
|
||||
wxUtil.deleteDept(wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret()), dept.getWxId());
|
||||
}
|
||||
}
|
||||
// 绑定了大华
|
||||
if (Objects.nonNull(school) && school.getSchoolType().contains(Dept.TYPE_DAHUA)) {
|
||||
DaHuaUtil.delDept(Collections.singletonList(dept.getDahuaId()));
|
||||
DaHuaUtil.delDept(Arrays.asList(dept.getDahuaId()));
|
||||
}
|
||||
// 教育局、代理商
|
||||
if (DeptTypeEnum.EDUCATION_DEPT_TYPE.getValue().equals(dept.getDeptType()) ||
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(dept.getDeptType())) {
|
||||
DeptTypeEnum.AGENT_TYPE.getValue().equals(dept.getDeptType())) {
|
||||
// 删除关联学校数据
|
||||
this.deptSchoolRelateMapper.delete(Wrappers.lambdaQuery(new DeptSchoolRelate())
|
||||
.eq(DeptSchoolRelate::getDeptId, dept.getDeptId()));
|
||||
.eq(DeptSchoolRelate::getDeptId, dept.getDeptId()));
|
||||
}
|
||||
}
|
||||
List<Dept> delYidaSchool =
|
||||
list(Wrappers.<Dept>lambdaQuery().in(Dept::getDeptId, deptIds).eq(Dept::getDeptType, 0)
|
||||
.like(Dept::getSchoolType, "1"));
|
||||
list(Wrappers.<Dept>lambdaQuery().in(Dept::getDeptId, deptIds).eq(Dept::getDeptType, 0)
|
||||
.like(Dept::getSchoolType, "1"));
|
||||
this.delete(Arrays.asList(deptIds));
|
||||
// 更新学校列表
|
||||
if (CollUtil.isNotEmpty(delYidaSchool)) {
|
||||
List<Long> yidaAppIds =
|
||||
delYidaSchool.stream().map(Dept::getYidaAppId).distinct().collect(Collectors.toList());
|
||||
delYidaSchool.stream().map(x -> x.getYidaAppId()).distinct().collect(Collectors.toList());
|
||||
for (Long yidaAppId : yidaAppIds) {
|
||||
EduYidaApp yidaApp = eduYidaAppService.getById(yidaAppId);
|
||||
List<Dept> schoolList = list(Wrappers.<Dept>lambdaQuery()
|
||||
.eq(Dept::getYidaAppId, yidaAppId)
|
||||
.eq(Dept::getDeptType, 0)
|
||||
.like(Dept::getSchoolType, "1"));
|
||||
.eq(Dept::getYidaAppId, yidaAppId)
|
||||
.eq(Dept::getDeptType, 0)
|
||||
.like(Dept::getSchoolType, "1"));
|
||||
|
||||
AppUtil.regionUpdate(yidaApp.getAppSchoolRegionId(), "热门学校", 0, yidaApp.getAppColId(),
|
||||
AppUtil.REGION_TYPE_HOT,
|
||||
new JSONArray() {{
|
||||
for (Dept dept : schoolList) {
|
||||
add(
|
||||
new JSONObject() {{
|
||||
set("id", dept.getYidaAppColId());
|
||||
if (StrUtil.isNotBlank(dept.getIcon())) {
|
||||
set("img", dept.getIcon());
|
||||
}
|
||||
}});
|
||||
}
|
||||
}}
|
||||
, yidaApp);
|
||||
AppUtil.REGION_TYPE_HOT,
|
||||
new JSONArray() {{
|
||||
for (Dept dept : schoolList) {
|
||||
add(
|
||||
new JSONObject() {{
|
||||
set("id", dept.getYidaAppColId());
|
||||
if (StrUtil.isNotBlank(dept.getIcon())) {
|
||||
set("img", dept.getIcon());
|
||||
}
|
||||
}});
|
||||
}
|
||||
}}
|
||||
, yidaApp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -645,7 +644,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
removeByIds(deptId);
|
||||
// 删除部门缓存
|
||||
redisService
|
||||
.hdel(CachePrefixConstant.SYS_DEPT_DATA, deptId.stream().map(x -> x.toString()).toArray(String[]::new));
|
||||
.hdel(CachePrefixConstant.SYS_DEPT_DATA, deptId.stream().map(x -> x.toString()).toArray(String[]::new));
|
||||
}
|
||||
|
||||
private void buildTrees(List<DeptTree> trees, List<Dept> depts) {
|
||||
@@ -674,7 +673,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
removeByIds(deptIds);
|
||||
userDataPermissionService.deleteByDeptIds(deptIds);
|
||||
this.deptSchoolRelateMapper.delete(Wrappers.lambdaQuery(new DeptSchoolRelate())
|
||||
.in(DeptSchoolRelate::getSchoolId, deptIds));
|
||||
.in(DeptSchoolRelate::getSchoolId, deptIds));
|
||||
LambdaQueryWrapper<Dept> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(Dept::getParentId, deptIds);
|
||||
List<Dept> depts = baseMapper.selectList(queryWrapper);
|
||||
@@ -710,41 +709,15 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
return deptTree;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getDeptTree(List<Long> deptIds) {
|
||||
List<Dept> allDepts = new ArrayList<>();
|
||||
List<Long> rootIdList = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(deptIds)) {
|
||||
for (Long deptId : deptIds) {
|
||||
// 添加根节点
|
||||
Dept root = getById(deptId);
|
||||
if (ObjectUtil.isNotNull(root)) {
|
||||
if (root.getParentId() != null) {
|
||||
root.setParentId(null);
|
||||
root.setParentWxId(null);
|
||||
}
|
||||
allDepts.add(root);
|
||||
rootIdList.add(deptId);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 循环查询子节点
|
||||
allDepts.addAll(findListByParent(rootIdList, 2));
|
||||
List<DeptTree> trees = new ArrayList<>();
|
||||
buildTrees(trees, allDepts);
|
||||
List<? extends Tree<?>> deptTree = TreeUtil.build(trees);
|
||||
return deptTree;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> listClassByDept(List<Long> ids) {
|
||||
List<Long> res = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
List<Dept> child = list(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, ids));
|
||||
res.addAll(
|
||||
child.stream().filter(x -> x.getDeptType() == 1).map(x -> x.getDeptId()).collect(Collectors.toList()));
|
||||
child.stream().filter(x -> x.getDeptType() == 1).map(x -> x.getDeptId()).collect(Collectors.toList()));
|
||||
res.addAll(listClassByDept(
|
||||
child.stream().filter(x -> x.getDeptType() != 1).map(x -> x.getDeptId()).collect(Collectors.toList())));
|
||||
child.stream().filter(x -> x.getDeptType() != 1).map(x -> x.getDeptId()).collect(Collectors.toList())));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -752,12 +725,12 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
@Override
|
||||
public Dept getDeptBySchoolAndName(List<Long> deptId, String deptName) {
|
||||
List<Dept> deptList = list(Wrappers.lambdaQuery(new Dept()).eq(Dept::getDeptName, deptName).in(Dept
|
||||
::getParentId, deptId).eq(Dept::getDeptType, 6));
|
||||
::getParentId, deptId).eq(Dept::getDeptType, 6));
|
||||
if (CollUtil.isEmpty(deptList)) {
|
||||
List<Dept> child = list(Wrappers.lambdaQuery(new Dept()).in(Dept::getParentId, deptId));
|
||||
if (CollUtil.isNotEmpty(child)) {
|
||||
return getDeptBySchoolAndName(child.stream().map(x -> x.getDeptId()).collect(Collectors.toList()),
|
||||
deptName);
|
||||
deptName);
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
@@ -851,67 +824,56 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
public Dept getClassBySchoolAndWx(Long schoolId, Long classWxId) {
|
||||
// 查询到学校年级层
|
||||
List<Dept> campusList = list(
|
||||
Wrappers.<Dept>lambdaQuery().eq(Dept::getParentId, schoolId).eq(Dept::getDeptType, 4));
|
||||
Wrappers.<Dept>lambdaQuery().eq(Dept::getParentId, schoolId).eq(Dept::getDeptType, 4));
|
||||
List<Dept> sectionList =
|
||||
list(Wrappers.<Dept>lambdaQuery()
|
||||
.in(Dept::getParentId, campusList.stream().map(x -> x.getDeptId()).collect(Collectors.toList()))
|
||||
.eq(Dept::getDeptType, 3));
|
||||
list(Wrappers.<Dept>lambdaQuery()
|
||||
.in(Dept::getParentId, campusList.stream().map(x -> x.getDeptId()).collect(Collectors.toList()))
|
||||
.eq(Dept::getDeptType, 3));
|
||||
List<Dept> gradeList =
|
||||
list(Wrappers.<Dept>lambdaQuery()
|
||||
.in(Dept::getParentId, sectionList.stream().map(x -> x.getDeptId()).collect(Collectors.toList()))
|
||||
.eq(Dept::getDeptType, 2));
|
||||
list(Wrappers.<Dept>lambdaQuery()
|
||||
.in(Dept::getParentId, sectionList.stream().map(x -> x.getDeptId()).collect(Collectors.toList()))
|
||||
.eq(Dept::getDeptType, 2));
|
||||
return getOne(Wrappers.<Dept>lambdaQuery()
|
||||
.in(Dept::getParentId, gradeList.stream().map(x -> x.getDeptId()).collect(Collectors.toList()))
|
||||
.eq(Dept::getWxId,
|
||||
classWxId));
|
||||
.in(Dept::getParentId, gradeList.stream().map(x -> x.getDeptId()).collect(Collectors.toList()))
|
||||
.eq(Dept::getWxId,
|
||||
classWxId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncQywxDept(Long schoolId) {
|
||||
// 查询所有和企业微信关联的学校信息
|
||||
List<Dept> schoolList = new ArrayList<>();
|
||||
if (Objects.isNull(schoolId)) {
|
||||
// 查询所有绑定了企业微信的学校信息
|
||||
schoolList = list(Wrappers.<Dept>lambdaQuery()
|
||||
.eq(Dept::getDeptType, DeptTypeEnum.SCHOOL_TYPE.getValue())
|
||||
public void syncQywxDept() {
|
||||
// 绑定了企业微信的学校
|
||||
log.info("开始同步企业微信部门");
|
||||
List<Dept> schoolList = list(Wrappers.<Dept>lambdaQuery()
|
||||
.eq(Dept::getDeptType, 0)
|
||||
.like(Dept::getSchoolType, Dept.TYPE_QYWX));
|
||||
} else {
|
||||
Dept school = getById(schoolId);
|
||||
schoolList.add(school);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(schoolList)) {
|
||||
for (Dept school : schoolList) {
|
||||
EduApp contactApp = commonService.getAppContactUsedBySelect(school.getDeptId());
|
||||
EduApp contactApp = commonService.getAppByCodeAndSchool(AppConstant.CONTACT, null, school.getDeptId());
|
||||
// 获取办公部门
|
||||
log.info("[{}]开始同步办公部门", school.getDeptName());
|
||||
List<Map> deptList = wxUtil
|
||||
.listSimpleDept(wxUtil.getAccessToken(contactApp.getWxCorpId(), contactApp.getWxSecret()),
|
||||
school.getWxId());
|
||||
.listDept(wxUtil.getAccessToken(contactApp.getWxCorpId(), contactApp.getWxSecret()),
|
||||
school.getWxId());
|
||||
// 保存办公部门
|
||||
Map<Long, Long> idCache = new HashMap<>();
|
||||
idCache.put(1L, school.getDeptId());
|
||||
for (Map map : deptList) {
|
||||
Long wxId = Long.valueOf(map.get("id").toString());
|
||||
Long parentWxId = Long.valueOf(map.get("parentid").toString());
|
||||
// String deptName = map.get("name").toString();
|
||||
String deptName = map.get("name").toString();
|
||||
Integer order = Integer.valueOf(map.get("order").toString());
|
||||
Long parentId = idCache.get(parentWxId);
|
||||
if (wxId == 1) {
|
||||
continue;
|
||||
}
|
||||
// 获取单个部门详情
|
||||
JSONObject deptInfo = wxUtil.getDeptInfo(
|
||||
wxUtil.getAccessToken(contactApp.getWxCorpId(), contactApp.getWxSecret()), String.valueOf(wxId));
|
||||
String deptName = deptInfo.get("name").toString();
|
||||
Dept exist = getOne(Wrappers.<Dept>lambdaQuery().eq(Dept::getParentId, parentId)
|
||||
.eq(Dept::getWxId, wxId).eq(Dept::getDeptType, 6));
|
||||
.eq(Dept::getWxId, wxId).eq(Dept::getDeptType, 6));
|
||||
if (exist == null) {
|
||||
exist = new Dept();
|
||||
}
|
||||
exist.setParentId(parentId);
|
||||
exist.setDeptName(deptName);
|
||||
exist.setDeptType(DeptTypeEnum.DEPARTMENT_TYPE.getValue());
|
||||
exist.setDeptType(6);
|
||||
exist.setAreaId(school.getAreaId());
|
||||
exist.setWxId(wxId);
|
||||
exist.setParentWxId(parentWxId);
|
||||
@@ -927,22 +889,23 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
@Override
|
||||
public void dealNoParentDept() {
|
||||
List<Dept> schools = list(Wrappers.lambdaQuery(new Dept())
|
||||
.eq(Dept::getDeptType, DeptTypeEnum.SCHOOL_TYPE.getValue()));
|
||||
.eq(Dept::getDeptType, 0));
|
||||
if (CollUtil.isNotEmpty(schools)) {
|
||||
List<Long> schoolIds = schools.stream().map(Dept::getDeptId).collect(Collectors.toList());
|
||||
schoolIds.forEach(schoolId -> {
|
||||
List<Dept> depts = list(Wrappers.lambdaQuery(new Dept())
|
||||
.eq(Dept::getVisible, DeptVisibleTypeEnum.INVISIBLE_TYPE.getValue())
|
||||
.eq(Dept::getParentId, schoolId)
|
||||
.ne(Dept::getDeptType, DeptTypeEnum.COMPANY_TYPE.getValue()));
|
||||
.eq(Dept::getVisible, 1)
|
||||
.eq(Dept::getParentId, schoolId)
|
||||
.ne(Dept::getDeptType, 4)
|
||||
.ne(Dept::getDeptType, 5));
|
||||
for (Dept dept : depts) {
|
||||
if (StrUtil.isNotBlank(dept.getCorpId())) {
|
||||
Dept parent = getOne(Wrappers.lambdaQuery(new Dept())
|
||||
.eq(Dept::getCorpId, dept.getCorpId())
|
||||
.eq(Dept::getWxId, dept.getParentWxId()));
|
||||
.eq(Dept::getCorpId, dept.getCorpId())
|
||||
.eq(Dept::getWxId, dept.getParentWxId()));
|
||||
if (parent != null) {
|
||||
dept.setParentId(parent.getDeptId());
|
||||
dept.setVisible(DeptVisibleTypeEnum.VISIBLE_TYPE.getValue());
|
||||
dept.setVisible(0);
|
||||
updateById(dept);
|
||||
}
|
||||
}
|
||||
@@ -972,25 +935,25 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
*
|
||||
* @param agentSchoolSelectPageDTO 查询代理商管理的学校列表数据请求类
|
||||
* @return com.yida.data.common.core.common.ResultBean<com.baomidou.mybatisplus.core.metadata.IPage <
|
||||
* com.yida.data.system.vo.AgentSchoolVO>>
|
||||
* com.yida.data.system.vo.AgentSchoolVO>>
|
||||
* @author ZYJ
|
||||
* @date 2021/9/27 17:05
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<IPage<AgentSchoolSelectPageVO>> listAgentSchoolPage(
|
||||
AgentSchoolSelectPageDTO agentSchoolSelectPageDTO) {
|
||||
AgentSchoolSelectPageDTO agentSchoolSelectPageDTO) {
|
||||
CurrentUser currentUser = FebsUtil.getCurrentUser();
|
||||
// 查询下级部门信息
|
||||
List<Long> childIdList = findListByParent(Collections.singletonList(currentUser.getDeptId()), 0)
|
||||
.stream().map(Dept::getDeptId).collect(Collectors.toList());
|
||||
.stream().map(Dept::getDeptId).collect(Collectors.toList());
|
||||
// 代理商管理员查询当前代理商所有数据
|
||||
if (RoleEnum.ROLE_AGENT_ADMIN.equals(RoleUtil.getMaxRole(currentUser))) {
|
||||
childIdList.add(currentUser.getDeptId());
|
||||
}
|
||||
// 具有创建学校列表的数据 自己创建的学校+当前登陆账号部门以下的学校
|
||||
IPage<AgentSchoolSelectPageVO> iPage = this.baseMapper
|
||||
.listAgentSchoolPage(agentSchoolSelectPageDTO.toPage(), agentSchoolSelectPageDTO,
|
||||
childIdList, currentUser);
|
||||
.listAgentSchoolPage(agentSchoolSelectPageDTO.toPage(), agentSchoolSelectPageDTO,
|
||||
childIdList, currentUser);
|
||||
return ResultBean.buildSuccess(iPage);
|
||||
}
|
||||
|
||||
@@ -1027,7 +990,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
}
|
||||
// 查询学校已有微信支付配置信息
|
||||
EduPayWxConfig payWxConfig = this.eduPayWxConfigService.getOne(Wrappers.lambdaQuery(new EduPayWxConfig())
|
||||
.eq(EduPayWxConfig::getSchoolId, dept.getDeptId()));
|
||||
.eq(EduPayWxConfig::getSchoolId, dept.getDeptId()));
|
||||
if (Objects.isNull(payWxConfig)) {
|
||||
payWxConfig = new EduPayWxConfig();
|
||||
}
|
||||
@@ -1055,7 +1018,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
BeanUtils.copyProperties(dept, agentSchoolDetailVO);
|
||||
// 查询支付配置信息
|
||||
EduPayWxConfig payWxConfig = this.eduPayWxConfigService.getOne(Wrappers.lambdaQuery(new EduPayWxConfig())
|
||||
.eq(EduPayWxConfig::getSchoolId, dept.getDeptId()));
|
||||
.eq(EduPayWxConfig::getSchoolId, dept.getDeptId()));
|
||||
if (Objects.nonNull(payWxConfig)) {
|
||||
// 配置支付数据
|
||||
agentSchoolDetailVO.setWxPublicId(payWxConfig.getWxPublicId());
|
||||
@@ -1087,7 +1050,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
|
||||
// 修改学校状态
|
||||
this.deptSchoolRelateMapper.update(deptSchoolRelate,
|
||||
Wrappers.lambdaUpdate(new DeptSchoolRelate()).eq(DeptSchoolRelate::getSchoolId, schoolId));
|
||||
Wrappers.lambdaUpdate(new DeptSchoolRelate()).eq(DeptSchoolRelate::getSchoolId, schoolId));
|
||||
// 修改相关登陆账号信息
|
||||
SystemUser systemUser = new SystemUser();
|
||||
systemUser.setUpdateDate(LocalDateTime.now());
|
||||
@@ -1100,7 +1063,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
}
|
||||
// 修改学校相关账号状态
|
||||
this.userService.update(systemUser,
|
||||
Wrappers.lambdaUpdate(new SystemUser()).eq(SystemUser::getDeptId, schoolId));
|
||||
Wrappers.lambdaUpdate(new SystemUser()).eq(SystemUser::getDeptId, schoolId));
|
||||
return ResultBean.buildSuccess();
|
||||
}
|
||||
|
||||
@@ -1171,8 +1134,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
deptSchoolInformationNature.setNature(integer);
|
||||
list.add(deptSchoolInformationNature);
|
||||
}
|
||||
natureService.remove(Wrappers.query(new DeptSchoolInformationNature()).lambda()
|
||||
.eq(DeptSchoolInformationNature::getInformationId, deptSchoolInformation.getId()));
|
||||
natureService.remove(Wrappers.query(new DeptSchoolInformationNature()).lambda().eq(DeptSchoolInformationNature::getInformationId, deptSchoolInformation.getId()));
|
||||
natureService.saveBatch(list);
|
||||
|
||||
}
|
||||
@@ -1184,11 +1146,11 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
schoolLabel.setDeptSchoolId(deptSchoolInformation.getId());
|
||||
schoolLabelList.add(schoolLabel);
|
||||
}
|
||||
schoolLabelService.remove(Wrappers.query(new DeptSchoolLabel()).lambda()
|
||||
.eq(DeptSchoolLabel::getDeptSchoolId, deptSchoolInformation.getId()));
|
||||
schoolLabelService.remove(Wrappers.query(new DeptSchoolLabel()).lambda().eq(DeptSchoolLabel::getDeptSchoolId, deptSchoolInformation.getId()));
|
||||
schoolLabelService.saveBatch(schoolLabelList);
|
||||
}
|
||||
|
||||
|
||||
String studentRange = information.getStudentRange();
|
||||
List<DeptSchoolStudentRange> list = new ArrayList<>();
|
||||
//分割招生范围
|
||||
@@ -1205,8 +1167,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
range.setDeptSchoolId(deptSchoolInformation.getId());
|
||||
list.add(range);
|
||||
}
|
||||
rangeService.remove(Wrappers.query(new DeptSchoolStudentRange()).lambda()
|
||||
.eq(DeptSchoolStudentRange::getDeptSchoolId, deptSchoolInformation.getId()));
|
||||
rangeService.remove(Wrappers.query(new DeptSchoolStudentRange()).lambda().eq(DeptSchoolStudentRange::getDeptSchoolId, deptSchoolInformation.getId()));
|
||||
rangeService.saveBatch(list);
|
||||
}
|
||||
|
||||
@@ -1214,16 +1175,15 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
|
||||
@Override
|
||||
public Page<SchoolInformationDTO> findSchoolListByDeptId(Long deptId, String schoolName, Integer schoolType,
|
||||
Integer natureType, String address, String tag, Page<SchoolInformationDTO> page,
|
||||
Integer schoolOwnership) {
|
||||
Integer natureType, String address, String tag, Page<SchoolInformationDTO> page,
|
||||
Integer schoolOwnership) {
|
||||
|
||||
return informationService
|
||||
.findSchoolListByDeptId(deptId, schoolName, schoolType, natureType, address, tag, page, schoolOwnership);
|
||||
return informationService.findSchoolListByDeptId(deptId, schoolName, schoolType, natureType, address, tag, page, schoolOwnership);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SchoolInformationDTO> findSchoolPageList(String schoolName, List<Integer> schoolType, List<Integer> natureType,
|
||||
Page<SchoolInformationDTO> page, String tag, Long deptId, List<Integer> schoolOwnership) {
|
||||
public Page<SchoolInformationDTO> findSchoolPageList(String schoolName, List<Integer> schoolType, List<Integer> natureType, Page<SchoolInformationDTO> page, String tag, Long deptId, List<Integer> schoolOwnership) {
|
||||
|
||||
|
||||
String[] tags = null;
|
||||
if (ObjectUtil.isNotEmpty(tag)) {
|
||||
@@ -1285,23 +1245,17 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Dept> findParentDeptByChild(List<Long> deptIds) {
|
||||
List<Dept> childList = list(Wrappers.lambdaQuery(new Dept()).in(Dept::getDeptId, deptIds));
|
||||
List<Dept> allDeptList = list();
|
||||
List<Dept> parentDeptList = new ArrayList<>();
|
||||
return getParentDeptList(allDeptList, childList, parentDeptList);
|
||||
}
|
||||
|
||||
|
||||
private List<Dept> getParentDeptList(List<Dept> depts, List<Dept> childrenDeptList, List<Dept> parentDeptList) {
|
||||
if (CollectionUtils.isEmpty(childrenDeptList)) {
|
||||
return parentDeptList;
|
||||
}
|
||||
parentDeptList.addAll(childrenDeptList);
|
||||
List<Long> parentIds = childrenDeptList.stream().map(Dept::getParentId).filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
//查询父级部门
|
||||
List<Dept> parentDepts = depts.stream().filter(x -> parentIds.contains(x.getDeptId())).collect(Collectors.toList());
|
||||
return getParentDeptList(depts, parentDepts, parentDeptList);
|
||||
public List<SchoolInformationDTO> listPaySchool(Long deptId, String schoolName) {
|
||||
List<SchoolInformationDTO> list = deptSchoolInformationMapper.listPaySchool(deptId, schoolName);
|
||||
// // 返回数据
|
||||
// List<SchoolInformationDTO> returnList = new ArrayList<>();
|
||||
// // 判断是否包含缴费信息
|
||||
// list.forEach(schoolInformationDTO -> {
|
||||
// EduDeptPayType deptPayType = commonService.getDeptPayWay(schoolInformationDTO.getSchoolId());
|
||||
// if (Objects.nonNull(deptPayType)) {
|
||||
// returnList.add(schoolInformationDTO);
|
||||
// }
|
||||
// });
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.system.EduAppTemplate;
|
||||
import com.yida.data.system.mapper.EduAppTemplateMapper;
|
||||
import com.yida.data.system.service.EduAppTemplateService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 企业微信服务商代开发应用模板service
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class EduAppTemplateServiceImpl extends ServiceImpl<EduAppTemplateMapper,
|
||||
EduAppTemplate> implements EduAppTemplateService {
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.system.EduBaseApp;
|
||||
import com.yida.data.system.mapper.EduBaseAppMapper;
|
||||
import com.yida.data.system.service.EduBaseAppService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 基础应用信息(本地配置) Service实现
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-06-28 14:57:58
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class EduBaseAppServiceImpl extends ServiceImpl
|
||||
<EduBaseAppMapper, EduBaseApp> implements EduBaseAppService {
|
||||
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.consume.EduConsumeConfig;
|
||||
import com.yida.data.system.mapper.EduConsumeConfigMapper;
|
||||
import com.yida.data.system.service.EduConsumeConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 学校消费机服务器信息Service实现
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-04-06 17:31:11
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class EduConsumeConfigServiceImpl extends ServiceImpl
|
||||
<EduConsumeConfigMapper, EduConsumeConfig> implements EduConsumeConfigService {
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.system.EduDeptFunction;
|
||||
import com.yida.data.system.mapper.EduDeptFunctionMapper;
|
||||
import com.yida.data.system.service.EduDeptFunctionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 部门对应的第三方系统功能Service实现
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023-02-20 15:29:05
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
|
||||
public class EduDeptFunctionServiceImpl extends ServiceImpl
|
||||
<EduDeptFunctionMapper, EduDeptFunction> implements EduDeptFunctionService {
|
||||
|
||||
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.system.mapper.EduQywxServiceProviderSchoolMapper;
|
||||
import com.yida.data.system.service.EduQywxServiceProviderSchoolService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 企业微信服务商-学校密文corpId对照表service
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/9
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class EduQywxServiceProviderSchoolServiceImpl extends ServiceImpl<EduQywxServiceProviderSchoolMapper,
|
||||
EduQywxServiceProviderSchool> implements EduQywxServiceProviderSchoolService {
|
||||
|
||||
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.system.mapper.EduQywxServiceProviderMapper;
|
||||
import com.yida.data.system.service.EduQywxServiceProviderService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 企业微信服务商service
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2022/11/3
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class EduQywxServiceProviderServiceImpl extends ServiceImpl<EduQywxServiceProviderMapper,
|
||||
EduQywxServiceProvider> implements EduQywxServiceProviderService {
|
||||
}
|
||||
+1
-19
@@ -54,25 +54,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
|
||||
@Override
|
||||
public List<Menu> findUserRealMenus(String username, Integer selectType) {
|
||||
checkUser(username);
|
||||
List<Menu> permissions = baseMapper.findUserPermissions(username);
|
||||
List<Menu> userRealMenus = baseMapper.findUserMenus(username, selectType);
|
||||
permissions.addAll(userRealMenus.stream().filter(x -> x.getUserMenuType() == 0).collect(Collectors.toList()));
|
||||
Iterator<Menu> iterator = permissions.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Menu next = iterator.next();
|
||||
for (Menu realMenu : userRealMenus) {
|
||||
if (realMenu.getUserMenuType() == 1 && realMenu.getMenuId().equals(next.getMenuId())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(selectType)) {
|
||||
permissions = permissions.stream().filter(x -> x.getType().equals(selectType.toString()))
|
||||
.peek(x->x.setUserMenuType(null))
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return permissions;
|
||||
return this.baseMapper.findUserRealMenus(username, selectType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+156
-177
@@ -1,68 +1,67 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.yida.data.common.core.entity.constant.AppConstant;
|
||||
import com.yida.data.common.core.entity.constant.QywxConstant;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.common.core.entity.system.enums.DeptTypeEnum;
|
||||
import com.yida.data.common.core.enums.QywxCallbackTypeEnum;
|
||||
import com.yida.data.rabbit.constant.RabbitConstant;
|
||||
import com.yida.data.rabbit.util.RabbitUtil;
|
||||
import com.yida.data.common.core.entity.system.EduApp;
|
||||
import com.yida.data.common.core.utils.WxUtil;
|
||||
import com.yida.data.common.service.CommonService;
|
||||
import com.yida.data.system.aes.WXBizMsgCrypt;
|
||||
import com.yida.data.system.dto.QywxCallbackHandleDTO;
|
||||
import com.yida.data.system.service.*;
|
||||
import com.yida.data.system.service.IDeptService;
|
||||
import com.yida.data.system.service.IUserService;
|
||||
import com.yida.data.system.service.QywxCallbackService;
|
||||
import com.yida.data.system.service.QywxService;
|
||||
import com.yida.data.user.feign.RemoteStudentService;
|
||||
import com.yida.data.user.feign.RemoteTeacherService;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.StringReader;
|
||||
|
||||
/**
|
||||
* 企业微信回调类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/10/27 17:15
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class QywxCallbackServiceImpl implements QywxCallbackService {
|
||||
|
||||
private final IDeptService deptService;
|
||||
private final EduQywxServiceProviderService eduQywxServiceProviderService;
|
||||
private final EduQywxServiceProviderSchoolService eduQywxServiceProviderSchoolService;
|
||||
private final IUserService userService;
|
||||
private final QywxService qywxService;
|
||||
|
||||
private final RabbitUtil rabbitUtil;
|
||||
private final WxUtil wxUtil;
|
||||
private final CommonService commonService;
|
||||
private final RemoteTeacherService remoteTeacherService;
|
||||
private final RemoteStudentService remoteStudentService;
|
||||
|
||||
@Override
|
||||
public String get(String corpId, String msgSignature, String timestamp, String nonce, String echostr) {
|
||||
Dept school =
|
||||
deptService.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getCorpId, corpId).eq(Dept::getDeptType, DeptTypeEnum.SCHOOL_TYPE.getValue()));
|
||||
log.info("部门验证url回调params:{},{},{},{},{}", corpId, msgSignature, timestamp, nonce, echostr);
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
deptService.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getCorpId, corpId).eq(Dept::getDeptType, 0));
|
||||
log.info("params:{},{},{},{},{}", corpId, msgSignature, timestamp, nonce, echostr);
|
||||
WXBizMsgCrypt wxcpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
school.getCorpId());
|
||||
String result = wxCpt.VerifyURL(msgSignature, timestamp, nonce, echostr);
|
||||
log.info("部门验证url回调call valid result:{}", result);
|
||||
String result = wxcpt.VerifyURL(msgSignature, timestamp, nonce, echostr);
|
||||
log.info("call valid result:{}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
public String post(String corpId, String msgSignature, String timestamp, String nonce, String body) {
|
||||
Dept school = deptService.getOne(Wrappers.lambdaQuery(new Dept())
|
||||
.eq(Dept::getCorpId, corpId)
|
||||
.eq(Dept::getDeptType, DeptTypeEnum.SCHOOL_TYPE.getValue())
|
||||
);
|
||||
log.info("部门回调params:{},{},{},{},{}", corpId, msgSignature, timestamp, nonce, body);
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
public void post(String corpId, String msgSignature, String timestamp, String nonce, String body) {
|
||||
Dept school =
|
||||
deptService.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getCorpId, corpId).eq(Dept::getDeptType, 0));
|
||||
log.info("params:{},{},{},{},{}", corpId, msgSignature, timestamp, nonce, body);
|
||||
WXBizMsgCrypt wxcpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
school.getCorpId());
|
||||
String msg = wxCpt.DecryptMsg(msgSignature, timestamp, nonce, body);
|
||||
String msg = wxcpt.DecryptMsg(msgSignature, timestamp, nonce, body);
|
||||
log.info("msg:{}", msg);
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
StringReader sr = new StringReader(msg);
|
||||
@@ -74,155 +73,135 @@ public class QywxCallbackServiceImpl implements QywxCallbackService {
|
||||
document = db.parse(is);
|
||||
} catch (Exception e) {
|
||||
log.error("解析微信回调信息失败,msg:{}", e.getMessage());
|
||||
return "fail";
|
||||
}
|
||||
// 发送消息给rabbitmq
|
||||
rabbitUtil.convertAndSendMsg(RabbitConstant.QYWX_HANDLE_EXCHANGE, RabbitConstant.QYWX_HANDLE_KEY,
|
||||
QywxCallbackHandleDTO.builder()
|
||||
.root(document.getDocumentElement())
|
||||
.corpId(corpId)
|
||||
.school(school)
|
||||
.qywxCallbackTypeEnum(QywxCallbackTypeEnum.POST)
|
||||
.build()
|
||||
);
|
||||
return "success";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNormal(String corpId, String msgSignature, String timestamp, String nonce, String echostr) {
|
||||
EduQywxServiceProvider serviceProvider =
|
||||
eduQywxServiceProviderService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProvider())
|
||||
.eq(EduQywxServiceProvider::getCorpId, corpId));
|
||||
log.info("服务商验证url回调params:{},{},{},{},{}", corpId, msgSignature, timestamp, nonce, echostr);
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(serviceProvider.getWxCallToken(), serviceProvider.getWxAesKey(),
|
||||
serviceProvider.getCorpId());
|
||||
String result = wxCpt.VerifyURL(msgSignature, timestamp, nonce, echostr, false);
|
||||
log.info("服务商验证url回调call valid result:{}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String postNormal(String corpId, String msgSignature, String timestamp, String nonce, String body) {
|
||||
EduQywxServiceProvider serviceProvider =
|
||||
eduQywxServiceProviderService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProvider())
|
||||
.eq(EduQywxServiceProvider::getCorpId, corpId));
|
||||
log.info("服务商代开发应用模板接口回调params:{},{},{},{},{}", corpId, msgSignature, timestamp, nonce, body);
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(serviceProvider.getWxCallToken(), serviceProvider.getWxAesKey(),
|
||||
serviceProvider.getCorpId());
|
||||
String msg = wxCpt.DecryptMsg(msgSignature, timestamp, nonce, body, false);
|
||||
log.info("msg:{}", msg);
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
StringReader sr = new StringReader(msg);
|
||||
InputSource is = new InputSource(sr);
|
||||
DocumentBuilder db = null;
|
||||
Document document = null;
|
||||
try {
|
||||
db = dbf.newDocumentBuilder();
|
||||
document = db.parse(is);
|
||||
} catch (Exception e) {
|
||||
log.error("服务商代开发应用模板接口回调信息失败,msg:{}", e.getMessage());
|
||||
return "fail";
|
||||
}
|
||||
|
||||
// 发送消息给rabbitmq
|
||||
rabbitUtil.convertAndSendMsg(RabbitConstant.QYWX_HANDLE_EXCHANGE, RabbitConstant.QYWX_HANDLE_KEY,
|
||||
QywxCallbackHandleDTO.builder()
|
||||
.root(document.getDocumentElement())
|
||||
.eduQywxServiceProvider(serviceProvider)
|
||||
.qywxCallbackTypeEnum(QywxCallbackTypeEnum.POST_NORMAL)
|
||||
.build()
|
||||
);
|
||||
return "success";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNormalCustomer(String providerCorpId, String corpId, String msgSignature, String timestamp,
|
||||
String nonce, String echostr) {
|
||||
Dept school = deptService.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getCorpId, corpId).eq(Dept::getDeptType, 0));
|
||||
log.info("服务商代开发应用客户验证url回调params:{},{},{},{},{},{}", providerCorpId, corpId, msgSignature, timestamp, nonce, echostr);
|
||||
|
||||
EduQywxServiceProviderSchool providerSchool = eduQywxServiceProviderSchoolService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProviderSchool())
|
||||
.eq(EduQywxServiceProviderSchool::getProviderCorpId, providerCorpId)
|
||||
.eq(EduQywxServiceProviderSchool::getDeptOriginalCorpId, corpId));
|
||||
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
providerSchool.getDeptEncryptionCorpId());
|
||||
String result = wxCpt.VerifyURL(msgSignature, timestamp, nonce, echostr);
|
||||
log.info("服务商代开发应用客户验证url回调call valid result:{}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String postNormalCustomer(String providerCorpId, String corpId, String msgSignature, String timestamp, String nonce, String body) {
|
||||
Dept school =
|
||||
deptService.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getCorpId, corpId).eq(Dept::getDeptType, DeptTypeEnum.SCHOOL_TYPE.getValue()));
|
||||
log.info("服务商代开发应用客户接口回调params: {},{},{},{},{},{}", providerCorpId, corpId, msgSignature, timestamp, nonce, body);
|
||||
EduQywxServiceProviderSchool providerSchool = eduQywxServiceProviderSchoolService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProviderSchool())
|
||||
.eq(EduQywxServiceProviderSchool::getProviderCorpId, providerCorpId)
|
||||
.eq(EduQywxServiceProviderSchool::getDeptOriginalCorpId, corpId));
|
||||
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
providerSchool.getDeptEncryptionCorpId());
|
||||
String msg = wxCpt.DecryptMsg(msgSignature, timestamp, nonce, body);
|
||||
log.info("msg:{}", msg);
|
||||
return "success";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEvent(String providerCorpId, String corpId, String msgSignature, String timestamp, String nonce, String echostr) {
|
||||
Dept school = deptService.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getCorpId, corpId).eq(Dept::getDeptType, DeptTypeEnum.SCHOOL_TYPE.getValue()));
|
||||
log.info("服务商代开发家校沟通验证url回调params:{},{},{},{},{},{}", providerCorpId, corpId, msgSignature, timestamp, nonce, echostr);
|
||||
|
||||
EduQywxServiceProviderSchool providerSchool = eduQywxServiceProviderSchoolService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProviderSchool())
|
||||
.eq(EduQywxServiceProviderSchool::getProviderCorpId, providerCorpId)
|
||||
.eq(EduQywxServiceProviderSchool::getDeptOriginalCorpId, corpId));
|
||||
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
providerSchool.getDeptEncryptionCorpId());
|
||||
String result = wxCpt.VerifyURL(msgSignature, timestamp, nonce, echostr);
|
||||
log.info("服务商代开发应用家校沟通验证url回调call valid result:{}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String postEvent(String providerCorpId, String corpId, String msgSignature, String timestamp, String nonce, String body) {
|
||||
Dept school = deptService.getOne(Wrappers.lambdaQuery(new Dept()).eq(Dept::getCorpId, corpId).eq(Dept::getDeptType, DeptTypeEnum.SCHOOL_TYPE.getValue()));
|
||||
log.info("服务商代开发家校沟通回调params: {},{},{},{},{},{}", providerCorpId, corpId, msgSignature, timestamp, nonce, body);
|
||||
EduQywxServiceProviderSchool providerSchool = eduQywxServiceProviderSchoolService.getOne(Wrappers.lambdaQuery(new EduQywxServiceProviderSchool())
|
||||
.eq(EduQywxServiceProviderSchool::getProviderCorpId, providerCorpId)
|
||||
.eq(EduQywxServiceProviderSchool::getDeptOriginalCorpId, corpId));
|
||||
|
||||
WXBizMsgCrypt wxCpt = new WXBizMsgCrypt(school.getWxCallToken(), school.getWxAesKey(),
|
||||
providerSchool.getDeptEncryptionCorpId());
|
||||
String msg = wxCpt.DecryptMsg(msgSignature, timestamp, nonce, body);
|
||||
log.info("msg:{}", msg);
|
||||
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
StringReader sr = new StringReader(msg);
|
||||
InputSource is = new InputSource(sr);
|
||||
DocumentBuilder db = null;
|
||||
Document document = null;
|
||||
try {
|
||||
db = dbf.newDocumentBuilder();
|
||||
document = db.parse(is);
|
||||
} catch (Exception e) {
|
||||
log.error("解析服务商代开发家校沟通回调信息失败,msg:{}", e.getMessage());
|
||||
return "false";
|
||||
}
|
||||
Element root = document.getDocumentElement();
|
||||
if (root.getElementsByTagName("Event").getLength() == 0) {
|
||||
log.info("暂不处理当前回调数据");
|
||||
return "success";
|
||||
|
||||
NodeList nodelist1 = root.getElementsByTagName("ChangeType");
|
||||
String changeType = nodelist1.item(0).getTextContent();
|
||||
|
||||
NodeList nodelist2 = root.getElementsByTagName("Event");
|
||||
String event = nodelist2.item(0).getTextContent();
|
||||
|
||||
if (QywxConstant.SCHOOL_CONTACT_EVENT.equals(event)) {
|
||||
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT_SCHOOL, null, school.getDeptId());
|
||||
String id = root.getElementsByTagName("Id").item(0).getTextContent();
|
||||
|
||||
switch (changeType) {
|
||||
case QywxConstant.SCHOOL_DEPT_CREATE_TYPE:
|
||||
qywxService.createSchoolDept(corpId, wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), Long.valueOf(id), school);
|
||||
break;
|
||||
case QywxConstant.SCHOOL_DEPT_UPDATE_TYPE:
|
||||
qywxService.updateSchoolDept(wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), Long.valueOf(id), school);
|
||||
break;
|
||||
case QywxConstant.SCHOOL_DEPT_DELETE_TYPE:
|
||||
qywxService.deleteSchoolDept(Long.valueOf(id), school);
|
||||
break;
|
||||
case QywxConstant.STUDENT_CREATE_TYPE:
|
||||
case QywxConstant.STUDENT_UPDATE_TYPE:
|
||||
qywxService.changeStudent(wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), id, school);
|
||||
break;
|
||||
case QywxConstant.STUDENT_DELETE_TYPE:
|
||||
qywxService.deleteStudent(id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_CREATE_TYPE:
|
||||
// 新增家长可能是创建学生时创建,等待2s确保学生创建完成
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
case QywxConstant.PARENT_UPDATE_TYPE:
|
||||
qywxService.updateParent(wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_DELETE_TYPE:
|
||||
qywxService.deleteParent(id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_SUBSCRIBE_TYPE:
|
||||
log.info("进入家长关注事件回调");
|
||||
// 调用家长关注发送通知方法
|
||||
qywxService.sendParentSubscribeMessage(id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_UNSUBSCRIBE_TYPE:
|
||||
log.info("进入家长取消关注事件回调");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (QywxConstant.CONTACT_EVENT.equals(event)) {
|
||||
String userid = null, phone = null, name = null, gender = null, avatar = null, department = null,
|
||||
isLeader = null, mainDepartment = null, email = null;
|
||||
if (root.getElementsByTagName("UserID").getLength() != 0) {
|
||||
userid = root.getElementsByTagName("UserID").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Mobile").getLength() != 0) {
|
||||
phone = root.getElementsByTagName("Mobile").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Name").getLength() != 0) {
|
||||
name = root.getElementsByTagName("Name").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Gender").getLength() != 0) {
|
||||
gender = root.getElementsByTagName("Gender").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Avatar").getLength() != 0) {
|
||||
avatar = root.getElementsByTagName("Avatar").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Department").getLength() != 0) {
|
||||
department = root.getElementsByTagName("Department").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("IsLeaderInDept").getLength() != 0) {
|
||||
isLeader = root.getElementsByTagName("IsLeaderInDept").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("MainDepartment").getLength() != 0) {
|
||||
mainDepartment = root.getElementsByTagName("MainDepartment").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Email").getLength() != 0) {
|
||||
email = root.getElementsByTagName("Email").item(0).getTextContent();
|
||||
}
|
||||
|
||||
|
||||
String deptId = null, deptName = null, deptParentId = null, order = null;
|
||||
if (root.getElementsByTagName("Id").getLength() != 0) {
|
||||
deptId = root.getElementsByTagName("Id").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Name").getLength() != 0) {
|
||||
deptName = root.getElementsByTagName("Name").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("ParentId").getLength() != 0) {
|
||||
deptParentId = root.getElementsByTagName("ParentId").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Order").getLength() != 0) {
|
||||
order = root.getElementsByTagName("Order").item(0).getTextContent();
|
||||
}
|
||||
|
||||
switch (changeType) {
|
||||
case QywxConstant.USER_CREATE_TYPE:
|
||||
qywxService.createUser(name, userid, phone, email, gender, avatar, department, isLeader,
|
||||
mainDepartment, school);
|
||||
break;
|
||||
case QywxConstant.USER_UPDATE_TYPE:
|
||||
qywxService.updateUser(name, userid, phone, email, gender, avatar, department, isLeader,
|
||||
mainDepartment, school);
|
||||
break;
|
||||
case QywxConstant.USER_DELETE_TYPE:
|
||||
qywxService.deleteUser(userid, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.DEPT_CREATE_TYPE:
|
||||
qywxService.createDept(deptId, deptName, deptParentId, order, school);
|
||||
break;
|
||||
case QywxConstant.DEPT_UPDATE_TYPE:
|
||||
qywxService.updateDept(deptId, deptName, deptParentId, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.DEPT_DELETE_TYPE:
|
||||
qywxService.deleteDept(deptId, school.getDeptId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 发送消息给rabbitmq
|
||||
rabbitUtil.convertAndSendMsg(RabbitConstant.QYWX_HANDLE_EXCHANGE, RabbitConstant.QYWX_HANDLE_KEY,
|
||||
QywxCallbackHandleDTO.builder()
|
||||
.root(root)
|
||||
.school(school)
|
||||
.providerSchool(providerSchool)
|
||||
.qywxCallbackTypeEnum(QywxCallbackTypeEnum.POST_EVENT)
|
||||
.build()
|
||||
);
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
|
||||
-246
@@ -1,246 +0,0 @@
|
||||
package com.yida.data.system.service.impl;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.yida.data.common.core.entity.constant.AppConstant;
|
||||
import com.yida.data.common.core.entity.constant.QywxConstant;
|
||||
import com.yida.data.common.core.entity.constant.QywxServiceProviderConstant;
|
||||
import com.yida.data.common.core.entity.system.Dept;
|
||||
import com.yida.data.common.core.entity.system.EduApp;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
|
||||
import com.yida.data.common.core.entity.system.EduQywxServiceProviderSchool;
|
||||
import com.yida.data.common.core.utils.WxUtil;
|
||||
import com.yida.data.common.service.CommonService;
|
||||
import com.yida.data.system.dto.QywxCallbackHandleDTO;
|
||||
import com.yida.data.system.service.QywxHandleService;
|
||||
import com.yida.data.system.service.QywxService;
|
||||
import com.yida.data.system.service.QywxServiceProviderService;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
/**
|
||||
* 企业微信回调mq处理类
|
||||
*
|
||||
* @author ZYJ
|
||||
* @date 2023/10/27 16:43
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class QywxHandleServiceImpl implements QywxHandleService {
|
||||
|
||||
private final QywxService qywxService;
|
||||
private final QywxServiceProviderService qywxServiceProviderService;
|
||||
|
||||
private final WxUtil wxUtil;
|
||||
private final CommonService commonService;
|
||||
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
public void handlePostCallback(QywxCallbackHandleDTO dto) {
|
||||
Element root = dto.getRoot();
|
||||
String corpId = dto.getCorpId();
|
||||
Dept school = dto.getSchool();
|
||||
|
||||
NodeList nodeList1 = root.getElementsByTagName("ChangeType");
|
||||
String changeType = nodeList1.item(0).getTextContent();
|
||||
|
||||
NodeList nodeList2 = root.getElementsByTagName("Event");
|
||||
String event = nodeList2.item(0).getTextContent();
|
||||
|
||||
if (QywxConstant.SCHOOL_CONTACT_EVENT.equals(event)) {
|
||||
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.CONTACT_SCHOOL, null, school.getDeptId());
|
||||
String id = root.getElementsByTagName("Id").item(0).getTextContent();
|
||||
|
||||
switch (changeType) {
|
||||
case QywxConstant.SCHOOL_DEPT_CREATE_TYPE:
|
||||
qywxService.createSchoolDept(corpId, wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), Long.valueOf(id), school);
|
||||
break;
|
||||
case QywxConstant.SCHOOL_DEPT_UPDATE_TYPE:
|
||||
qywxService.updateSchoolDept(wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), Long.valueOf(id), school);
|
||||
break;
|
||||
case QywxConstant.SCHOOL_DEPT_DELETE_TYPE:
|
||||
qywxService.deleteSchoolDept(Long.valueOf(id), school);
|
||||
break;
|
||||
case QywxConstant.STUDENT_CREATE_TYPE:
|
||||
case QywxConstant.STUDENT_UPDATE_TYPE:
|
||||
qywxService.changeStudent(wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), id, school);
|
||||
break;
|
||||
case QywxConstant.STUDENT_DELETE_TYPE:
|
||||
qywxService.deleteStudent(id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_CREATE_TYPE:
|
||||
// 新增家长可能是创建学生时创建,等待2s确保学生创建完成
|
||||
ThreadUtil.sleep(2000);
|
||||
case QywxConstant.PARENT_UPDATE_TYPE:
|
||||
qywxService.updateParent(wxUtil.getAccessToken(app.getWxCorpId(),
|
||||
app.getWxSecret()), id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_DELETE_TYPE:
|
||||
qywxService.deleteParent(id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_SUBSCRIBE_TYPE:
|
||||
log.info("进入家长关注事件回调");
|
||||
// 调用家长关注发送通知方法
|
||||
qywxService.sendParentSubscribeMessage(id, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.PARENT_UNSUBSCRIBE_TYPE:
|
||||
log.info("进入家长取消关注事件回调");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (QywxConstant.CONTACT_EVENT.equals(event)) {
|
||||
String userid = null, phone = null, name = null, gender = null, avatar = null, department = null,
|
||||
isLeader = null, mainDepartment = null, email = null;
|
||||
if (root.getElementsByTagName("UserID").getLength() != 0) {
|
||||
userid = root.getElementsByTagName("UserID").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Mobile").getLength() != 0) {
|
||||
phone = root.getElementsByTagName("Mobile").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Name").getLength() != 0) {
|
||||
name = root.getElementsByTagName("Name").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Gender").getLength() != 0) {
|
||||
gender = root.getElementsByTagName("Gender").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Avatar").getLength() != 0) {
|
||||
avatar = root.getElementsByTagName("Avatar").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Department").getLength() != 0) {
|
||||
department = root.getElementsByTagName("Department").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("IsLeaderInDept").getLength() != 0) {
|
||||
isLeader = root.getElementsByTagName("IsLeaderInDept").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("MainDepartment").getLength() != 0) {
|
||||
mainDepartment = root.getElementsByTagName("MainDepartment").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Email").getLength() != 0) {
|
||||
email = root.getElementsByTagName("Email").item(0).getTextContent();
|
||||
}
|
||||
|
||||
|
||||
String deptId = null, deptName = null, deptParentId = null, order = null;
|
||||
if (root.getElementsByTagName("Id").getLength() != 0) {
|
||||
deptId = root.getElementsByTagName("Id").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Name").getLength() != 0) {
|
||||
deptName = root.getElementsByTagName("Name").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("ParentId").getLength() != 0) {
|
||||
deptParentId = root.getElementsByTagName("ParentId").item(0).getTextContent();
|
||||
}
|
||||
if (root.getElementsByTagName("Order").getLength() != 0) {
|
||||
order = root.getElementsByTagName("Order").item(0).getTextContent();
|
||||
}
|
||||
|
||||
switch (changeType) {
|
||||
case QywxConstant.USER_CREATE_TYPE:
|
||||
qywxService.createUser(name, userid, phone, email, gender, avatar, department, isLeader,
|
||||
mainDepartment, school);
|
||||
break;
|
||||
case QywxConstant.USER_UPDATE_TYPE:
|
||||
qywxService.updateUser(name, userid, phone, email, gender, avatar, department, isLeader,
|
||||
mainDepartment, school);
|
||||
break;
|
||||
case QywxConstant.USER_DELETE_TYPE:
|
||||
qywxService.deleteUser(userid, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.DEPT_CREATE_TYPE:
|
||||
qywxService.createDept(deptId, deptName, deptParentId, order, school);
|
||||
break;
|
||||
case QywxConstant.DEPT_UPDATE_TYPE:
|
||||
qywxService.updateDept(deptId, deptName, deptParentId, school.getDeptId());
|
||||
break;
|
||||
case QywxConstant.DEPT_DELETE_TYPE:
|
||||
qywxService.deleteDept(deptId, school.getDeptId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
public void handlePostNormalCallback(QywxCallbackHandleDTO dto) {
|
||||
Element root = dto.getRoot();
|
||||
EduQywxServiceProvider serviceProvider = dto.getEduQywxServiceProvider();
|
||||
|
||||
// 通知消息类型
|
||||
NodeList nodeList = root.getElementsByTagName("InfoType");
|
||||
String infoType = nodeList.item(0).getTextContent();
|
||||
// 模板id
|
||||
NodeList nodeListSuiteId = root.getElementsByTagName("SuiteId");
|
||||
String suiteId = nodeListSuiteId.item(0).getTextContent();
|
||||
// 通讯录变更
|
||||
if (QywxConstant.CONTACT_EVENT.equals(infoType)) {
|
||||
log.info("模板回调进入通讯录变更事件");
|
||||
qywxServiceProviderService.handleConcat(root, serviceProvider, suiteId);
|
||||
}
|
||||
switch (infoType) {
|
||||
// 安装应用授权
|
||||
case QywxServiceProviderConstant.SERVICE_CREATE_AUTH:
|
||||
// 临时授权码
|
||||
NodeList nodeListAuthCode = root.getElementsByTagName("AuthCode");
|
||||
String authCode = nodeListAuthCode.item(0).getTextContent();
|
||||
qywxServiceProviderService.installTemplateApp(suiteId, authCode, serviceProvider);
|
||||
break;
|
||||
// 客户删除应用
|
||||
case QywxServiceProviderConstant.SERVICE_CANCEL_AUTH:
|
||||
// 授权企业加密corpId
|
||||
NodeList nodeListAuthCorpId = root.getElementsByTagName("AuthCorpId");
|
||||
String authCorpId = nodeListAuthCorpId.item(0).getTextContent();
|
||||
qywxServiceProviderService.deleteTemplateApp(suiteId, authCorpId, serviceProvider);
|
||||
break;
|
||||
// 待开发应用模板suite_ticket
|
||||
case QywxServiceProviderConstant.TEMPLATE_SUITE_TICKET:
|
||||
// 模板id
|
||||
NodeList nodeListTicket = root.getElementsByTagName("SuiteTicket");
|
||||
String suiteTicket = nodeListTicket.item(0).getTextContent();
|
||||
qywxServiceProviderService.handleTemplateSuiteTicket(suiteId, suiteTicket);
|
||||
break;
|
||||
// 代开发应用重置secret
|
||||
case QywxServiceProviderConstant.RESET_PERMANENT_CODE:
|
||||
// 临时授权码
|
||||
NodeList nodeListResetAuthCode = root.getElementsByTagName("AuthCode");
|
||||
String resetAuthCode = nodeListResetAuthCode.item(0).getTextContent();
|
||||
qywxServiceProviderService.resetTemplateAppAuthCode(suiteId, resetAuthCode, serviceProvider);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
public void handlePostEventCallback(QywxCallbackHandleDTO dto) {
|
||||
Element root = dto.getRoot();
|
||||
Dept school = dto.getSchool();
|
||||
EduQywxServiceProviderSchool providerSchool = dto.getProviderSchool();
|
||||
|
||||
NodeList nodeListEvent = root.getElementsByTagName("Event");
|
||||
String event = nodeListEvent.item(0).getTextContent();
|
||||
|
||||
if (QywxConstant.SCHOOL_CONTACT_EVENT.equals(event)) {
|
||||
log.info("进入家校沟通通讯录处理事件");
|
||||
qywxServiceProviderService.handleSchoolConcat(root, providerSchool, school);
|
||||
}
|
||||
// 通讯录变更
|
||||
if (QywxConstant.CONTACT_EVENT.equals(event)) {
|
||||
log.info("进入通讯录变更事件");
|
||||
qywxServiceProviderService.handleConcat(root, providerSchool);
|
||||
}
|
||||
}
|
||||
}
|
||||
+37
-188
@@ -95,7 +95,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
}
|
||||
|
||||
EduApp app = eduAppMapper.selectOne(Wrappers.lambdaQuery(new EduApp()).eq(EduApp::getDeptId,
|
||||
schoolId).eq(EduApp::getCode, AppConstant.CONTACT_SCHOOL));
|
||||
schoolId).eq(EduApp::getName, AppConstant.CONTACT_SCHOOL));
|
||||
List<Map> deptList = wxUtil.listSchoolDept(wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret()), null);
|
||||
List<EduUserDept> camps = new ArrayList<>();
|
||||
List<EduUserDept> section = new ArrayList<>();
|
||||
@@ -113,7 +113,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
dept.setDeptType(Integer.valueOf(map.get("type").toString()));
|
||||
dept.setDeptName(map.get("name").toString());
|
||||
dept.setSchoolId(schoolId);
|
||||
dept.setParentId(-schoolId);
|
||||
dept.setParentId(schoolId);
|
||||
switch (dept.getDeptType()) {
|
||||
case 1:
|
||||
// 班级
|
||||
@@ -164,8 +164,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
wxIdAndDaHuaId.put(dept.getWxId(), dept.getDaHuaId());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(teacherList.get(dept.getWxId()))) {
|
||||
remoteTeacherService.dealWxTeacherChange(schoolId, dept.getDeptId(), null, null, null,
|
||||
teacherList.get(dept.getWxId()), dept.getWxId());
|
||||
remoteTeacherService.dealWxTeacherChange(schoolId, dept.getDeptId(), null, null, null, teacherList.get(dept.getWxId()));
|
||||
}
|
||||
}
|
||||
for (EduUserDept dept : section) {
|
||||
@@ -182,8 +181,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
for (EduUserDept dept : section) {
|
||||
wxIdAndId.put(dept.getWxId(), dept.getDeptId());
|
||||
if (CollUtil.isNotEmpty(teacherList.get(dept.getWxId()))) {
|
||||
remoteTeacherService.dealWxTeacherChange(schoolId, dept.getParentId(), dept.getDeptId(), null, null,
|
||||
teacherList.get(dept.getWxId()), dept.getWxId());
|
||||
remoteTeacherService.dealWxTeacherChange(schoolId, dept.getParentId(), dept.getDeptId(), null, null, teacherList.get(dept.getWxId()));
|
||||
}
|
||||
}
|
||||
for (EduUserDept dept : grade) {
|
||||
@@ -206,7 +204,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
dept.getParentId(),
|
||||
dept.getDeptId(),
|
||||
null,
|
||||
teacherList.get(dept.getWxId()), dept.getWxId());
|
||||
teacherList.get(dept.getWxId()));
|
||||
}
|
||||
}
|
||||
for (EduUserDept dept : clazz) {
|
||||
@@ -226,7 +224,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
deptParent.get(dept.getParentId()),
|
||||
dept.getParentId(),
|
||||
dept.getDeptId(),
|
||||
teacherList.get(dept.getWxId()), dept.getWxId());
|
||||
teacherList.get(dept.getWxId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,7 +354,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
public void initUser(Long schoolId, CurrentUser currentUser) {
|
||||
Dept school = deptService.getById(schoolId);
|
||||
EduApp app = eduAppMapper.selectOne(Wrappers.lambdaQuery(new EduApp()).eq(EduApp::getDeptId,
|
||||
schoolId).eq(EduApp::getCode, AppConstant.CONTACT_SCHOOL));
|
||||
schoolId).eq(EduApp::getName, AppConstant.CONTACT_SCHOOL));
|
||||
JSONArray student = wxUtil.getStudentList(wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret()),
|
||||
1L);
|
||||
int size = 2;
|
||||
@@ -491,10 +489,8 @@ public class QywxServiceImpl implements QywxService {
|
||||
List<EduUserDept> saveDeptList = new ArrayList<>();
|
||||
List<Map> deptList = wxUtil.listSchoolDept(accessToken, deptWxId);
|
||||
for (Map map : deptList) {
|
||||
// 查询的家校部门数据的部门id
|
||||
Long wxDeptId = Long.valueOf(map.get("id").toString());
|
||||
EduUserDept dept = remoteUserDeptService.getUserDeptByDeptAndWx(
|
||||
Collections.singletonList(-school.getDeptId()), wxDeptId).getData();
|
||||
EduUserDept dept = remoteUserDeptService.getUserDeptByDeptAndWx(Collections.singletonList(-school.getDeptId()),
|
||||
Long.valueOf(map.get("id").toString())).getData();
|
||||
dept.setDeptName((String) map.get("name"));
|
||||
if (ObjectUtil.isNotNull(map.get("order"))) {
|
||||
dept.setOrderNum((Integer) map.get("order"));
|
||||
@@ -509,7 +505,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
classId = dept.getDeptId();
|
||||
gradeId = dept.getParentId();
|
||||
// 查询学段信息
|
||||
EduUserDept section = remoteUserDeptService.getParentByDeptId(gradeId).getData();
|
||||
EduUserDept section = this.remoteUserDeptService.getParentByDeptId(gradeId).getData();
|
||||
sectionId = section.getDeptId();
|
||||
campusId = section.getParentId();
|
||||
break;
|
||||
@@ -517,7 +513,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
// 年级
|
||||
gradeId = dept.getDeptId();
|
||||
sectionId = dept.getParentId();
|
||||
campusId = remoteUserDeptService.getByDeptId(sectionId).getData().getParentId();
|
||||
campusId = this.remoteUserDeptService.getByDeptId(sectionId).getData().getParentId();
|
||||
break;
|
||||
case 3:
|
||||
// 学段
|
||||
@@ -529,18 +525,13 @@ public class QywxServiceImpl implements QywxService {
|
||||
campusId = dept.getDeptId();
|
||||
break;
|
||||
default:
|
||||
log.error("家校部门类型错误, 部门信息:{}", dept);
|
||||
log.error("家校部门类型错误: {}", dept.getDeptType());
|
||||
break;
|
||||
}
|
||||
// 仅处理当前部门负责人
|
||||
if (deptWxId.equals(wxDeptId)) {
|
||||
// 获取老师列表
|
||||
List<Map> teacherList = (List<Map>) map.get("department_admins");
|
||||
log.info("teachers:{},dept:{}", teacherList, dept);
|
||||
if (CollUtil.isNotEmpty(teacherList)) {
|
||||
remoteTeacherService.dealWxTeacherChange(school.getDeptId(), campusId, sectionId, gradeId, classId, teacherList, deptWxId);
|
||||
}
|
||||
}
|
||||
// 获取老师列表
|
||||
List<Map> teacherList = (List<Map>) map.get("department_admins");
|
||||
log.info("teachers:{},dept:{}", teacherList, dept);
|
||||
remoteTeacherService.dealWxTeacherChange(school.getDeptId(), campusId, sectionId, gradeId, classId, teacherList);
|
||||
saveDeptList.add(dept);
|
||||
// 更新大华部门
|
||||
if (school.getSchoolType().contains(Dept.TYPE_DAHUA)) {
|
||||
@@ -548,15 +539,14 @@ public class QywxServiceImpl implements QywxService {
|
||||
if (UserDeptTypeEnum.CAMPUS_TYPE.getValue().equals(dept.getDeptType())) {
|
||||
// 学区的上级大华id是学校大华id
|
||||
parentDaHuaId = school.getDahuaId();
|
||||
} else {
|
||||
EduUserDept parent = remoteUserDeptService.getByDeptId(dept.getParentId()).getData();
|
||||
} else {
|
||||
EduUserDept parent = this.remoteUserDeptService.getByDeptId(dept.getParentId()).getData();
|
||||
parentDaHuaId = parent.getDaHuaId();
|
||||
}
|
||||
DaHuaUtil.updateDept(dept.getDaHuaId(), parentDaHuaId, dept.getDeptName());
|
||||
}
|
||||
}
|
||||
remoteUserDeptService.updateBatchUserDept(saveDeptList);
|
||||
log.info("修改家校部门完成");
|
||||
this.remoteUserDeptService.updateBatchUserDept(saveDeptList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -569,7 +559,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
log.info("params:{},{},{}", deptWxId, -school.getDeptId(), userDept);
|
||||
if (userDept != null) {
|
||||
// 未在其他删除回调事件中被删除
|
||||
remoteUserDeptService.deleteUserDeptRecur(
|
||||
this.remoteUserDeptService.deleteUserDeptRecur(
|
||||
DeleteUserDeptDTO.builder()
|
||||
.deptIdList(Collections.singletonList(userDept.getDeptId()))
|
||||
.school(school)
|
||||
@@ -602,20 +592,14 @@ public class QywxServiceImpl implements QywxService {
|
||||
*/
|
||||
@Override
|
||||
public void updateDept(String deptId, String deptName, String parentId, Long schoolId) {
|
||||
Dept dept = deptService.getSysDeptByDeptAndWx(Collections.singletonList(schoolId), Long.valueOf(deptId));
|
||||
Dept dept = deptService.getSysDeptByDeptAndWx(Arrays.asList(schoolId), Long.valueOf(deptId));
|
||||
dept.setDeptName(deptName);
|
||||
// 部门类型
|
||||
dept.setDeptType(DeptTypeEnum.DEPARTMENT_TYPE.getValue());
|
||||
dept.setWxId(Long.valueOf(deptId));
|
||||
if (StrUtil.isNotBlank(parentId)) {
|
||||
Dept parent;
|
||||
Long parentWxId = Long.valueOf(parentId);
|
||||
if (parentWxId == 1L) {
|
||||
parent = deptService.getById(schoolId);
|
||||
} else {
|
||||
parent = deptService.getSysDeptByDeptAndWx(Collections.singletonList(schoolId), parentWxId);
|
||||
}
|
||||
dept.setParentWxId(parentWxId);
|
||||
if (parentId != null) {
|
||||
Dept parent = deptService.getSysDeptByDeptAndWx(Arrays.asList(schoolId), Long.valueOf(parentId));
|
||||
dept.setParentWxId(Long.valueOf(parentId));
|
||||
dept.setParentId(parent.getDeptId());
|
||||
dept.setAreaId(parent.getAreaId());
|
||||
}
|
||||
@@ -685,7 +669,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
log.info("学生所属部门,student:{},deptId:{},wxId:{}", student, Objects.requireNonNull(dept).getDeptId(), deptWxId);
|
||||
|
||||
EduStudent eduStudent = new EduStudent();
|
||||
// eduStudent.setType(0);
|
||||
eduStudent.setType(0);
|
||||
eduStudent.setStuName(student.get("name").toString());
|
||||
// 班级信息
|
||||
eduStudent.setClassId(dept.getDeptId());
|
||||
@@ -825,88 +809,6 @@ public class QywxServiceImpl implements QywxService {
|
||||
remoteTeacherService.saveStaffBySchoolAndWx(eduStaff);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 响应更新企业用户事件
|
||||
// */
|
||||
// @Override
|
||||
// public void updateUser(String name, String wxId, String phone, String email,
|
||||
// String gender, String avatar, String department, String isLeader,
|
||||
// String mainDepartment, Dept school) {
|
||||
// EduStaff eduStaff = new EduStaff();
|
||||
// if (StrUtil.isNotBlank(phone)) {
|
||||
// SystemUser user = userService.findByName(phone);
|
||||
// if (user == null) {
|
||||
// user = new SystemUser();
|
||||
// user.setAvatar(avatar);
|
||||
// user.setMobile(phone);
|
||||
// user.setEmail(email);
|
||||
// user.setUsername(StrUtil.isNotBlank(phone) ? phone : email);
|
||||
// user.setNickname(name);
|
||||
// user.setDeptId(school.getDeptId());
|
||||
// user.setStatus("1");
|
||||
// user.setSex("1".equals(gender) ? "0" : "2".equals(gender) ? "1" : "2");
|
||||
// user.setUserOrigin(0);
|
||||
// user.setTeacherWxId(wxId);
|
||||
// user.setUserType(1);
|
||||
// userService.createUser(user);
|
||||
// eduStaff.setYidaAppUserId(user.getYidaAppUserId());
|
||||
// }
|
||||
// eduStaff.setSysUserId(user.getUserId());
|
||||
// } else {
|
||||
// SystemUser user =
|
||||
// userService.getOne(Wrappers.lambdaQuery(new SystemUser()).eq(SystemUser::getTeacherWxId
|
||||
// , wxId).eq(SystemUser::getDeptId, school.getDeptId()));
|
||||
// if (user == null) {
|
||||
// user = new SystemUser();
|
||||
// user.setAvatar(avatar);
|
||||
// user.setMobile(phone);
|
||||
// user.setEmail(email);
|
||||
// user.setUsername(StrUtil.isNotBlank(phone) ? phone : email);
|
||||
// user.setNickname(name);
|
||||
// user.setDeptId(school.getDeptId());
|
||||
// user.setStatus("1");
|
||||
// user.setSex("1".equals(gender) ? "0" : "2".equals(gender) ? "1" : "2");
|
||||
// user.setUserOrigin(0);
|
||||
// user.setTeacherWxId(wxId);
|
||||
// user.setUserType(1);
|
||||
// userService.createUser(user);
|
||||
// eduStaff.setYidaAppUserId(user.getYidaAppUserId());
|
||||
// }
|
||||
// eduStaff.setSysUserId(user.getUserId());
|
||||
// }
|
||||
// eduStaff.setWxId(wxId);
|
||||
// eduStaff.setMobile(phone);
|
||||
// eduStaff.setName(name);
|
||||
// eduStaff.setAvatar(avatar);
|
||||
// eduStaff.setSchoolId(school.getDeptId());
|
||||
// eduStaff.setSchoolName(school.getDeptName());
|
||||
// eduStaff.setSex("1".equals(gender) ? "0" : "2".equals(gender) ? "1" : "2");
|
||||
//
|
||||
// // 成员部门信息
|
||||
// String[] departmentList = StrUtil.split(department, ",");
|
||||
// String[] isLeaderList = StrUtil.split(isLeader, ",");
|
||||
// if (ArrayUtil.isNotEmpty(departmentList)) {
|
||||
// List<EduStaffDept> staffDeptList = new ArrayList<>();
|
||||
// for (int i = 0; i < departmentList.length; i++) {
|
||||
// // 成员的每个部门信息
|
||||
// EduStaffDept staffDept = new EduStaffDept();
|
||||
// staffDept.setStaffName(eduStaff.getName());
|
||||
// staffDept.setDeptWxId(Long.valueOf(departmentList[i]));
|
||||
// Dept sysDept = ("1".equals(departmentList[i])
|
||||
// ? school
|
||||
// : deptService.getSysDeptByDeptAndWx(Arrays.asList(school.getDeptId()), staffDept.getDeptWxId()));
|
||||
// staffDept.setDeptId(sysDept.getDeptId());
|
||||
// staffDept.setDeptName(sysDept.getDeptName());
|
||||
// staffDept.setIsLeader(Integer.valueOf(isLeaderList[i]));
|
||||
// staffDept.setIsMain(ObjectUtil.equal(mainDepartment,
|
||||
// departmentList[i]) ? 0 : 1);
|
||||
// staffDeptList.add(staffDept);
|
||||
// }
|
||||
// eduStaff.setStaffDept(staffDeptList);
|
||||
// }
|
||||
// remoteTeacherService.saveStaffBySchoolAndWx(eduStaff);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 响应更新企业用户事件
|
||||
*/
|
||||
@@ -914,12 +816,9 @@ public class QywxServiceImpl implements QywxService {
|
||||
public void updateUser(String name, String wxId, String phone, String email,
|
||||
String gender, String avatar, String department, String isLeader,
|
||||
String mainDepartment, Dept school) {
|
||||
EduStaff eduStaff = remoteStaffService.getStaffByWxOrMobileOrOpenId(wxId, null, null, school.getDeptId()).getData();
|
||||
if (Objects.isNull(eduStaff)) {
|
||||
eduStaff = new EduStaff();
|
||||
}
|
||||
EduStaff eduStaff = new EduStaff();
|
||||
if (StrUtil.isNotBlank(phone)) {
|
||||
SystemUser user = userService.findByMobile(phone);
|
||||
SystemUser user = userService.findByName(phone);
|
||||
if (user == null) {
|
||||
user = new SystemUser();
|
||||
user.setAvatar(avatar);
|
||||
@@ -935,14 +834,12 @@ public class QywxServiceImpl implements QywxService {
|
||||
user.setUserType(1);
|
||||
userService.createUser(user);
|
||||
eduStaff.setYidaAppUserId(user.getYidaAppUserId());
|
||||
eduStaff.setSysUserId(user.getUserId());
|
||||
}
|
||||
eduStaff.setMobile(phone);
|
||||
eduStaff.setSysUserId(user.getUserId());
|
||||
} else {
|
||||
SystemUser user = null;
|
||||
if (Objects.nonNull(eduStaff.getId())) {
|
||||
user = userService.getById(eduStaff.getSysUserId());
|
||||
}
|
||||
SystemUser user =
|
||||
userService.getOne(Wrappers.lambdaQuery(new SystemUser()).eq(SystemUser::getTeacherWxId
|
||||
, wxId).eq(SystemUser::getDeptId, school.getDeptId()));
|
||||
if (user == null) {
|
||||
user = new SystemUser();
|
||||
user.setAvatar(avatar);
|
||||
@@ -958,21 +855,16 @@ public class QywxServiceImpl implements QywxService {
|
||||
user.setUserType(1);
|
||||
userService.createUser(user);
|
||||
eduStaff.setYidaAppUserId(user.getYidaAppUserId());
|
||||
eduStaff.setSysUserId(user.getUserId());
|
||||
}
|
||||
eduStaff.setSysUserId(user.getUserId());
|
||||
}
|
||||
eduStaff.setWxId(wxId);
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
eduStaff.setName(name);
|
||||
}
|
||||
if (StrUtil.isNotBlank(avatar)) {
|
||||
eduStaff.setAvatar(avatar);
|
||||
}
|
||||
eduStaff.setMobile(phone);
|
||||
eduStaff.setName(name);
|
||||
eduStaff.setAvatar(avatar);
|
||||
eduStaff.setSchoolId(school.getDeptId());
|
||||
eduStaff.setSchoolName(school.getDeptName());
|
||||
if (StrUtil.isNotBlank(gender)) {
|
||||
eduStaff.setSex("1".equals(gender) ? "0" : "2".equals(gender) ? "1" : "2");
|
||||
}
|
||||
eduStaff.setSex("1".equals(gender) ? "0" : "2".equals(gender) ? "1" : "2");
|
||||
|
||||
// 成员部门信息
|
||||
String[] departmentList = StrUtil.split(department, ",");
|
||||
@@ -1017,7 +909,7 @@ public class QywxServiceImpl implements QywxService {
|
||||
*/
|
||||
@Override
|
||||
public void sendParentSubscribeMessage(String parentId, Long schoolId) {
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.INDEX_PARENT, null, schoolId);
|
||||
EduApp app = commonService.getAppByCodeAndSchool(AppConstant.SCORE_PARENT, null, schoolId);
|
||||
// 创建发送通知实体类
|
||||
TextSchoolNotice textSchoolNotice = new TextSchoolNotice();
|
||||
// 传入被通知的家长id
|
||||
@@ -1041,47 +933,4 @@ public class QywxServiceImpl implements QywxService {
|
||||
log.error("家长关注发送通知方法失败, 当前学校-->{} 没有默认消息数据: ", schoolId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserInfo(String userId, Dept school, EduApp app) {
|
||||
// 查询用户详细信息
|
||||
JSONObject userDetail = wxUtil.getUserDetail(wxUtil.getAccessToken(app.getWxCorpId(), app.getWxSecret()), userId);
|
||||
// 查询职工数据
|
||||
EduStaff eduStaff = remoteStaffService.getStaffByWxOrMobileOrOpenId(userId, null, null, school.getDeptId()).getData();
|
||||
if (Objects.isNull(eduStaff)) {
|
||||
log.error("职工信息错误, userId: {}, schoolId: {}", userId, school.getDeptId());
|
||||
return;
|
||||
}
|
||||
String name = userDetail.getStr("name");
|
||||
eduStaff.setName(name);
|
||||
// 职位
|
||||
eduStaff.setPosition(userDetail.getStr("position"));
|
||||
|
||||
// 成员部门信息
|
||||
JSONArray departmentList = userDetail.getJSONArray("department");
|
||||
JSONArray leaderInDept = userDetail.getJSONArray("is_leader_in_dept");
|
||||
// 主部门信息
|
||||
String mainDepartment = userDetail.getStr("main_department");
|
||||
if (ArrayUtil.isNotEmpty(departmentList)) {
|
||||
List<EduStaffDept> staffDeptList = new ArrayList<>();
|
||||
for (int i = 0; i < departmentList.size(); i++) {
|
||||
// 部门id
|
||||
String deptId = String.valueOf(departmentList.get(i));
|
||||
// 成员的每个部门信息
|
||||
EduStaffDept staffDept = new EduStaffDept();
|
||||
staffDept.setStaffName(eduStaff.getName());
|
||||
staffDept.setDeptWxId(Long.valueOf(deptId));
|
||||
Dept sysDept = ("1".equals(deptId)
|
||||
? school
|
||||
: deptService.getSysDeptByDeptAndWx(Collections.singletonList(school.getDeptId()), staffDept.getDeptWxId()));
|
||||
staffDept.setDeptId(sysDept.getDeptId());
|
||||
staffDept.setDeptName(sysDept.getDeptName());
|
||||
staffDept.setIsLeader(Integer.valueOf(String.valueOf(leaderInDept.get(i))));
|
||||
staffDept.setIsMain(ObjectUtil.equal(mainDepartment, deptId) ? 0 : 1);
|
||||
staffDeptList.add(staffDept);
|
||||
}
|
||||
eduStaff.setStaffDept(staffDeptList);
|
||||
}
|
||||
remoteTeacherService.saveStaffBySchoolAndWx(eduStaff);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user