| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | |
| | | xpPolicyApplicationVO.setVehicleCode(xpVehicle.getVehicleCode()); |
| | | xpPolicyApplicationVO.setAuditRemarks(xpPolicyApplication.getAuditRemarks()); |
| | | if (xpPolicyApplicationVO.getAuditStatus() == 2 && StringUtils.isNotBlank(xpVehicle.getPolicyInformation())) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpVehicle.getPolicyInformation()); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | JSONArray jsonArray = JSONArray.parseArray(xpVehicle.getPolicyInformation()); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | if (Objects.isNull(jsonObject)) { |
| | | continue; |
| | | } |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpPolicyApplicationVO.setPolicyInformation(jsonObject.toJSONString()); |
| | | } |
| | | xpPolicyApplicationVO.setPolicyInformation(JSONArray.toJSONString(jsonArray)); |
| | | |
| | | } |
| | | } |
| | | queryPolicyInfoVO.setStatus(xpPolicyApplication.getAuditStatus()); |