|
@@ -105,7 +105,7 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
|
|
// String s = HttpUtil.doJsonPost("https://wl.dasteel.cn:32322/icore.icp.web/pass/v1/sysusers/", json, token);
|
|
// String s = HttpUtil.doJsonPost("https://wl.dasteel.cn:32322/icore.icp.web/pass/v1/sysusers/", json, token);
|
|
Map<String, Object> resultMap;
|
|
Map<String, Object> resultMap;
|
|
// 传formData格式--URL?参数&参数
|
|
// 传formData格式--URL?参数&参数
|
|
- resultMap = ssoFeign.addUser("Bearer " + token, consigneeCode, consigneeCompanyName, "shouhuokehu", "收货客户", "506514577756917769", "713710108567277568", "958023746726268928");
|
|
|
|
|
|
+ resultMap = ssoFeign.addUser("Bearer " + token, consigneeCompanyName, consigneeCompanyName, "shouhuokehu", "收货客户", "506514577756917769", "713710108567277568", "958023746726268928");
|
|
// 赋权
|
|
// 赋权
|
|
String code = (String) resultMap.get("code");
|
|
String code = (String) resultMap.get("code");
|
|
String userId = null;
|
|
String userId = null;
|
|
@@ -114,9 +114,10 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
|
|
userId = (String) userData.get("userId");
|
|
userId = (String) userData.get("userId");
|
|
}
|
|
}
|
|
if (userId != null) {
|
|
if (userId != null) {
|
|
- ssoFeign.addUserroles("Bearer " + token,userId, consigneeCompanyName, "958038344527384576");
|
|
|
|
|
|
+ ssoFeign.addUserroles("Bearer " + token,userId, consigneeCompanyName, "1042116550569627648");
|
|
rmsConsignee.setConsigneeSsoId(userId);
|
|
rmsConsignee.setConsigneeSsoId(userId);
|
|
rmsConsignee.setConsigneeSsoCode(consigneeCode);
|
|
rmsConsignee.setConsigneeSsoCode(consigneeCode);
|
|
|
|
+ rmsConsignee.setConsigneeCompanyName(consigneeCompanyName);
|
|
}
|
|
}
|
|
int result = 0;
|
|
int result = 0;
|
|
// 新增
|
|
// 新增
|
|
@@ -151,4 +152,47 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
|
|
public List<Map<String, Object>> getConsigneeList(Map<String, Object> mapVal) {
|
|
public List<Map<String, Object>> getConsigneeList(Map<String, Object> mapVal) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public BigDecimal registerConsignee(Map<String, Object> mapVal) throws Exception {
|
|
|
|
+ String consigneeCompanyName=""+mapVal.get("receiveName");
|
|
|
|
+ if("null".equals(consigneeCompanyName)){
|
|
|
|
+ throw new Exception("请传入收货客户名!");
|
|
|
|
+ }
|
|
|
|
+ BigDecimal consigneeId = rmsConsigneeMapper.findReceiveId(consigneeCompanyName);
|
|
|
|
+ if(consigneeId!=null){
|
|
|
|
+ return consigneeId;
|
|
|
|
+ }
|
|
|
|
+ RmsConsignee rmsConsignee=new RmsConsignee();
|
|
|
|
+ // 调用sso接口
|
|
|
|
+ Map<String, Object> tokenMap = tokenFeign.login("adminMannage", "7c4a8d09ca3762af61e59520943dc26494f8941b");
|
|
|
|
+ Map<String,Object> data = (Map<String, Object>) tokenMap.get("data");
|
|
|
|
+ String token = (String) data.get("accessToken");
|
|
|
|
+ Map<String,Object> headerMap = new HashMap<>();
|
|
|
|
+ // 设置token
|
|
|
|
+ headerMap.put("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
+ headerMap.put("Authorization","Bearer " + token);
|
|
|
|
+ // 新增用户 传formData格式--URL?参数&参数
|
|
|
|
+ Map<String, Object> resultMap;
|
|
|
|
+ resultMap = ssoFeign.addUser("Bearer " + token, consigneeCompanyName, consigneeCompanyName, "shouhuokehu", "收货客户", "506514577756917769", "713710108567277568", "958023746726268928");
|
|
|
|
+ // 赋权
|
|
|
|
+ String code = (String) resultMap.get("code");
|
|
|
|
+ String userId = null;
|
|
|
|
+ if (("0").equals(code)) {
|
|
|
|
+ Map<String,Object> userData = (Map<String, Object>) resultMap.get("data");
|
|
|
|
+ userId = (String) userData.get("userId");
|
|
|
|
+ }
|
|
|
|
+ if (userId != null) {
|
|
|
|
+ //赋权
|
|
|
|
+ ssoFeign.addUserroles("Bearer " + token,userId, consigneeCompanyName, "1042116550569627648");
|
|
|
|
+ }
|
|
|
|
+ // 新增收货客户表
|
|
|
|
+ rmsConsignee.setConsigneeSsoId(userId);
|
|
|
|
+ rmsConsignee.setConsigneeSsoCode(consigneeCompanyName);
|
|
|
|
+ rmsConsignee.setConsigneeCompanyName(consigneeCompanyName);
|
|
|
|
+ rmsConsignee.setConsigneeId(rmsConsigneeMapper.getConsigneeId());
|
|
|
|
+ rmsConsignee.setDeleted(new BigDecimal(0));
|
|
|
|
+ rmsConsigneeMapper.insertSelective(rmsConsignee);
|
|
|
|
+ return rmsConsignee.getConsigneeId();
|
|
|
|
+ }
|
|
}
|
|
}
|