10.8开发
This commit is contained in:
+3
-4
@@ -41,12 +41,11 @@ public class AdjudicationController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据快递单号查询物流信息
|
* 根据快递单号查询物流信息
|
||||||
* @param trackingNum 单号
|
* @param caseApplication
|
||||||
* @param phoneLastFour 收/寄件人手机号后四位,顺丰快递需填写本字段。
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/logistics")
|
@GetMapping("/logistics")
|
||||||
public AjaxResult getLogisticsInfo(String trackingNum,Integer phoneLastFour){
|
public AjaxResult getLogisticsInfo(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
return adjudicationService.getLogisticsInfo(trackingNum,phoneLastFour);
|
return adjudicationService.getLogisticsInfo(caseApplication);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LogisticsInfoVO {
|
||||||
|
/**
|
||||||
|
* 案件关联人身份类型
|
||||||
|
*/
|
||||||
|
private Integer identityType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流信息
|
||||||
|
*/
|
||||||
|
private String logisticsInfo;
|
||||||
|
}
|
||||||
+1
-1
@@ -8,5 +8,5 @@ public interface IAdjudicationService {
|
|||||||
|
|
||||||
AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum);
|
AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum);
|
||||||
|
|
||||||
AjaxResult getLogisticsInfo(String trackingNum,Integer phoneLastFour);
|
AjaxResult getLogisticsInfo(CaseApplication caseApplication);
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-5
@@ -1,11 +1,14 @@
|
|||||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.deepoove.poi.config.Configure;
|
import com.deepoove.poi.config.Configure;
|
||||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.EmailOutUtil;
|
import com.ruoyi.common.utils.EmailOutUtil;
|
||||||
import com.ruoyi.common.utils.WordUtil;
|
import com.ruoyi.common.utils.WordUtil;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||||
@@ -47,6 +50,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|||||||
private EmailOutUtil emailOutUtil;
|
private EmailOutUtil emailOutUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICaseApplicationService caseApplicationService;
|
private ICaseApplicationService caseApplicationService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult createDocument(CaseApplication caseApplication) {
|
public AjaxResult createDocument(CaseApplication caseApplication) {
|
||||||
try {
|
try {
|
||||||
@@ -238,17 +242,26 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getLogisticsInfo(String trackingNum, Integer phoneLastFour) {
|
public AjaxResult getLogisticsInfo(CaseApplication caseApplication) {
|
||||||
try {
|
try {
|
||||||
//快递单号查询
|
//快递单号查询
|
||||||
String key = "70ba5c7b327f71fccd5924f70e3e7b7f";
|
String key = "70ba5c7b327f71fccd5924f70e3e7b7f";
|
||||||
String com = "auto";
|
String com = "auto";
|
||||||
|
//根据案件id查询单号信息
|
||||||
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||||
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
||||||
|
List<LogisticsInfoVO> logisticsInfoVOList = new ArrayList<>();
|
||||||
|
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||||
|
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||||
|
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||||
|
LogisticsInfoVO logisticsInfoVO = new LogisticsInfoVO();
|
||||||
|
String trackNum = affiliate.getTrackNum();
|
||||||
|
if (trackNum != null) {
|
||||||
// 构造查询字符串参数
|
// 构造查询字符串参数
|
||||||
String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d",
|
String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d",
|
||||||
URLEncoder.encode(key, "UTF-8"),
|
URLEncoder.encode(key, "UTF-8"),
|
||||||
URLEncoder.encode(com, "UTF-8"),
|
URLEncoder.encode(com, "UTF-8"),
|
||||||
URLEncoder.encode(trackingNum, "UTF-8"),
|
URLEncoder.encode(trackNum, "UTF-8"), null);
|
||||||
phoneLastFour);
|
|
||||||
// 拼接到API URL中
|
// 拼接到API URL中
|
||||||
String fullUrl = apiUrl + "?" + queryParameters;
|
String fullUrl = apiUrl + "?" + queryParameters;
|
||||||
URL url = new URL(fullUrl);
|
URL url = new URL(fullUrl);
|
||||||
@@ -263,12 +276,23 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|||||||
response.append(line);
|
response.append(line);
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
// 处理返回的响应数据
|
// 处理返回的响应数据\
|
||||||
return AjaxResult.success(response);
|
JSONObject jsonObject = JSON.parseObject(response.toString());
|
||||||
|
// 提取 "data" 字段并转换为字符串
|
||||||
|
String data = jsonObject.getString("data");
|
||||||
|
if (data != null) {
|
||||||
|
logisticsInfoVO.setIdentityType(affiliate.getIdentityType());
|
||||||
|
logisticsInfoVO.setLogisticsInfo(data);
|
||||||
|
logisticsInfoVOList.add(logisticsInfoVO);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 请求失败
|
// 请求失败
|
||||||
return AjaxResult.error("请求失败,错误码:" + responseCode);
|
return AjaxResult.error("请求失败,错误码:" + responseCode);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success(logisticsInfoVOList);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,12 +18,14 @@
|
|||||||
<result property="identityNumAgent" column="identity_num_agent" />
|
<result property="identityNumAgent" column="identity_num_agent" />
|
||||||
<result property="contactTelphoneAgent" column="contact_telphone_agent" />
|
<result property="contactTelphoneAgent" column="contact_telphone_agent" />
|
||||||
<result property="contactAddressAgent" column="contact_address_agent" />
|
<result property="contactAddressAgent" column="contact_address_agent" />
|
||||||
|
<result property="trackNum" column="track_num" />
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
|
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
|
||||||
select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address ,
|
select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address ,
|
||||||
c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent
|
c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent,
|
||||||
|
c.track_num
|
||||||
from case_affiliate c
|
from case_affiliate c
|
||||||
<where>
|
<where>
|
||||||
<if test="caseAppliId != null ">
|
<if test="caseAppliId != null ">
|
||||||
|
|||||||
Reference in New Issue
Block a user