|
|
@@ -1,6 +1,7 @@
|
|
|
package com.mokamrp.privates.controller;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.mokamrp.privates.constant.HttpStatus;
|
|
|
import com.mokamrp.privates.entity.CorpIndexHandle;
|
|
|
import com.mokamrp.privates.entity.PostCorpWxLoginHandle;
|
|
|
@@ -33,7 +34,7 @@ import java.util.*;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/corp")
|
|
|
-public class CorpController extends BaseController<Corp>{
|
|
|
+public class CorpController extends BaseController<Corp> {
|
|
|
|
|
|
@Autowired
|
|
|
public CorpService corpService;
|
|
|
@@ -48,19 +49,19 @@ public class CorpController extends BaseController<Corp>{
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/indexMake")
|
|
|
- public Object indexMake(@Valid @RequestBody CorpIndexHandle corpIndexHandle, @AuthUser User authUser, BindingResult bindingResult){
|
|
|
+ public Object indexMake(@Valid @RequestBody CorpIndexHandle corpIndexHandle, @AuthUser User authUser, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
- if (authUser.getIsSuperAdmin() != 1){
|
|
|
+ if (authUser.getIsSuperAdmin() != 1) {
|
|
|
corpIndexHandle.setUserId(authUser.getId());
|
|
|
}
|
|
|
- Map<String,Object> res = corpService.selectCorpList(corpIndexHandle);
|
|
|
+ Map<String, Object> res = corpService.selectCorpList(corpIndexHandle);
|
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- *偷个懒,在控制器写这个
|
|
|
+ *偷个懒,在控制器写这个
|
|
|
*/
|
|
|
@PostMapping("/loginInfo")
|
|
|
@ResponseBody
|
|
|
@@ -71,14 +72,14 @@ public class CorpController extends BaseController<Corp>{
|
|
|
String token = "Ij0dujMAh40oR0QfyH4Y6LDxrvY6bguEN0uoWwBJ";
|
|
|
String client = "co_01";
|
|
|
XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
|
|
|
- int max=99999,min=10000;
|
|
|
- Long timestamp = (System.currentTimeMillis()/1000);
|
|
|
+ int max = 99999, min = 10000;
|
|
|
+ Long timestamp = (System.currentTimeMillis() / 1000);
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
|
|
|
- Integer ran2 = (int) (Math.random()*(max-min)+min);
|
|
|
+ Integer ran2 = (int) (Math.random() * (max - min) + min);
|
|
|
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
list.add(client);
|
|
|
@@ -86,27 +87,31 @@ public class CorpController extends BaseController<Corp>{
|
|
|
list.add(timestamp.toString());
|
|
|
list.add(ran2.toString());
|
|
|
list.sort(Comparator.naturalOrder());
|
|
|
- String imploded= StringUtils.join(list, "");
|
|
|
+ String imploded = StringUtils.join(list, "");
|
|
|
|
|
|
String sign = DigestUtils.sha1Hex(imploded);
|
|
|
System.out.println(list);
|
|
|
System.out.println(sign);
|
|
|
System.out.println(imploded);
|
|
|
List<String> a = list;
|
|
|
- Map<String,String> requestParams = new HashMap<>();
|
|
|
-
|
|
|
- requestParams.put("type","workwechat");
|
|
|
- requestParams.put("client_id",client);
|
|
|
- requestParams.put("signature",sign);
|
|
|
- requestParams.put("nonce",ran2.toString());
|
|
|
- requestParams.put("timestamp",timestamp.toString());
|
|
|
- requestParams.put("mobile_id",handle.getMobile().toString());
|
|
|
- requestParams.put("uuid",handle.getUuid());
|
|
|
-
|
|
|
- String url = HttpUtils.getRqstUrl("http://account.kwnpv.com/onekeyload/workwechat",requestParams);
|
|
|
- return AjaxResult.success("ok",url);
|
|
|
+ Map<String, String> requestParams = new HashMap<>();
|
|
|
+
|
|
|
+ requestParams.put("type", "workwechat");
|
|
|
+ requestParams.put("client_id", client);
|
|
|
+ requestParams.put("signature", sign);
|
|
|
+ requestParams.put("nonce", ran2.toString());
|
|
|
+ requestParams.put("timestamp", timestamp.toString());
|
|
|
+ requestParams.put("mobile_id", handle.getMobile().toString());
|
|
|
+ requestParams.put("uuid", handle.getUuid());
|
|
|
+
|
|
|
+ String url = HttpUtils.getRqstUrl("http://account.kwnpv.com/onekeyload/workwechat", requestParams);
|
|
|
+ return AjaxResult.success("ok", url);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/selectList")
|
|
|
+ public Object selectList() {
|
|
|
+ return AjaxResult.success(corpService.list(new LambdaQueryWrapper<Corp>().orderByAsc(Corp::getId)));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|