|
@@ -2,7 +2,9 @@ package org.springblade.system.user.thirdparty;
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.http.Consts;
|
|
@@ -13,22 +15,34 @@ import org.apache.http.client.entity.UrlEncodedFormEntity;
|
|
|
import org.apache.http.client.methods.HttpPost;
|
|
|
import org.apache.http.impl.client.HttpClientBuilder;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
+import org.springblade.common.constant.CommonConstant;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.DigestUtil;
|
|
|
+import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
+import org.springblade.manager.entity.ContractInfo;
|
|
|
+import org.springblade.manager.feign.SaveUserInfoByProjectClient;
|
|
|
import org.springblade.system.entity.AuthClient;
|
|
|
+import org.springblade.system.user.bean.GetBMTokenDTO;
|
|
|
import org.springblade.system.user.bean.GetTokenDTO;
|
|
|
import org.springblade.system.user.entity.User;
|
|
|
+import org.springblade.system.user.service.IUserService;
|
|
|
+import org.springblade.system.user.util.AesInfoUtil;
|
|
|
+import org.springblade.system.user.util.HttpClientUtil;
|
|
|
+import org.springblade.system.user.util.RsaUtilToken;
|
|
|
import org.springblade.system.user.util.RsaUtils;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.time.Duration;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
@@ -46,55 +60,85 @@ public class ThirdPartySystemApi {
|
|
|
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
private final RedisTemplate<String, String> redisTemplate;
|
|
|
+ private final IUserService userService;
|
|
|
+ private final SaveUserInfoByProjectClient saveUserInfoByProjectClient;
|
|
|
+
|
|
|
+ /*白马相关常量*/
|
|
|
+ private final static String IP_PORT = "http://219.152.86.38:13427";
|
|
|
+ private final static String PK_URL = IP_PORT + "/prod-api/auth/touch";
|
|
|
+ private final static String TOKEN_URL = IP_PORT + "/prod-api/auth/login";
|
|
|
+ private final static String USER_LIST_URL = IP_PORT + "/prod-api/openapi/biz-v1/user/list";
|
|
|
+ private final static String USERNAME = "白马质检";
|
|
|
+ private final static String PASSWORD = "Bmzj@654321";
|
|
|
+ private final static String SOURCE = "HongChuangBm";
|
|
|
+ private final static String APP_KEY = "9F3C78FC22D07EAB2AEB4DD6CA9644DB";
|
|
|
|
|
|
/**
|
|
|
- * 获取公钥信息
|
|
|
+ * 根据appKey获取本系统的公钥信息
|
|
|
+ *
|
|
|
+ * @param appKey = blade_client id
|
|
|
*/
|
|
|
@GetMapping("/auth/public-key")
|
|
|
public Map<String, Object> getPublicKey(@RequestParam String appKey) {
|
|
|
- /*查询Redis中已有的键值对数量*/
|
|
|
- String redisKeyPattern = "bm-secret-key:*";
|
|
|
- if (Objects.requireNonNull(redisTemplate.keys(redisKeyPattern)).size() >= 10) {
|
|
|
- throw new ServiceException("请求频率超过限制,请2分钟后重试");
|
|
|
- }
|
|
|
-
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
if (StringUtils.isEmpty(appKey)) {
|
|
|
- throw new ServiceException("appKey不能为空");
|
|
|
- }
|
|
|
- if (!isValidAppKey(appKey)) {
|
|
|
- throw new ServiceException("appKey验证失败");
|
|
|
+ resultMap.put("uuid", null);
|
|
|
+ resultMap.put("pk", null);
|
|
|
+ resultMap.put("code", 500);
|
|
|
+ resultMap.put("msg", "param cannot be null");
|
|
|
+ return resultMap;
|
|
|
}
|
|
|
|
|
|
- /*创建秘钥对*/
|
|
|
- Map<String, String> keyPair = RsaUtils.createKeyPair();
|
|
|
- String pk = keyPair.get("pk");
|
|
|
- String sk = keyPair.get("sk");
|
|
|
- Long uuid = SnowFlakeUtil.getId();
|
|
|
+ /*Redis加锁,10秒过期*/
|
|
|
+ String lockRedisKey = "bm-secret-key-request-limit:" + appKey;
|
|
|
+ Long currentTime = System.currentTimeMillis();
|
|
|
+ Boolean isAbsent = redisTemplate.opsForValue().setIfAbsent(lockRedisKey, String.valueOf(currentTime), Duration.ofSeconds(10));
|
|
|
|
|
|
- Map<String, Object> resultMap = new HashMap<>();
|
|
|
- try {
|
|
|
- //存储到Redis,并设置过期时间为2分钟
|
|
|
- String redisKey = "bm-secret-key:" + uuid;
|
|
|
- redisTemplate.opsForValue().set(redisKey + ":pk", pk, 2, TimeUnit.MINUTES);
|
|
|
- redisTemplate.opsForValue().set(redisKey + ":sk", sk, 2, TimeUnit.MINUTES);
|
|
|
-
|
|
|
- resultMap.put("uuid", uuid);
|
|
|
- resultMap.put("pk", pk);
|
|
|
- resultMap.put("code", 200);
|
|
|
- resultMap.put("msg", "操作成功");
|
|
|
- return resultMap;
|
|
|
- } catch (Exception e) {
|
|
|
+ if (isAbsent != null && isAbsent) {
|
|
|
+ if (!isValidAppKey(appKey)) {
|
|
|
+ resultMap.put("uuid", null);
|
|
|
+ resultMap.put("pk", null);
|
|
|
+ resultMap.put("code", 500);
|
|
|
+ resultMap.put("msg", "appKey authentication failed");
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*创建秘钥对*/
|
|
|
+ Map<String, String> keyPair = RsaUtils.createKeyPair();
|
|
|
+ String pk = keyPair.get("pk");
|
|
|
+ String sk = keyPair.get("sk");
|
|
|
+ Long uuid = SnowFlakeUtil.getId();
|
|
|
+
|
|
|
+ try {
|
|
|
+ /*存储到Redis,2分钟过期*/
|
|
|
+ String redisKey = "bm-secret-key:" + uuid;
|
|
|
+ redisTemplate.opsForValue().set(redisKey + ":pk", pk, 2, TimeUnit.MINUTES);
|
|
|
+ redisTemplate.opsForValue().set(redisKey + ":sk", sk, 2, TimeUnit.MINUTES);
|
|
|
+
|
|
|
+ resultMap.put("uuid", uuid);
|
|
|
+ resultMap.put("pk", pk);
|
|
|
+ resultMap.put("code", 200);
|
|
|
+ resultMap.put("msg", "操作成功");
|
|
|
+ return resultMap;
|
|
|
+ } catch (Exception e) {
|
|
|
+ resultMap.put("uuid", null);
|
|
|
+ resultMap.put("pk", null);
|
|
|
+ resultMap.put("code", 500);
|
|
|
+ resultMap.put("msg", e.getMessage());
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
resultMap.put("uuid", null);
|
|
|
resultMap.put("pk", null);
|
|
|
- resultMap.put("code", 400);
|
|
|
- resultMap.put("msg", e.getMessage());
|
|
|
+ resultMap.put("code", 500);
|
|
|
+ resultMap.put("msg", "try again in 10 seconds");
|
|
|
return resultMap;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private boolean isValidAppKey(String appKey) {
|
|
|
List<AuthClient> bladeClients = jdbcTemplate.query(
|
|
|
- "SELECT (1) FROM blade_client WHERE client_id = ?",
|
|
|
+ "SELECT (1) FROM blade_client WHERE id = ? AND status = 1 AND is_deleted = 0",
|
|
|
new Object[]{appKey},
|
|
|
new BeanPropertyRowMapper<>(AuthClient.class)
|
|
|
);
|
|
@@ -102,7 +146,9 @@ public class ThirdPartySystemApi {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取token
|
|
|
+ * 根据idcard获取本系统的token信息
|
|
|
+ *
|
|
|
+ * @param dto
|
|
|
*/
|
|
|
@PostMapping("/auth/token")
|
|
|
public R<Object> getToken(@RequestBody GetTokenDTO dto) {
|
|
@@ -188,6 +234,7 @@ public class ThirdPartySystemApi {
|
|
|
return R.data(451, null, "未获取到对应的私钥信息");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/*public static void main(String[] args) {
|
|
|
//公钥
|
|
|
String pk = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnZ0kMi0AG9sR97sdRD0/kqX9a7kSsVM56DUwmEbxf9n5SW0aRwxYcoyZQUC7ZW2MrXSNbzwbtmdD0RfQ4TJI0CAwEAAQ==";
|
|
@@ -201,5 +248,231 @@ public class ThirdPartySystemApi {
|
|
|
System.out.println("Encrypted Id Card: " + encryptedIdCard);
|
|
|
}*/
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取白马系统token
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static R<Object> getBMToken() {
|
|
|
+ /*获取uuid与公钥*/
|
|
|
+ Map<String, String> param = new HashMap<>();
|
|
|
+ param.put("appKey", APP_KEY);
|
|
|
+ String pkAndUuid = HttpClientUtil.doGet(PK_URL, param);
|
|
|
+ JSONObject jsonObject = JSON.parseObject(pkAndUuid);
|
|
|
+ String pk = jsonObject.getString("pk");
|
|
|
+ String uuid = jsonObject.getString("uuid");
|
|
|
+ String code = jsonObject.getString("code");
|
|
|
+ /*获取token*/
|
|
|
+ if (StringUtils.isNotEmpty(pk) && StringUtils.isNotEmpty(uuid) && ("200").equals(code)) {
|
|
|
+ String username = RsaUtilToken.encryptWithPk(USERNAME, pk);
|
|
|
+ String password = RsaUtilToken.encryptWithPk(PASSWORD, pk);
|
|
|
+ //移除换行符
|
|
|
+ String usernameRe = username.replaceAll("\\r|\\n", "");
|
|
|
+ String passwordRe = password.replaceAll("\\r|\\n", "");
|
|
|
+
|
|
|
+ String result = HttpClientUtil.doPostJson(TOKEN_URL, JSON.toJSONString(new GetBMTokenDTO(uuid, usernameRe, passwordRe, SOURCE)));
|
|
|
+ return R.data(result);
|
|
|
+ } else {
|
|
|
+ return R.data(jsonObject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /*public static void main(String[] args) {
|
|
|
+ *//*Object data = getBMToken().getData();
|
|
|
+ System.out.println(data);*//*
|
|
|
+
|
|
|
+ syncBMUserInfosToSystemProject();
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 同步白马用户信息到系统项目中
|
|
|
+ */
|
|
|
+ /*@Scheduled(cron = "0 0 4 * * ?")*/
|
|
|
+ @PostMapping("/auth/test666")
|
|
|
+ public void syncBMUserInfosToSystemProject() {
|
|
|
+ /*获取token*/
|
|
|
+ Object dataR = getBMToken().getData();
|
|
|
+ JSONObject jsonObject = JSON.parseObject(String.valueOf(dataR));
|
|
|
+ String code = jsonObject.getString("code");
|
|
|
+ String dataToken = jsonObject.getString("data");
|
|
|
+ JSONObject jsonObjectToken = JSON.parseObject(dataToken);
|
|
|
+ String token = jsonObjectToken.getString("access_token");
|
|
|
+
|
|
|
+ if (("200").equals(code) && StringUtils.isNotEmpty(token)) {
|
|
|
+ /*获取白马公司ids*/
|
|
|
+ //String bmCompanyIds = CommonConstant.BM_COMPANY_IDS;
|
|
|
+
|
|
|
+ /*测试公司id*/
|
|
|
+ String bmCompanyIds = "1722072427562467328";
|
|
|
+
|
|
|
+ String[] bmCompanyIdsArr = bmCompanyIds.split(",");
|
|
|
+ for (String companyId : bmCompanyIdsArr) {
|
|
|
+ /*获取用户信息*/
|
|
|
+ Map<String, String> param = new HashMap<>();
|
|
|
+ param.put("pid", companyId);
|
|
|
+ String responseData = HttpClientUtil.doGet(USER_LIST_URL, param, token);
|
|
|
+
|
|
|
+ /*解析响应数据*/
|
|
|
+ JSONObject jsonObjectResponse = JSONObject.parseObject(responseData);
|
|
|
+ String responseStringCode = jsonObjectResponse.getString("code");
|
|
|
+ if (("200").equals(responseStringCode)) {
|
|
|
+ JSONArray userList = jsonObjectResponse.getJSONArray("data");
|
|
|
+ if (userList != null && userList.size() >= 1) {
|
|
|
+ for (int i = 0; i < userList.size(); i++) {
|
|
|
+ JSONObject jsonUser = userList.getJSONObject(i);
|
|
|
+ String userid = jsonUser.getString("userid");
|
|
|
+ //String username = jsonUser.getString("username");
|
|
|
+ String nickname = jsonUser.getString("nickname");
|
|
|
+ String idCard = jsonUser.getString("idcard");
|
|
|
+ String phone = jsonUser.getString("phonenumber");
|
|
|
+ String status = jsonUser.getString("status");
|
|
|
+
|
|
|
+ JSONArray companies = jsonUser.getJSONArray("companies");
|
|
|
+ if (companies != null && companies.size() >= 1) {
|
|
|
+ for (int j = 0; j < companies.size(); j++) {
|
|
|
+ JSONObject companiesJSONObject = companies.getJSONObject(j);
|
|
|
+ //String companiesId = companiesJSONObject.getString("id");
|
|
|
+ String companyName = companiesJSONObject.getString("name");
|
|
|
+
|
|
|
+ if (companyName.contains("重庆白马航运发展有限公司")
|
|
|
+ || companyName.contains("四川二滩国际工程咨询有限责任公司")
|
|
|
+ || companyName.contains("中国水利水电第四工程局中电建路桥集团联合体")
|
|
|
+ || companyName.contains("中国水利水电第八工程局有限公司")
|
|
|
+ || companyName.contains("重庆市交通工程监理咨询有限责任公司")
|
|
|
+ || companyName.contains("中铁长江交通设计集团有限公司")
|
|
|
+ || companyName.contains("中铁八局集团有限公司")) {
|
|
|
+ List<User> sysUser = userService.getBaseMapper().selectList(Wrappers.<User>lambdaQuery().eq(User::getSysType, 2).apply("(sys_id = '" + userid + "' OR id_number = '" + idCard + "')"));
|
|
|
+
|
|
|
+ /*修改电话号码*/
|
|
|
+ if (sysUser.size() > 0 && ObjectUtil.isNotEmpty(phone) && phone.length() == 11) {
|
|
|
+ for (User user : sysUser) {
|
|
|
+ if (ObjectUtil.isEmpty(user.getPhone())) {
|
|
|
+ userService.lambdaUpdate()
|
|
|
+ .set(User::getPhone, phone)
|
|
|
+ .eq(User::getId, user.getId())
|
|
|
+ .update();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*只有本系统不存在时才去新增*/
|
|
|
+ if (sysUser.size() == 0L) {
|
|
|
+ User newUser = new User();
|
|
|
+ newUser.setId(SnowFlakeUtil.getId());
|
|
|
+ newUser.setDeptId("1588069957940674562"); //白马部门
|
|
|
+
|
|
|
+ newUser.setSysType(9); //之前=2是表示同步,现在由于修改了接口,改为9,以便处理数据
|
|
|
+
|
|
|
+ newUser.setIsDeleted(0);
|
|
|
+ newUser.setCreateUser(Long.parseLong("1541381503819694081"));
|
|
|
+ newUser.setUpdateUser(Long.parseLong("1541381503819694081"));
|
|
|
+ newUser.setTenantId("000000");
|
|
|
+ newUser.setSysId(userid);
|
|
|
+ newUser.setUpdateTime(new Date());
|
|
|
+ newUser.setCreateTime(new Date());
|
|
|
+ newUser.setUserType("1,2");
|
|
|
+ newUser.setAccount(idCard);
|
|
|
+ newUser.setRealName(nickname);
|
|
|
+ newUser.setName(nickname);
|
|
|
+ newUser.setPassword("10470c3b4b1fed12c3baac014be15fac67c6e815");
|
|
|
+ newUser.setPlaintextPassword("123456");
|
|
|
+ newUser.setName(nickname);
|
|
|
+ newUser.setStatus(Integer.parseInt(status));
|
|
|
+ newUser.setIdNumber(idCard);
|
|
|
+ newUser.setCompanyName(companyName);
|
|
|
+ newUser.setPhone(ObjectUtil.isNotEmpty(phone) && phone.length() == 11 ? phone : null);
|
|
|
+
|
|
|
+ /*所有合同段(白马)*/
|
|
|
+ if (companyName.contains("重庆白马航运发展有限公司")) {
|
|
|
+ List<ContractInfo> contractInfos = jdbcTemplate.query("select id from m_contract_info where p_id = 1612329251049537537 and is_deleted = 0 and status = 1", new BeanPropertyRowMapper<>(ContractInfo.class));
|
|
|
+ for (ContractInfo contractInfo : contractInfos) {
|
|
|
+ Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and project_id = 1612329251049537537 " + " and contract_id = " + contractInfo.getId() + " and post_id is null " + " and status = 1 and is_deleted = 0", Long.class);
|
|
|
+ if (count == null || count == 0L) {
|
|
|
+ /*绑定项目,设置默认角色信息 白马项目id:1612329251049537537;所有合同段id:contractInfo.getId();角色施工-资料员id:1537249581371707394*/
|
|
|
+ saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, contractInfo.getId(), 1537249581371707394L);
|
|
|
+ newUser.setRoleId("1537249581371707394");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*二期合同段(八局、二滩、长江设计单位、中国水利水电第八工程局有限公司)*/
|
|
|
+ if (companyName.contains("中铁八局集团有限公司") || companyName.contains("四川二滩国际工程咨询有限责任公司")
|
|
|
+ || companyName.contains("中铁长江交通设计集团有限公司") || companyName.contains("中国水利水电第八工程局有限公司")) {
|
|
|
+ Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and project_id = 1612329251049537537 and contract_id = 1612335077269143554 and post_id is null and status = 1 and is_deleted = 0", Long.class);
|
|
|
+ if (count == null || count == 0L) {
|
|
|
+ /*绑定项目,设置默认角色信息 白马项目id:1612329251049537537;第二期合同段id:1612335077269143554;角色施工-资料员id:1537249581371707394*/
|
|
|
+ saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1612335077269143554L, 1537249581371707394L);
|
|
|
+ newUser.setRoleId("1537249581371707394");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*一期合同段(四局、长江设计单位)*/
|
|
|
+ if (companyName.contains("中国水利水电第四工程局中电建路桥集团联合体") || companyName.contains("中铁长江交通设计集团有限公司")) {
|
|
|
+ Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and project_id = 1612329251049537537 and contract_id = 1613022750656921601 and post_id is null and status = 1 and is_deleted = 0", Long.class);
|
|
|
+ if (count == null || count == 0L) {
|
|
|
+ /*绑定项目,设置默认角色信息 白马项目id:1612329251049537537;第一期合同段id:1613022750656921601;角色施工-资料员id:1537249581371707394*/
|
|
|
+ saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1613022750656921601L, 1537249581371707394L);
|
|
|
+ newUser.setRoleId("1537249581371707394");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*二监办合同段(二滩)*/
|
|
|
+ if (companyName.contains("四川二滩国际工程咨询有限责任公司")) {
|
|
|
+ Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and project_id = 1612329251049537537 and contract_id = 1687370619295309826 and post_id is null and status = 1 and is_deleted = 0", Long.class);
|
|
|
+ if (count == null || count == 0L) {
|
|
|
+ /*绑定项目,设置默认角色信息 白马项目id:1612329251049537537;二监办合同段id:1687370619295309826;角色施工-资料员id:1537249581371707394*/
|
|
|
+ saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1687370619295309826L, 1537249581371707394L);
|
|
|
+ newUser.setRoleId("1537249581371707394");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*一监办合同段(重庆市交通工程监理咨询有限责任公司)*/
|
|
|
+ if (companyName.contains("重庆市交通工程监理咨询有限责任公司")) {
|
|
|
+ Long count = jdbcTemplate.queryForObject("select count(1) from m_project_assignment_user where user_id = " + newUser.getId() + " and project_id = 1612329251049537537 and contract_id = 1687370014959017986 and post_id is null and status = 1 and is_deleted = 0", Long.class);
|
|
|
+ if (count == null || count == 0L) {
|
|
|
+ /*绑定项目,设置默认角色信息 白马项目id:1612329251049537537;一监办合同段id:1687370014959017986;角色施工-资料员id:1537249581371707394*/
|
|
|
+ saveUserInfoByProjectClient.saveInfoRelation(newUser.getId(), 1612329251049537537L, 1687370014959017986L, 1537249581371707394L);
|
|
|
+ newUser.setRoleId("1537249581371707394");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*入库*/
|
|
|
+ userService.save(newUser);
|
|
|
+ userService.submitUserDept(newUser);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*JSONArray projects = jsonUser.getJSONArray("projects");
|
|
|
+ if (projects != null && projects.size() >= 1) {
|
|
|
+ for (int k = 0; k < projects.size(); k++) {
|
|
|
+ JSONObject projectsJSONObject = projects.getJSONObject(k);
|
|
|
+ String projectId = projectsJSONObject.getString("projectid");
|
|
|
+ String projectName = projectsJSONObject.getString("projectname");
|
|
|
+ String subprojectId = projectsJSONObject.getString("subprojectid");
|
|
|
+ String subprojectName = projectsJSONObject.getString("subprojectname");
|
|
|
+ String contractId = projectsJSONObject.getString("contractid");
|
|
|
+ String contractName = projectsJSONObject.getString("contractname");
|
|
|
+ String sectionId = projectsJSONObject.getString("sectionid");
|
|
|
+ String sectionName = projectsJSONObject.getString("sectionname");
|
|
|
+
|
|
|
+ //TODO
|
|
|
+
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|