Kaynağa Gözat

Merge branch 'master' of https://git.jiinfo.cn/cmc-project/cmc_weixin_sap

liupeng 5 yıl önce
ebeveyn
işleme
5fae5cc850

+ 46 - 0
code/sapparent/sapcms/src/main/java/org/fouram/WebConfigurer.java

@@ -0,0 +1,46 @@
+package org.fouram;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+/**
+ * @description:
+ * @Author: Andy.Han
+ * @date: 2019-11-09
+ **/
+@Slf4j
+@Configuration
+public class WebConfigurer extends WebMvcConfigurationSupport {
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+
+    }
+
+    @Override
+    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("swagger-ui.html")
+                .addResourceLocations("classpath:/META-INF/resources/");
+        registry.addResourceHandler("/webjars/**")
+                .addResourceLocations("classpath:/META-INF/resources/webjars/");
+    }
+
+    /**
+     * 添加跨域请求支持
+     * @param registry
+     */
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        log.warn("开启跨域支持");
+        registry.addMapping("/**")
+                .allowedOrigins("*")
+                .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
+                .maxAge(3600)
+                .allowCredentials(true);
+        super.addCorsMappings(registry);
+    }
+}

+ 4 - 2
code/sapparent/sapcms/src/main/java/org/fouram/controller/ApiController.java

@@ -12,6 +12,7 @@ import org.fouram.core.util.ConfConfig;
 import org.fouram.core.util.LoggerUtil;
 import org.fouram.service.SapOrgService;
 import org.fouram.service.SapUserService;
+import org.fouram.service.TaskService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -30,9 +31,10 @@ public class ApiController extends BaseController {
 	private SapOrgService sapOrgService;
 	@Autowired
 	private SapUserService sapUserService;
+	@Autowired
+	private TaskService taskService;
 
 	private static final String TOKEN="UserId";
-
 	/**
 	 * 获取授权url
 	 * @return
@@ -92,7 +94,7 @@ public class ApiController extends BaseController {
 	 * 根据输入查询内容查询对应部门和用户
 	 * @return
 	 */
-	@RequestMapping(value = "/getDepartAndUserListByName", produces = "application/json;charset=utf-8")
+		@RequestMapping(value = "/getDepartAndUserListByName", produces = "application/json;charset=utf-8")
 	@ResponseBody
 	public Object getDepartAndUserListByName(HttpServletRequest request) {
 		if(!isLogin(request)){

+ 5 - 1
code/sapparent/sapservice/src/main/java/org/fouram/entity/SapUser.java

@@ -21,7 +21,9 @@ public class SapUser implements Serializable {
 
 	private String userId;
 	private String personId;
+	//邮箱
 	private String username;
+	//姓名
 	private String name;
 	private String firstOrgId;
 	private String secondOrgId;
@@ -38,8 +40,10 @@ public class SapUser implements Serializable {
 	private String position;
 	private String formatPosition;
 	private String mobile;
+	//手机
 	private String formatMobile;
 	private String businessPhone;
+	//座机
 	private String formatBusinessPhone;
 	private String gender;
 	private String email;
@@ -49,7 +53,7 @@ public class SapUser implements Serializable {
 	private Boolean delFlag;
 	private Date createDate;
 	private Integer sortNumber;
-	
+
 	private List<List<SapOrg>> departList;
 
 	public String toCompareString() {

+ 25 - 25
code/sapparent/sapservice/src/main/resources/spring/quartz.xml

@@ -4,33 +4,33 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
 	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc"
 	xsi:schemaLocation="
-	   http://www.springframework.org/schema/beans 
+	   http://www.springframework.org/schema/beans
 	   http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
-	   http://www.springframework.org/schema/tx 
-	   http://www.springframework.org/schema/tx/spring-tx-4.3.xsd 
-	   http://www.springframework.org/schema/aop 
+	   http://www.springframework.org/schema/tx
+	   http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
+	   http://www.springframework.org/schema/aop
 	   http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
-	   http://www.springframework.org/schema/context 
+	   http://www.springframework.org/schema/context
 	   http://www.springframework.org/schema/context/spring-context-4.3.xsd
-	   http://www.springframework.org/schema/mvc  
+	   http://www.springframework.org/schema/mvc
 	   http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd"
 	default-autowire="byName">
-	
-	<bean id="syncWeixinUserJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">  
-		<property name="targetObject" ref="taskService" />  
-		<property name="targetMethod" value="syncWeixinUser" />  
-		<property name="concurrent" value="false" />
-	</bean>
-	<bean id="syncWeixinUserTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">  
-		<property name="jobDetail" ref="syncWeixinUserJob" />
-		<property name="cronExpression" value="0 0 0/1 * * ?" />
-	</bean>
-	
-	<bean id="schedulerFactorys" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
-		<property name="triggers">
-			<list>
-				<ref bean="syncWeixinUserTrigger" />
-			</list>
-		</property>
-	</bean>
-</beans>
+
+<!--	<bean id="syncWeixinUserJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">  -->
+<!--		<property name="targetObject" ref="taskService" />  -->
+<!--		<property name="targetMethod" value="syncWeixinUser" />  -->
+<!--		<property name="concurrent" value="false" />-->
+<!--	</bean>-->
+<!--	<bean id="syncWeixinUserTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">  -->
+<!--		<property name="jobDetail" ref="syncWeixinUserJob" />-->
+<!--		<property name="cronExpression" value="0 0 0/1 * * ?" />-->
+<!--	</bean>-->
+<!--	-->
+<!--	<bean id="schedulerFactorys" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">-->
+<!--		<property name="triggers">-->
+<!--			<list>-->
+<!--				<ref bean="syncWeixinUserTrigger" />-->
+<!--			</list>-->
+<!--		</property>-->
+<!--	</bean>-->
+</beans>