| | |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.utils.forest.SYClient; |
| | | import com.ruoyi.utils.httpclient.SYCarClient; |
| | | import com.ruoyi.utils.result.Constants; |
| | | import com.ruoyi.utils.result.Results; |
| | |
| | | import io.minio.http.Method; |
| | | import io.minio.messages.Contents; |
| | | import io.minio.messages.Item; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.sy.mapper.ArdSyCarMapper; |
| | | import com.ruoyi.sy.domain.ArdSyCar; |
| | |
| | | @Resource |
| | | private SysUserMapper userMapper; |
| | | |
| | | @Resource |
| | | private SYClient sYClient; |
| | | |
| | | /** |
| | | * 查询三一车辆 |
| | |
| | | return result; |
| | | }else{ |
| | | ArdSyUser ardSyUser = ardSyUserList.get(0); |
| | | Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | //Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | String passwordMd5 = DigestUtils.md5Hex(ardSyUser.getPassword()); |
| | | Map<String,Object> LogInResult = sYClient.logIn(syURL,passwordMd5,ardSyUser.getUserId()); |
| | | String sessionId = (String) LogInResult.get("sessionId"); |
| | | Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | //Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | Map<String,Object> carListMap = sYClient.getCarList(syURL,sessionId); |
| | | if(((String)carListMap.get("rspCode")).equals("1")){ |
| | | List<Map<String,Object>> list = (List<Map<String,Object>>) carListMap.get("list"); |
| | | ArdSyCar ardSyCar = new ArdSyCar(); |
| | |
| | | return result; |
| | | }else{ |
| | | ArdSyUser ardSyUser = ardSyUserList.get(0); |
| | | Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | //Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword()); |
| | | String passwordMd5 = DigestUtils.md5Hex(ardSyUser.getPassword()); |
| | | Map<String,Object> LogInResult = sYClient.logIn(syURL,passwordMd5,ardSyUser.getUserId()); |
| | | String sessionId = (String) LogInResult.get("sessionId"); |
| | | Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | //Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId); |
| | | Map<String,Object> carListMap = sYClient.getCarList(syURL,sessionId); |
| | | if(((String)carListMap.get("rspCode")).equals("1")){ |
| | | List<Map<String,Object>> list = (List<Map<String,Object>>) carListMap.get("list"); |
| | | /*ArdSyCar ardSyCar = new ArdSyCar(); |
| | | List<ArdSyCar> ardSyCarList = ardSyCarMapper.selectArdSyCarList(ardSyCar); |
| | | List<String> carIdList = new ArrayList(); |
| | | for(ArdSyCar innerArdSyCar : ardSyCarList){ |
| | | carIdList.add(innerArdSyCar.getCarId()); |
| | | } |
| | | |
| | | List<Map<String,Object>> carList = list.stream().filter(new Predicate<Map<String,Object>>(){ |
| | | @Override |
| | | public boolean test(Map<String,Object> map) { |
| | | return !carIdList.contains((String)map.get("carId")); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | result.put("data",carList);*/ |
| | | result.put("data",list); |
| | | result.put("code","200"); |
| | | return result; |