feat:平台账号
This commit is contained in:
@@ -15,14 +15,14 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class AccountAuditDTO {
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
@ApiModelProperty(value = "门店ID",required = true)
|
||||
@NotNull(message = "门店ID不能为空")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("审核标识 1-通过 2-拒绝")
|
||||
@ApiModelProperty("审核标识 1-通过 2-拒绝 推送数据时不需要传 审核开通数据时必传")
|
||||
private Integer auditFlag;
|
||||
|
||||
@ApiModelProperty("HUOMA-火码 YLS-云流水 XZG-新掌柜")
|
||||
@ApiModelProperty(value = "HUOMA-火码 YLS-云流水 XZG-新掌柜" ,required = true)
|
||||
private ShopAccountEnum shopAccountEnum;
|
||||
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class AccountEntryStatusAuditDTO {
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
@ApiModelProperty(value = "门店ID",required = true)
|
||||
@NotNull(message = "门店ID不能为空")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("审核标识 1-通过 2-拒绝")
|
||||
@ApiModelProperty(value = "审核标识 1-通过 2-拒绝",required = true)
|
||||
private Integer auditFlag;
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.dto.yun;
|
||||
package com.cool.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -16,11 +16,11 @@ import javax.validation.constraints.NotNull;
|
||||
public class AccountEntryStatusChangeDTO {
|
||||
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
@ApiModelProperty(value = "门店ID" ,required = true)
|
||||
@NotNull(message = "门店ID不能为空")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("进件状态 5-进件成功 6-进件失败")
|
||||
@ApiModelProperty(value = "进件状态 5-进件成功 6-进件失败",required = true)
|
||||
@Max(6)
|
||||
@Min(5)
|
||||
private Integer entryStatus;
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/4/9 15:08
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GetAccessTokenDTO {
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String shopCode;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.dto;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/4/7 16:31
|
||||
@@ -11,12 +13,14 @@ import lombok.Data;
|
||||
@Data
|
||||
public class ModifyPasswordDTO {
|
||||
|
||||
@ApiModelProperty("盐值")
|
||||
@ApiModelProperty(value = "盐值",required = true)
|
||||
String passwordSalt;
|
||||
@ApiModelProperty("密码")
|
||||
@ApiModelProperty(value = "密码",required = true)
|
||||
String password;
|
||||
@ApiModelProperty("门店ID")
|
||||
@ApiModelProperty(value = "门店ID",required = true)
|
||||
Long shopId;
|
||||
@ApiModelProperty(value = "门店ID",hidden = true)
|
||||
List<String> shopCode;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.cool.store.response.bigdata;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.enums.ResponseCodeEnum;
|
||||
import lombok.Data;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -12,4 +15,18 @@ public class ApiResponse<T> {
|
||||
private String msg;
|
||||
private int code;
|
||||
private T data;
|
||||
private String stackTrace;
|
||||
private String requestId;
|
||||
|
||||
|
||||
public ApiResponse(int code, String msg, T data) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
this.requestId = MDC.get(CommonConstants.REQUEST_ID);
|
||||
}
|
||||
|
||||
public static<T> ApiResponse<T> success(T data) {
|
||||
return new ApiResponse(ResponseCodeEnum.SUCCESS.getCode(), "ok", data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.GetAccessTokenDTO;
|
||||
import com.cool.store.dto.ModifyPasswordDTO;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/4/9 14:23
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface PushService {
|
||||
|
||||
|
||||
/**
|
||||
* 推送数据到下游系统 新管家
|
||||
* @param zxjpApiRequest
|
||||
* @return
|
||||
*/
|
||||
Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest);
|
||||
|
||||
/**
|
||||
* 推送数据到下游系统 POS
|
||||
* @param zxjpApiRequest
|
||||
* @return
|
||||
*/
|
||||
Boolean pushDataToPOS(ZxjpApiRequest zxjpApiRequest);
|
||||
|
||||
/**
|
||||
* 修改密码推送到下游系统
|
||||
* @param modifyPasswordDTO
|
||||
* @return
|
||||
*/
|
||||
Boolean modifyDownstreamSystem(ModifyPasswordDTO modifyPasswordDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 获取云流水token
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String getYlsToken(GetAccessTokenDTO dto);
|
||||
|
||||
/**
|
||||
* 获取新管家token
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String getXzgToken(GetAccessTokenDTO dto);
|
||||
|
||||
/**
|
||||
* 获取Pos token
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String getPosToken(GetAccessTokenDTO dto);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import com.cool.store.dto.AccountAuditDTO;
|
||||
import com.cool.store.dto.AccountEntryStatusAuditDTO;
|
||||
import com.cool.store.dto.ModifyPasswordDTO;
|
||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||
import com.cool.store.dto.yun.AccountEntryStatusChangeDTO;
|
||||
import com.cool.store.dto.AccountEntryStatusChangeDTO;
|
||||
import com.cool.store.enums.DownSystemTypeEnum;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
|
||||
|
||||
@@ -2,10 +2,13 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.ShopAccountDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.dto.StatusRefreshDTO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.OpenStatusEnum;
|
||||
import com.cool.store.enums.ShopAccountEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.service.OpenApiService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -27,6 +30,8 @@ public class OpenApiServiceImpl implements OpenApiService {
|
||||
ShopAccountDAO accountDAO;
|
||||
@Resource
|
||||
ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
ShopStageInfoDAO shopStageInfoDAO;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -39,7 +44,10 @@ public class OpenApiServiceImpl implements OpenApiService {
|
||||
Integer openStatus = statusRefreshDTO.getOpenStatus()?OpenStatusEnum.OPENSTATUSENUM_5.getCode():OpenStatusEnum.OPENSTATUSENUM_6.getCode();
|
||||
accountDAO.updateStatusByShopIdAndSystemName(shopInfoDO.getId(), Arrays.asList(statusRefreshDTO.getSystemSource()), openStatus);
|
||||
|
||||
//订货系统开通完成 todo suzhuhong_
|
||||
//订货系统开通完成
|
||||
if (ShopAccountEnum.YLS.getSystemName().equals(statusRefreshDTO.getSystemSource())){
|
||||
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_173);
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.GetAccessTokenDTO;
|
||||
import com.cool.store.dto.ModifyPasswordDTO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.response.huoma.ShopBaseInfoResponse;
|
||||
import com.cool.store.response.oppty.OpportunityApiResponse;
|
||||
import com.cool.store.service.PushService;
|
||||
import com.cool.store.utils.HmacSigner;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/4/9 14:24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PushServiceImpl implements PushService {
|
||||
|
||||
// TODO: 2025/4/9 suzhuhong_
|
||||
|
||||
@Value("${api.auth.url}")
|
||||
private String url;
|
||||
|
||||
@Value("${api.auth.username}")
|
||||
private String username;
|
||||
|
||||
@Value("${api.auth.secret}")
|
||||
private String secret;
|
||||
|
||||
@Value("${xgj.api.auth.url}")
|
||||
private String xgjUrl;
|
||||
|
||||
@Value("${xgj.api.auth.username}")
|
||||
private String xgjUsername;
|
||||
|
||||
@Value("${xgj.api.auth.secret}")
|
||||
private String xgjSecret;
|
||||
|
||||
@Value("${yls.api.auth.url}")
|
||||
private String ylsUrl;
|
||||
|
||||
@Value("${yls.api.auth.username}")
|
||||
private String ylsUsername;
|
||||
|
||||
@Value("${yls.api.auth.secret}")
|
||||
private String ylsSecret;
|
||||
|
||||
@Value("${xzg.api.auth.url}")
|
||||
private String xzgUrl;
|
||||
|
||||
@Value("${xzg.api.auth.username}")
|
||||
private String xzgUsername;
|
||||
|
||||
@Value("${xzg.api.auth.secret}")
|
||||
private String xzgSecret;
|
||||
|
||||
@Resource
|
||||
OkHttpClient okHttpClient;
|
||||
@Resource
|
||||
ObjectMapper objectMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest) {
|
||||
String apiUrl = xgjUrl + "XXX";
|
||||
return executeApiCall(apiUrl,zxjpApiRequest, Boolean.class,xgjUsername,xgjSecret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean pushDataToPOS(ZxjpApiRequest zxjpApiRequest) {
|
||||
String apiUrl = url + "XXX";
|
||||
return executeApiCall(apiUrl,zxjpApiRequest, Boolean.class,username,secret);
|
||||
}
|
||||
|
||||
private Boolean modifyXGJPassword(ModifyPasswordDTO dto) {
|
||||
String apiUrl = xgjUrl + "XXX";
|
||||
return executeApiCall(apiUrl,dto, Boolean.class,xgjUsername,xgjSecret);
|
||||
}
|
||||
|
||||
private Boolean modifyPosPassword(ModifyPasswordDTO dto) {
|
||||
String apiUrl = url + "XXX";
|
||||
return executeApiCall(apiUrl,dto, Boolean.class,username,secret);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean modifyDownstreamSystem(ModifyPasswordDTO modifyPasswordDTO) {
|
||||
try {
|
||||
this.modifyPosPassword(modifyPasswordDTO);
|
||||
this.modifyXGJPassword(modifyPasswordDTO);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getYlsToken(GetAccessTokenDTO dto) {
|
||||
String apiUrl = url + "XXX";
|
||||
return executeApiCall(apiUrl,dto, String.class,ylsUsername,ylsSecret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getXzgToken(GetAccessTokenDTO dto) {
|
||||
String apiUrl = url + "XXX";
|
||||
return executeApiCall(apiUrl,dto, String.class,xzgUsername,xzgSecret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPosToken(GetAccessTokenDTO dto) {
|
||||
String apiUrl = url + "XXX";
|
||||
return executeApiCall(apiUrl,dto, String.class,username,secret);
|
||||
}
|
||||
|
||||
|
||||
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType,String username,String secret) {
|
||||
// 1. 打印请求前日志
|
||||
logRequest(url, requestBody);
|
||||
|
||||
try {
|
||||
Request request = buildRequest(requestBody, url,username,secret);
|
||||
|
||||
try (Response response = okHttpClient.newCall(request).execute()) {
|
||||
// 2. 获取原始响应内容
|
||||
String responseBody = response.body().string();
|
||||
|
||||
// 3. 打印响应日志
|
||||
logResponse(url, response.code(), responseBody);
|
||||
|
||||
if (!response.isSuccessful()) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
|
||||
"HTTP请求失败,状态码: " + response.code());
|
||||
}
|
||||
|
||||
// 4. 解析响应
|
||||
JavaType javaType = objectMapper.getTypeFactory()
|
||||
.constructParametricType(OpportunityApiResponse.class, responseType);
|
||||
|
||||
OpportunityApiResponse<T> apiResponse = objectMapper.readValue(responseBody, javaType);
|
||||
|
||||
if (apiResponse.getCode() != 200) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
|
||||
"业务逻辑错误: " + apiResponse.getMsg());
|
||||
}
|
||||
|
||||
return apiResponse.getData();
|
||||
}
|
||||
} catch (ServiceException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("API调用异常 - URL: {}, 错误: {}", url, e.getMessage(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void logRequest(String url, Object requestBody) {
|
||||
if (log.isInfoEnabled()) {
|
||||
try {
|
||||
log.info("\n======= 请求开始 =======\n" +
|
||||
"API地址: {}\n" +
|
||||
"请求参数: {}\n" +
|
||||
"======= 请求结束 =======",
|
||||
url,
|
||||
objectMapper.writerWithDefaultPrettyPrinter()
|
||||
.writeValueAsString(requestBody));
|
||||
} catch (JsonProcessingException e) {
|
||||
log.warn("日志JSON序列化失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录响应日志
|
||||
*/
|
||||
private void logResponse(String url, int statusCode, String responseBody) {
|
||||
if (log.isInfoEnabled()) {
|
||||
try {
|
||||
// 尝试美化JSON输出
|
||||
Object json = objectMapper.readValue(responseBody, Object.class);
|
||||
String prettyResponse = objectMapper.writerWithDefaultPrettyPrinter()
|
||||
.writeValueAsString(json);
|
||||
|
||||
log.info("\n======= 响应开始 =======\n" +
|
||||
"API地址: {}\n" +
|
||||
"HTTP状态码: {}\n" +
|
||||
"响应内容: {}\n" +
|
||||
"======= 响应结束 =======",
|
||||
url,
|
||||
statusCode,
|
||||
prettyResponse);
|
||||
} catch (Exception e) {
|
||||
// 非JSON响应或解析失败时直接输出原始内容
|
||||
log.info("\n======= 响应开始 =======\n" +
|
||||
"API地址: {}\n" +
|
||||
"HTTP状态码: {}\n" +
|
||||
"原始响应: {}\n" +
|
||||
"======= 响应结束 =======",
|
||||
url,
|
||||
statusCode,
|
||||
responseBody);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Request buildRequest(Object requestBody, String url,String username,String secret) {
|
||||
|
||||
try {
|
||||
Map<String, String> authHeaders = HmacSigner.generateHeaders(
|
||||
username, secret, JSONObject.toJSONString(requestBody));
|
||||
|
||||
log.debug("签名生成 - 签名结果: {}", JSONObject.toJSONString(authHeaders));
|
||||
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"),
|
||||
JSONObject.toJSONString(requestBody)
|
||||
);
|
||||
|
||||
return new Request.Builder()
|
||||
.url(url)
|
||||
.post(body)
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("x-Date", authHeaders.get("x-Date"))
|
||||
.addHeader("Digest", authHeaders.get("Digest"))
|
||||
.addHeader("Authorization", authHeaders.get("Authorization"))
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_SIGN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.cool.store.dto.AccountAuditDTO;
|
||||
import com.cool.store.dto.AccountEntryStatusAuditDTO;
|
||||
import com.cool.store.dto.ModifyPasswordDTO;
|
||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||
import com.cool.store.dto.yun.AccountEntryStatusChangeDTO;
|
||||
import com.cool.store.dto.AccountEntryStatusChangeDTO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.entity.ShopAccountDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
@@ -16,9 +16,9 @@ import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.OpenStatusEnum;
|
||||
import com.cool.store.enums.ShopAccountEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ShopAccountMapper;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.cool.store.service.PushService;
|
||||
import com.cool.store.service.ShopAccountService;
|
||||
import com.cool.store.service.ShopService;
|
||||
import com.cool.store.service.SyncDataService;
|
||||
@@ -47,6 +47,8 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
||||
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
@Resource
|
||||
SyncDataService syncDataService;
|
||||
@Resource
|
||||
PushService pushService;
|
||||
|
||||
@Override
|
||||
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
|
||||
@@ -105,10 +107,10 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
||||
|
||||
//当前加盟商所有开店成功的CODE
|
||||
List<String> shopCodeList = shopListSuccessOpen.stream().map(MiniShopsResponse::getShopCode).collect(Collectors.toList());
|
||||
|
||||
modifyPasswordDTO.setShopCode(shopCodeList);
|
||||
|
||||
//推送下游系统
|
||||
// TODO: 2025/4/8 suzhuhong_
|
||||
pushService.modifyDownstreamSystem(modifyPasswordDTO);
|
||||
|
||||
return Boolean.TRUE;
|
||||
|
||||
@@ -192,11 +194,22 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
||||
if (accountAuditDTO.getShopId()==null||accountAuditDTO.getShopAccountEnum()==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
|
||||
DownSystemTypeEnum downSystemTypeEnum = DownSystemTypeEnum.XGJ;
|
||||
if ( ShopAccountEnum.HUOMA.equals(accountAuditDTO.getShopAccountEnum())){
|
||||
downSystemTypeEnum = DownSystemTypeEnum.POS;
|
||||
}
|
||||
ZxjpApiRequest data = this.getData(accountAuditDTO.getShopId(), downSystemTypeEnum);
|
||||
// TODO: 2025/4/8 suzhuhong_
|
||||
|
||||
|
||||
return null;
|
||||
try {
|
||||
if (DownSystemTypeEnum.POS.equals(downSystemTypeEnum)){
|
||||
pushService.pushDataToPOS(data);
|
||||
}else {
|
||||
pushService.pushDataToXGJ(data);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用异常: " + e.getMessage());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
@@ -8,24 +9,19 @@ import com.cool.store.request.huoma.ShopBasicInfoRequest;
|
||||
import com.cool.store.response.IncomeBaseResponse;
|
||||
import com.cool.store.response.IncomeSummaryResponse;
|
||||
import com.cool.store.response.OrderSummaryResponse;
|
||||
import com.cool.store.response.bigdata.ApiResponse;
|
||||
import com.cool.store.response.huoma.ShopBaseInfoResponse;
|
||||
import com.cool.store.response.oppty.OpportunityApiResponse;
|
||||
import com.cool.store.service.HuoMaService;
|
||||
import com.cool.store.utils.HmacSigner;
|
||||
import com.cool.store.utils.JsonUtils;
|
||||
import com.cool.store.utils.SignatureUtils;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -35,7 +31,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class HuoMaServiceImpl implements HuoMaService {
|
||||
public class ThirdHuoMaServiceImpl implements HuoMaService {
|
||||
|
||||
@Value("${api.auth.url}")
|
||||
private String url;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.StatusRefreshDTO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.bigdata.ApiResponse;
|
||||
import com.cool.store.service.OpenApiService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -24,8 +24,8 @@ public class OpenApiController {
|
||||
OpenApiService openApiService;
|
||||
|
||||
@GetMapping("/statusRefresh")
|
||||
public ResponseResult<Boolean> statusRefresh(StatusRefreshDTO statusRefreshDTO){
|
||||
return ResponseResult.success(openApiService.statusRefresh(statusRefreshDTO));
|
||||
public ApiResponse<Boolean> statusRefresh(StatusRefreshDTO statusRefreshDTO){
|
||||
return ApiResponse.success(openApiService.statusRefresh(statusRefreshDTO));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.AccountAuditDTO;
|
||||
import com.cool.store.dto.AccountEntryStatusAuditDTO;
|
||||
import com.cool.store.dto.GetAccessTokenDTO;
|
||||
import com.cool.store.dto.ShopAccount.ShopAccountDTO;
|
||||
import com.cool.store.dto.yun.AccountEntryStatusChangeDTO;
|
||||
import com.cool.store.dto.AccountEntryStatusChangeDTO;
|
||||
import com.cool.store.enums.DownSystemTypeEnum;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.PushService;
|
||||
import com.cool.store.service.ShopAccountService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -31,6 +33,8 @@ public class ShopAccountController {
|
||||
|
||||
@Resource
|
||||
ShopAccountService accountService;
|
||||
@Resource
|
||||
PushService pushService;
|
||||
|
||||
@ApiOperation("根据门店shopId查询平台账号")
|
||||
@GetMapping("/getShopAccountByShopId")
|
||||
@@ -47,7 +51,7 @@ public class ShopAccountController {
|
||||
|
||||
@ApiOperation("开通状态审核")
|
||||
@PostMapping("/auditAccount")
|
||||
public ResponseResult<Boolean> getData(@RequestBody @Validated AccountAuditDTO accountAuditDTO) {
|
||||
public ResponseResult<Boolean> auditAccount(@RequestBody @Validated AccountAuditDTO accountAuditDTO) {
|
||||
return ResponseResult.success(accountService.auditAccount(accountAuditDTO));
|
||||
}
|
||||
|
||||
@@ -59,7 +63,7 @@ public class ShopAccountController {
|
||||
|
||||
@ApiOperation("进件状态审核")
|
||||
@PostMapping("/accountEntryStatusAudit")
|
||||
public ResponseResult<Boolean> getDaa(@RequestBody @Validated AccountEntryStatusAuditDTO dto) {
|
||||
public ResponseResult<Boolean> accountEntryStatusAudit(@RequestBody @Validated AccountEntryStatusAuditDTO dto) {
|
||||
return ResponseResult.success(accountService.accountEntryStatusAudit(dto));
|
||||
}
|
||||
|
||||
@@ -70,5 +74,23 @@ public class ShopAccountController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取云流水免登token")
|
||||
@PostMapping("/getYlsToken")
|
||||
public ResponseResult<String> getYlsToken(@RequestBody @Validated GetAccessTokenDTO dto) {
|
||||
return ResponseResult.success(pushService.getYlsToken(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("获取POS免登token")
|
||||
@PostMapping("/getPosToken")
|
||||
public ResponseResult<String> getPosToken(@RequestBody @Validated GetAccessTokenDTO dto) {
|
||||
return ResponseResult.success(pushService.getPosToken(dto));
|
||||
}
|
||||
|
||||
@ApiOperation("获取新掌柜免登token")
|
||||
@PostMapping("/getXzgToken")
|
||||
public ResponseResult<String> getXzgToken(@RequestBody @Validated GetAccessTokenDTO dto) {
|
||||
return ResponseResult.success(pushService.getXzgToken(dto));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ enterprise.dingCorpId=wpayJeDAAAhGIFgUJpJN-zg39JuNbYhg
|
||||
##qywx.task.notice.url1=https://tstore-api.coolstore.cn/notice?corpId=%s&appType=%s&target=%s
|
||||
qywx.task.notice.url2=https://tstore-h5.coolstore.cn/?corpId=%s&appType=%s#/notice?target=%s¬iceType=zx&corpId=%s&appType=%s&eid=%s
|
||||
|
||||
#机会点
|
||||
#机会点地址
|
||||
third.party.appKey=IGSAEQoakR2HEaYx
|
||||
third.party.appSecret=aPsA99K1obFeFm3m
|
||||
zx.opportunity.url=https://snp.wenmatech.com/
|
||||
@@ -93,9 +93,25 @@ zx.big.data.url=https://ds.zhengxinfood.com/
|
||||
zx.big.data.appKey=ff203b5567744feaaae49fb86f58c5bf
|
||||
zx.big.data.appSecret=35b8b9a400b4430fa022190be0913cd6
|
||||
|
||||
#火吗POS
|
||||
api.auth.url=https://api.zhengxindzg.cn
|
||||
api.auth.username=GkqgAhUJ7p9swJo
|
||||
api.auth.secret=NzVrnS3OWiupdDY
|
||||
|
||||
#新管家账号
|
||||
xgj.api.auth.url=****
|
||||
xgj.api.auth.username=****
|
||||
xgj.api.auth.secret=****
|
||||
|
||||
#云流水账号
|
||||
yls.api.auth.url=****
|
||||
yls.api.auth.username=****
|
||||
yls.api.auth.secret=****
|
||||
|
||||
#新掌柜账号
|
||||
xzg.api.auth.url=****
|
||||
xzg.api.auth.username=****
|
||||
xzg.api.auth.secret=****
|
||||
|
||||
cool.api.appKey=123
|
||||
cool.api.secret=123
|
||||
|
||||
Reference in New Issue
Block a user