Merge #110 into master from cc_2026_0422_feat_miniMap
三方接口 * cc_2026_0422_feat_miniMap: (5 commits squashed) - feat: 添加机会点考察记录及相关请求和响应类 - feat: 更新考察记录响应类,添加机会点信息及图片信息结构 - feat:验签对于List的特殊处理 - feat: 添加qualified字段到OpportunityInfoResponse以表示考察合格状态 - Merge branch 'master' into cc_2026_0422_feat_miniMap Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com> Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com> CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/110
This commit is contained in:
@@ -13,6 +13,7 @@ import java.security.*;
|
|||||||
import java.security.spec.InvalidKeySpecException;
|
import java.security.spec.InvalidKeySpecException;
|
||||||
import java.security.spec.PKCS8EncodedKeySpec;
|
import java.security.spec.PKCS8EncodedKeySpec;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
@@ -101,7 +102,14 @@ public class SignatureUtils {
|
|||||||
if (Objects.isNull(value)|| (value instanceof String && StringUtil.isBlank(value.toString())) || (value instanceof Double &&((Double) value).intValue()==0)){
|
if (Objects.isNull(value)|| (value instanceof String && StringUtil.isBlank(value.toString())) || (value instanceof Double &&((Double) value).intValue()==0)){
|
||||||
log.info("0或者空值不参与签名");
|
log.info("0或者空值不参与签名");
|
||||||
}else {
|
}else {
|
||||||
if (value instanceof Double){
|
if (value instanceof List) {
|
||||||
|
// 处理 List 类型,生成 ["item1","item2"] 格式
|
||||||
|
List<?> list = (List<?>) value;
|
||||||
|
String listStr = list.stream()
|
||||||
|
.map(item -> "\"" + item.toString() + "\"") // 每个元素加双引号
|
||||||
|
.collect(Collectors.joining(",", "[", "]")); // 用方括号包裹,逗号分隔
|
||||||
|
sb.append(key).append("=").append(listStr).append("&");
|
||||||
|
} else if (value instanceof Double){
|
||||||
sb.append(key).append("=").append(((Double) value).intValue()).append("&");
|
sb.append(key).append("=").append(((Double) value).intValue()).append("&");
|
||||||
}else {
|
}else {
|
||||||
sb.append(key).append("=").append(value).append("&");
|
sb.append(key).append("=").append(value).append("&");
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
package com.cool.store.request.oppty;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/** * 添加机会点考察记录 */
|
||||||
|
@Data
|
||||||
|
public class AddInspectionRecordRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("机会点编号")
|
||||||
|
@NotBlank
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty("考察人姓名")
|
||||||
|
@NotBlank
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("考察人手机号")
|
||||||
|
@NotBlank
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("考察时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||||
|
@NotBlank
|
||||||
|
private String inspectionTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否合格,兼容 1/2 或 true/false")
|
||||||
|
@NotNull
|
||||||
|
private Object qualified;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("考察图片,兼容对象数组或字符串URL数组")
|
||||||
|
private List<Object> images;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.cool.store.request.oppty;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询机会点考察记录列表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ListInspectionRecordRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("机会点编号")
|
||||||
|
@NotBlank
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty("考察人手机号")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否合格,兼容 1/2 或 true/false")
|
||||||
|
private Object qualified;
|
||||||
|
|
||||||
|
@ApiModelProperty("页码,默认1")
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("每页条数,默认20,最大50")
|
||||||
|
private Integer pageSize;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.cool.store.request.oppty;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置机会点调整后坐标
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SaveAdjustLocationRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("机会点编号")
|
||||||
|
@NotBlank
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty("调整后坐标 GEOHASH")
|
||||||
|
@NotBlank
|
||||||
|
private String location;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.cool.store.response.oppty;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机会点考察记录分页响应
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class InspectionRecordPageResponse {
|
||||||
|
|
||||||
|
private PageResponse page;
|
||||||
|
private List<InspectionRecordResponse> pageData;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.cool.store.response.oppty;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机会点考察记录
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class InspectionRecordResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long iid;
|
||||||
|
/**
|
||||||
|
* 机会点ID
|
||||||
|
*/
|
||||||
|
private Long oid;
|
||||||
|
/**
|
||||||
|
* 机会点编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 机会点名称
|
||||||
|
*/
|
||||||
|
private String opptyName;
|
||||||
|
/**
|
||||||
|
* 考察人姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 考察人手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
/**
|
||||||
|
* 考察时间,格式为 `yyyy-MM-dd HH:mm:ss`
|
||||||
|
*/
|
||||||
|
private String inspectionTime;
|
||||||
|
/**
|
||||||
|
* 是否合格:`1` 合格,`2` 不合格
|
||||||
|
*/
|
||||||
|
private Integer qualified;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保持兼容,先用通用结构承接第三方返回
|
||||||
|
* 每项通常包含 path/url
|
||||||
|
*/
|
||||||
|
private List<ImageInfo> images;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class ImageInfo {
|
||||||
|
private String path;
|
||||||
|
private String url;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,4 +34,6 @@ public class OpportunityInfoResponse {
|
|||||||
private Integer berthNum;
|
private Integer berthNum;
|
||||||
@ApiModelProperty("关注人用户信息 ,如有")
|
@ApiModelProperty("关注人用户信息 ,如有")
|
||||||
private List<UserResponse> atUsers;
|
private List<UserResponse> atUsers;
|
||||||
|
@ApiModelProperty("是否合格,1:合格,2:不合格,0|null:未考察")
|
||||||
|
private Integer qualified;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.cool.store.request.oppty.*;
|
|||||||
import com.cool.store.response.oppty.CityResponse;
|
import com.cool.store.response.oppty.CityResponse;
|
||||||
import com.cool.store.response.oppty.OpportunityDetailResponse;
|
import com.cool.store.response.oppty.OpportunityDetailResponse;
|
||||||
import com.cool.store.response.oppty.OpportunityInfoPageResponse;
|
import com.cool.store.response.oppty.OpportunityInfoPageResponse;
|
||||||
|
import com.cool.store.response.oppty.InspectionRecordPageResponse;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -66,5 +67,22 @@ public interface ThirdOpportunityService {
|
|||||||
*/
|
*/
|
||||||
List<CityResponse> cityList(CityRequest request);
|
List<CityResponse> cityList(CityRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加考察记录
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String addInspectionRecord(AddInspectionRecordRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考察列表
|
||||||
|
*/
|
||||||
|
InspectionRecordPageResponse listInspectionRecord(ListInspectionRecordRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更改机会点坐标
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String saveAdjustLocation(SaveAdjustLocationRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,23 @@ public class ThirdOpportunityServiceImpl implements ThirdOpportunityService {
|
|||||||
return executeApiCall(url, requestBody, List.class);
|
return executeApiCall(url, requestBody, List.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String addInspectionRecord(AddInspectionRecordRequest requestBody) {
|
||||||
|
String url = apiUrl + "open/oppty/v1/addInspectionRecord";;
|
||||||
|
return executeApiCall(url, requestBody, String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InspectionRecordPageResponse listInspectionRecord(ListInspectionRecordRequest requestBody) {
|
||||||
|
String url = apiUrl + "open/oppty/v1/listInspectionRecord";
|
||||||
|
return executeApiCall(url, requestBody, InspectionRecordPageResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String saveAdjustLocation(SaveAdjustLocationRequest requestBody) {
|
||||||
|
String url = apiUrl + "open/oppty/v1/saveAdjustLocation";
|
||||||
|
return executeApiCall(url, requestBody, String.class);
|
||||||
|
}
|
||||||
|
|
||||||
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType) {
|
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType) {
|
||||||
// 1. 打印请求前日志
|
// 1. 打印请求前日志
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.cool.store.response.huoma.ShopBaseInfoResponse;
|
|||||||
import com.cool.store.response.oppty.CityResponse;
|
import com.cool.store.response.oppty.CityResponse;
|
||||||
import com.cool.store.response.oppty.OpportunityDetailResponse;
|
import com.cool.store.response.oppty.OpportunityDetailResponse;
|
||||||
import com.cool.store.response.oppty.OpportunityInfoPageResponse;
|
import com.cool.store.response.oppty.OpportunityInfoPageResponse;
|
||||||
|
import com.cool.store.response.oppty.InspectionRecordPageResponse;
|
||||||
import com.cool.store.service.HuoMaService;
|
import com.cool.store.service.HuoMaService;
|
||||||
import com.cool.store.service.ThirdBigDataService;
|
import com.cool.store.service.ThirdBigDataService;
|
||||||
import com.cool.store.service.ThirdOpportunityService;
|
import com.cool.store.service.ThirdOpportunityService;
|
||||||
@@ -171,5 +172,21 @@ public class ThirdApiController {
|
|||||||
return ResponseResult.success(huoMaService.getIncomeSummary(request));
|
return ResponseResult.success(huoMaService.getIncomeSummary(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/addInspectionRecord")
|
||||||
|
@ApiOperation("新增机会点考察记录")
|
||||||
|
public ResponseResult<String> addInspectionRecord(@Valid @RequestBody AddInspectionRecordRequest request) {
|
||||||
|
return ResponseResult.success(thirdOpportunityService.addInspectionRecord(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/listInspectionRecord")
|
||||||
|
@ApiOperation("分页查询机会点考察记录")
|
||||||
|
public ResponseResult<InspectionRecordPageResponse> listInspectionRecord(@Valid @RequestBody ListInspectionRecordRequest request) {
|
||||||
|
return ResponseResult.success(thirdOpportunityService.listInspectionRecord(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/saveAdjustLocation")
|
||||||
|
@ApiOperation("设置机会点调整后坐标")
|
||||||
|
public ResponseResult<String> saveAdjustLocation(@Valid @RequestBody SaveAdjustLocationRequest request) {
|
||||||
|
return ResponseResult.success(thirdOpportunityService.saveAdjustLocation(request));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user