|
@@ -1,10 +1,11 @@
|
|
package com.jpsoft.campus.modules.mobile.controller;
|
|
package com.jpsoft.campus.modules.mobile.controller;
|
|
|
|
|
|
|
|
|
|
-import com.jpsoft.campus.modules.base.entity.PersonInfo;
|
|
|
|
|
|
+import com.jpsoft.campus.modules.base.entity.*;
|
|
import com.jpsoft.campus.modules.base.service.*;
|
|
import com.jpsoft.campus.modules.base.service.*;
|
|
import com.jpsoft.campus.modules.common.dto.MessageResult;
|
|
import com.jpsoft.campus.modules.common.dto.MessageResult;
|
|
import com.jpsoft.campus.modules.common.utils.JwtUtil;
|
|
import com.jpsoft.campus.modules.common.utils.JwtUtil;
|
|
|
|
+import com.jpsoft.campus.modules.common.utils.StringUtils;
|
|
import com.jpsoft.campus.modules.sys.service.SysLogService;
|
|
import com.jpsoft.campus.modules.sys.service.SysLogService;
|
|
import com.wfl.uias.dto.JITObject;
|
|
import com.wfl.uias.dto.JITObject;
|
|
import com.wfl.uias.http.HttpClientExecutor;
|
|
import com.wfl.uias.http.HttpClientExecutor;
|
|
@@ -53,10 +54,21 @@ public class UiasApiController {
|
|
String code = (String)request.getParameter("code");
|
|
String code = (String)request.getParameter("code");
|
|
String appCode = (String)request.getParameter("appCode");
|
|
String appCode = (String)request.getParameter("appCode");
|
|
String state = (String)request.getParameter("state");
|
|
String state = (String)request.getParameter("state");
|
|
|
|
+ String p03 = (String)request.getParameter("p03");
|
|
|
|
+ String p04 = (String)request.getParameter("p04");
|
|
|
|
+ String p05 = (String)request.getParameter("p05");
|
|
|
|
+ String p06 = (String)request.getParameter("p06");
|
|
|
|
+ String p07 = (String)request.getParameter("p07");
|
|
|
|
+ String p08 = (String)request.getParameter("p08");
|
|
|
|
+ String p09 = (String)request.getParameter("p09");
|
|
|
|
+ String p10 = (String)request.getParameter("p10");
|
|
|
|
|
|
|
|
|
|
// String url = "http://wsbm.xiaoxinda.com/#/external/index" + "?code=" + code + "&state=" + state;
|
|
// String url = "http://wsbm.xiaoxinda.com/#/external/index" + "?code=" + code + "&state=" + state;
|
|
|
|
|
|
|
|
+ String html = "http://wsbm.xiaoxinda.com/#/external/index";
|
|
|
|
+ String mobile = "http://wsbm.xiaoxinda.com/#/external/mobile";
|
|
|
|
+
|
|
String token = uiasService.getToken(code);
|
|
String token = uiasService.getToken(code);
|
|
|
|
|
|
PersonInfo personInfo = personInfoService.findByUiasId(token);
|
|
PersonInfo personInfo = personInfoService.findByUiasId(token);
|
|
@@ -118,7 +130,13 @@ public class UiasApiController {
|
|
}
|
|
}
|
|
|
|
|
|
String personToken = JwtUtil.createToken(jwtSecret, String.valueOf(personInfo.getId()), DateTime.now().plusHours(6).toDate());
|
|
String personToken = JwtUtil.createToken(jwtSecret, String.valueOf(personInfo.getId()), DateTime.now().plusHours(6).toDate());
|
|
- String url = "http://wsbm.xiaoxinda.com/#/external/index" + "?token=" + personToken;
|
|
|
|
|
|
+
|
|
|
|
+ String url = html + "?token=" + personToken;
|
|
|
|
+
|
|
|
|
+ if("02".equals(p10)){
|
|
|
|
+ url = mobile + "?token=" + personToken;
|
|
|
|
+ }
|
|
|
|
+
|
|
response.setContentType("application/json;charset=utf-8");
|
|
response.setContentType("application/json;charset=utf-8");
|
|
response.sendRedirect(url);
|
|
response.sendRedirect(url);
|
|
} catch (Exception ex){
|
|
} catch (Exception ex){
|
|
@@ -171,6 +189,77 @@ public class UiasApiController {
|
|
return messageResult;
|
|
return messageResult;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ApplicationPrimaryService applicationPrimaryService;
|
|
|
|
+
|
|
|
|
+ @PostMapping("uploadProvincialUser")
|
|
|
|
+ @ApiOperation(value = "上传省级数据")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public MessageResult<Map> uploadProvincialUser(
|
|
|
|
+ @RequestParam(value="schoolType",defaultValue="test") String status
|
|
|
|
+ ) {
|
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ String path = "https://59.208.149.51:10087";
|
|
|
|
+ String appId = "key_onethingApi_test_ztsbk_421000000000_jyzspt_13ee24a0c4244cdba2a10bdbf541516e";
|
|
|
|
+ String appSecret = "secret_onethingApi_test_ztsbk_421000000000_jyzspt_b3670cf58542411c8605df86cee70a2e";
|
|
|
|
+ if("real".equals(status)) {
|
|
|
|
+ path = "https://59.208.149.51:10086/";//正式
|
|
|
|
+ appId = "";
|
|
|
|
+ appSecret = "";
|
|
|
|
+ }
|
|
|
|
+ String token = uiasService.getProvincialToken(path,appId,appSecret);
|
|
|
|
+ String applyNo = uiasService.applyno(path,token);
|
|
|
|
+ Integer limit = 10;
|
|
|
|
+
|
|
|
|
+ List<UserInformationProvincial> primaryList = applicationPrimaryService.findOfficeByProvincial(applyNo,limit);
|
|
|
|
+ List<Map> returnList = new ArrayList<>();
|
|
|
|
+ for(UserInformationProvincial provincial : primaryList){
|
|
|
|
+ UserInformationProvincialSubDeclares subDeclares = new UserInformationProvincialSubDeclares();
|
|
|
|
+ subDeclares.setApplicantName(provincial.getApplicantName());
|
|
|
|
+ subDeclares.setApplicantPhone(provincial.getApplicantPhone());
|
|
|
|
+ subDeclares.setApplyNo(applyNo);
|
|
|
|
+ subDeclares.setLiceseNo(provincial.getLicenseNo());
|
|
|
|
+ subDeclares.setTargetId(provincial.getTargetId());
|
|
|
|
+ subDeclares.setTargetName(provincial.getTargetName());
|
|
|
|
+
|
|
|
|
+ UserInformationProvincialFileDeclares fileDeclares = new UserInformationProvincialFileDeclares();
|
|
|
|
+ fileDeclares.setApplyNo(applyNo);
|
|
|
|
+
|
|
|
|
+ List<UserInformationProvincialFileDeclares> fileDeclaresList = new ArrayList<>();
|
|
|
|
+ fileDeclaresList.add(fileDeclares);
|
|
|
|
+
|
|
|
|
+ subDeclares.setFileDeclares(fileDeclaresList);
|
|
|
|
+
|
|
|
|
+ List<UserInformationProvincialSubDeclares> subDeclaresList = new ArrayList<>();
|
|
|
|
+ subDeclaresList.add(subDeclares);
|
|
|
|
+ provincial.setSubDeclares(subDeclaresList);
|
|
|
|
+
|
|
|
|
+ Map userMap = new HashMap();
|
|
|
|
+ userMap.put("declare",provincial);
|
|
|
|
+ returnList.add(userMap);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ String data = uiasService.submitAll(path,token,provincial);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// for(Map map : returnList){
|
|
|
|
+// uiasService.submitAll(path,token,map.get("declare"));
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ messageResult.setResult(true);
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ log.error(ex.getMessage(), ex);
|
|
|
|
+
|
|
|
|
+ messageResult.setResult(false);
|
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return messageResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
String name = "舒展1232";
|
|
String name = "舒展1232";
|
|
|
|
|