Commit 3ff150e851455cc9cd77bf595951d0b5d1b2974b

Authored by 陈杰
1 parent 7a375a4f
Exists in master

1

cloud/common/src/main/java/com/sincere/common/dto/smartCampus/TemplateDto.java
@@ -10,10 +10,19 @@ import java.io.Serializable; @@ -10,10 +10,19 @@ import java.io.Serializable;
10 public class TemplateDto implements Serializable { 10 public class TemplateDto implements Serializable {
11 11
12 private int id ; 12 private int id ;
  13 + private String title ;
13 private String config ; 14 private String config ;
14 private int schoolId ; 15 private int schoolId ;
15 private String type ; 16 private String type ;
16 17
  18 + public String getTitle() {
  19 + return title;
  20 + }
  21 +
  22 + public void setTitle(String title) {
  23 + this.title = title;
  24 + }
  25 +
17 public int getId() { 26 public int getId() {
18 return id; 27 return id;
19 } 28 }
cloud/common/src/main/java/com/sincere/common/util/HttpClientUtils.java
@@ -37,7 +37,7 @@ public class HttpClientUtils { @@ -37,7 +37,7 @@ public class HttpClientUtils {
37 37
38 static { 38 static {
39 // 设置请求和传输超时时间 39 // 设置请求和传输超时时间
40 - requestConfig = RequestConfig.custom().setSocketTimeout(2000).setConnectTimeout(2000).build(); 40 + requestConfig = RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000).build();
41 } 41 }
42 42
43 public static void main(String[] args){ 43 public static void main(String[] args){
@@ -159,6 +159,33 @@ public class HttpClientUtils { @@ -159,6 +159,33 @@ public class HttpClientUtils {
159 return jsonResult; 159 return jsonResult;
160 } 160 }
161 161
  162 + public static String httpGet2(String url) {
  163 + // get请求返回结果
  164 + JSONObject jsonResult = null;
  165 + String result = "" ;
  166 + CloseableHttpClient client = HttpClients.createDefault();
  167 + // 发送get请求
  168 + HttpGet request = new HttpGet(url);
  169 + request.setConfig(requestConfig);
  170 + try {
  171 + CloseableHttpResponse response = client.execute(request);
  172 + // 请求发送成功,并得到响应
  173 + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
  174 + // 读取服务器返回过来的json字符串数据
  175 + HttpEntity entity = response.getEntity();
  176 + String strResult = EntityUtils.toString(entity, "utf-8");
  177 + // 把json字符串转换成json对象
  178 + //jsonResult = JSONObject.parseObject(strResult);
  179 + result = strResult;
  180 + }
  181 + } catch (IOException e) {
  182 +
  183 + } finally {
  184 + request.releaseConnection();
  185 + }
  186 + return result;
  187 + }
  188 +
162 189
163 public static InputStream GetFileInputStream(String fileUrl){ 190 public static InputStream GetFileInputStream(String fileUrl){
164 try{ 191 try{
cloud/common/src/main/java/com/sincere/common/util/Xml2JsonUtils.java
@@ -13,20 +13,6 @@ import java.util.List; @@ -13,20 +13,6 @@ import java.util.List;
13 */ 13 */
14 public class Xml2JsonUtils { 14 public class Xml2JsonUtils {
15 15
16 -  
17 - public static void main(String[] args) throws Exception {  
18 - String xmlStr=  
19 - "<JXT Name=\"TeacherInfo\">" +  
20 - "<resultInfo><userID>9943601</userID><name>abd</name><classID>05750400</classID><account>13388685716</account><cardID></cardID><cardID2></cardID2><cardID3></cardID3><cardID4></cardID4><cardID5></cardID5><career>校管理员</career><familyPhone1></familyPhone1><familyPhone2>0</familyPhone2><familyPhone3>0</familyPhone3><tempString></tempString><tempString2></tempString2><tempString3></tempString3></resultInfo>" +  
21 - "<resultInfo><userID>18639924</userID><name>计老师</name><classID>05750400-D000001</classID><account>15757371362</account><cardID></cardID><cardID2></cardID2><cardID3></cardID3><cardID4></cardID4><cardID5></cardID5><career>教师</career><familyPhone1></familyPhone1><familyPhone2>0</familyPhone2><familyPhone3>0</familyPhone3><tempString></tempString><tempString2></tempString2><tempString3></tempString3></resultInfo>" +  
22 - "<resultInfo><userID>30962787</userID><name>王佳奕1</name><classID>05750400-D000001</classID><account>13000000000</account><cardID></cardID><cardID2></cardID2><cardID3></cardID3><cardID4></cardID4><cardID5></cardID5><career>教师</career><familyPhone1></familyPhone1><familyPhone2>0</familyPhone2><familyPhone3>0</familyPhone3><tempString></tempString><tempString2></tempString2><tempString3></tempString3></resultInfo>" +  
23 - "</JXT>";  
24 - Document doc= DocumentHelper.parseText(xmlStr);  
25 - JSONObject json=new JSONObject();  
26 - dom4j2Json(doc.getRootElement(),json);  
27 - System.out.println("xml2Json:"+json.toJSONString());  
28 - }  
29 -  
30 /** 16 /**
31 * xml转json 17 * xml转json
32 * @param xmlStr 18 * @param xmlStr
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/controller/KqController.java
@@ -28,6 +28,7 @@ public class KqController { @@ -28,6 +28,7 @@ public class KqController {
28 for(KqTemplate kqTemplate : list){ 28 for(KqTemplate kqTemplate : list){
29 TemplateDto templateDto = new TemplateDto(); 29 TemplateDto templateDto = new TemplateDto();
30 templateDto.setId(kqTemplate.getId()); 30 templateDto.setId(kqTemplate.getId());
  31 + templateDto.setTitle(kqTemplate.getTitle());
31 templateDto.setConfig(kqTemplate.getConfig()); 32 templateDto.setConfig(kqTemplate.getConfig());
32 templateDto.setSchoolId(kqTemplate.getSchoolId()); 33 templateDto.setSchoolId(kqTemplate.getSchoolId());
33 templateDto.setType(kqTemplate.getType()); 34 templateDto.setType(kqTemplate.getType());
@@ -43,6 +44,7 @@ public class KqController { @@ -43,6 +44,7 @@ public class KqController {
43 for(KqTemplate kqTemplate : list){ 44 for(KqTemplate kqTemplate : list){
44 TemplateDto templateDto = new TemplateDto(); 45 TemplateDto templateDto = new TemplateDto();
45 templateDto.setId(kqTemplate.getId()); 46 templateDto.setId(kqTemplate.getId());
  47 + templateDto.setTitle(kqTemplate.getTitle());
46 templateDto.setConfig(kqTemplate.getConfig()); 48 templateDto.setConfig(kqTemplate.getConfig());
47 templateDto.setSchoolId(kqTemplate.getSchoolId()); 49 templateDto.setSchoolId(kqTemplate.getSchoolId());
48 templateDtos.add(templateDto); 50 templateDtos.add(templateDto);
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/model/KqTemplate.java
@@ -8,10 +8,19 @@ package com.sincere.smartSearch.model; @@ -8,10 +8,19 @@ package com.sincere.smartSearch.model;
8 public class KqTemplate { 8 public class KqTemplate {
9 9
10 private int id ; 10 private int id ;
  11 + private String title ;
11 private String config ; 12 private String config ;
12 private int schoolId ; 13 private int schoolId ;
13 private String type ; 14 private String type ;
14 15
  16 + public String getTitle() {
  17 + return title;
  18 + }
  19 +
  20 + public void setTitle(String title) {
  21 + this.title = title;
  22 + }
  23 +
15 public int getId() { 24 public int getId() {
16 return id; 25 return id;
17 } 26 }
cloud/search_smartCampus/src/main/resources/mapper/KqTemplateMapper.xml
@@ -4,13 +4,14 @@ @@ -4,13 +4,14 @@
4 4
5 <resultMap id="TemplateMap" type="com.sincere.smartSearch.model.KqTemplate"> 5 <resultMap id="TemplateMap" type="com.sincere.smartSearch.model.KqTemplate">
6 <result column="Id" property="id"/> 6 <result column="Id" property="id"/>
  7 + <result column="Title" property="title"/>
7 <result column="config" property="config"/> 8 <result column="config" property="config"/>
8 <result column="SchoolId" property="schoolId"/> 9 <result column="SchoolId" property="schoolId"/>
9 <result column="type" property="type"/> 10 <result column="type" property="type"/>
10 </resultMap> 11 </resultMap>
11 12
12 <select id="selectKqTemplate" resultMap="TemplateMap"> 13 <select id="selectKqTemplate" resultMap="TemplateMap">
13 - select XA_KqTemplate.Id , XA_KqTemplate.config , XA_KqTemplate.SchoolId ,SZ_School.MsgTypes as type from XA_KqTemplate 14 + select XA_KqTemplate.Id , XA_KqTemplate.Title , XA_KqTemplate.config , XA_KqTemplate.SchoolId ,SZ_School.MsgTypes as type from XA_KqTemplate
14 join SZ_School on XA_KqTemplate.SchoolId = SZ_School.school_id 15 join SZ_School on XA_KqTemplate.SchoolId = SZ_School.school_id
15 where XA_KqTemplate.State = 1 and XA_KqTemplate.TType = 1 16 where XA_KqTemplate.State = 1 and XA_KqTemplate.TType = 1
16 and (SZ_School.MsgTypes like '%4%' or SZ_School.MsgTypes like '%5%') 17 and (SZ_School.MsgTypes like '%4%' or SZ_School.MsgTypes like '%5%')
@@ -18,7 +19,7 @@ @@ -18,7 +19,7 @@
18 </select> 19 </select>
19 20
20 <select id="selectAllKqTemplate" resultMap="TemplateMap"> 21 <select id="selectAllKqTemplate" resultMap="TemplateMap">
21 - select XA_KqTemplate.Id , XA_KqTemplate.config , XA_KqTemplate.SchoolId from XA_KqTemplate 22 + select XA_KqTemplate.Id , XA_KqTemplate.Title , XA_KqTemplate.config , XA_KqTemplate.SchoolId from XA_KqTemplate
22 where XA_KqTemplate.State = 1 and XA_KqTemplate.TType = 1 23 where XA_KqTemplate.State = 1 and XA_KqTemplate.TType = 1
23 </select> 24 </select>
24 25
cloud/search_smartCampus/src/main/resources/mapper/SyncMapper.xml
@@ -63,35 +63,35 @@ @@ -63,35 +63,35 @@
63 <result column="yxyUserId" property="yxyUserId" /> 63 <result column="yxyUserId" property="yxyUserId" />
64 </resultMap> 64 </resultMap>
65 <select id="selectUser" parameterType="java.lang.Integer" resultMap="UserDtp"> 65 <select id="selectUser" parameterType="java.lang.Integer" resultMap="UserDtp">
66 - select HS_StudentUpdateCard.ID , HS_StudentUpdateCard.UserType , HS_StudentUpdateCard.Name , HS_StudentUpdateCard.ClassId , HS_StudentUpdateCard.CustomerId , HS_StudentUpdateCard.Sex , HS_StudentUpdateCard.mobile , HS_StudentUpdateCard.UpdateType , SZ_UserRelation.yxyUserId from HS_StudentUpdateCard  
67 - left join SZ_UserRelation on HS_StudentUpdateCard.CustomerId = SZ_UserRelation.hxyCustomerId 66 + select HS_StudentUpdateCard.ID , HS_StudentUpdateCard.UserType , HS_StudentUpdateCard.Name , HS_StudentUpdateCard.ClassId , HS_StudentUpdateCard.CustomerId , HS_StudentUpdateCard.Sex , HS_StudentUpdateCard.mobile , HS_StudentUpdateCard.UpdateType , YXY_UserRelation.yxyUserId from HS_StudentUpdateCard
  67 + left join YXY_UserRelation on HS_StudentUpdateCard.CustomerId = YXY_UserRelation.hxyCustomerId
68 where SchoolId =#{schoolId} and Yxy_IsNew = 0 68 where SchoolId =#{schoolId} and Yxy_IsNew = 0
69 </select> 69 </select>
70 70
71 <insert id="insertDeptRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto"> 71 <insert id="insertDeptRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto">
72 - insert into SZ_DeptRelation (hxyDeptId,yxyDeptId,usertype,updateTime,createTime,state) 72 + insert into YXY_DeptRelation (hxyDeptId,yxyDeptId,usertype,updateTime,createTime,state)
73 values (#{hxyDeptId},#{yxyDeptId},#{userType},GETDATE(),GETDATE(),#{state}) 73 values (#{hxyDeptId},#{yxyDeptId},#{userType},GETDATE(),GETDATE(),#{state})
74 </insert> 74 </insert>
75 75
76 <update id="updateDeptRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto"> 76 <update id="updateDeptRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto">
77 - update SZ_DeptRelation set updateTime = GETDATE() , state = #{state} where hxyDeptId = #{hxyDeptId} 77 + update YXY_DeptRelation set updateTime = GETDATE() , state = #{state} where hxyDeptId = #{hxyDeptId}
78 </update> 78 </update>
79 79
80 <select id="selectYxyIdByHxyId" parameterType="java.lang.Integer" resultType="java.lang.String"> 80 <select id="selectYxyIdByHxyId" parameterType="java.lang.Integer" resultType="java.lang.String">
81 - select yxyDeptId from SZ_DeptRelation where hxyDeptId = #{hxyDeptId} 81 + select yxyDeptId from YXY_DeptRelation where hxyDeptId = #{hxyDeptId}
82 </select> 82 </select>
83 83
84 84
85 <insert id="insertUserRelation" parameterType="com.sincere.common.dto.smartCampus.UserRelationDto"> 85 <insert id="insertUserRelation" parameterType="com.sincere.common.dto.smartCampus.UserRelationDto">
86 - insert into SZ_UserRelation (hxyCustomerId,yxyUserId,userType,updateTime,createTime,state) 86 + insert into YXY_UserRelation (hxyCustomerId,yxyUserId,userType,updateTime,createTime,state)
87 values (#{hxyCustomerId},#{yxyUserId},#{userType},GETDATE(),GETDATE(),#{state}) 87 values (#{hxyCustomerId},#{yxyUserId},#{userType},GETDATE(),GETDATE(),#{state})
88 </insert> 88 </insert>
89 89
90 <update id="updateUserRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto"> 90 <update id="updateUserRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto">
91 - update SZ_UserRelation set updateTime = GETDATE() , state = #{state} where hxyCustomerId = #{hxyCustomerId} 91 + update YXY_UserRelation set updateTime = GETDATE() , state = #{state} where hxyCustomerId = #{hxyCustomerId}
92 </update> 92 </update>
93 93
94 <select id="selectUserYxyIdByHxyId" parameterType="java.lang.String" resultType="java.lang.String"> 94 <select id="selectUserYxyIdByHxyId" parameterType="java.lang.String" resultType="java.lang.String">
95 - select yxyUserId from SZ_UserRelation where hxyCustomerId = #{hxyCustomerId} 95 + select yxyUserId from YXY_UserRelation where hxyCustomerId = #{hxyCustomerId}
96 </select> 96 </select>
97 </mapper> 97 </mapper>
98 \ No newline at end of file 98 \ No newline at end of file