退款任务 优化,进件优化
This commit is contained in:
parent
0b2b50e891
commit
aa7253d71e
@ -183,4 +183,13 @@ public class ShopOrderReturn implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "是否转单(BOOL):0-否; 1-是")
|
@ApiModelProperty(value = "是否转单(BOOL):0-否; 1-是")
|
||||||
private Integer return_is_transfer;
|
private Integer return_is_transfer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "尝试退款操作次数,超过15次,标记 return_channel_flag=2 退款异常")
|
||||||
|
private Integer try_return_count;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "新建时间")
|
||||||
|
private Date created_at;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private Date updated_at;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,4 +169,144 @@ public class RestTemplateHttpUtil {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送拉卡拉的POST请求并处理异常,返回统一格式的结果
|
||||||
|
*
|
||||||
|
* @param url 请求URL
|
||||||
|
* @param headers 请求头
|
||||||
|
* @param requestBody 请求体
|
||||||
|
* @param responseType 响应类型
|
||||||
|
* @param <T> 泛型类型
|
||||||
|
* @return 包含retCode和retMsg的JSONObject
|
||||||
|
*/
|
||||||
|
public static <T> JSONObject sendLklPost(String url, JSONObject headers, JSONObject requestBody, Class<T> responseType) {
|
||||||
|
HttpHeaders httpHeaders = new HttpHeaders();
|
||||||
|
httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||||
|
if (headers != null) {
|
||||||
|
for (Map.Entry<String, Object> entry : headers.entrySet()) {
|
||||||
|
httpHeaders.add(entry.getKey(), (String) entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
HttpEntity<Object> entity = new HttpEntity<>(requestBody, httpHeaders);
|
||||||
|
|
||||||
|
try {
|
||||||
|
ResponseEntity<T> response = restTemplate.postForEntity(url, entity, responseType);
|
||||||
|
if (response == null) {
|
||||||
|
return new JSONObject().set("retCode", "000001").set("retMsg", "无响应值");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理成功的响应
|
||||||
|
if (response.getStatusCode() == HttpStatus.OK) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.set("retCode", "000000");
|
||||||
|
result.set("retMsg", "请求成功");
|
||||||
|
|
||||||
|
// 如果响应体是JSONObject类型,解析其中的retCode和retMsg
|
||||||
|
if (response.getBody() instanceof JSONObject) {
|
||||||
|
JSONObject responseBody = (JSONObject) response.getBody();
|
||||||
|
// 尝试获取返回码和消息
|
||||||
|
String[] codeFields = {"retCode", "ret_code", "code", "code"};
|
||||||
|
String[] msgFields = {"retMsg", "ret_msg", "msg", "message"};
|
||||||
|
|
||||||
|
String retCode = findFirstNonNullValue(responseBody, codeFields);
|
||||||
|
String retMsg = findFirstNonNullValue(responseBody, msgFields);
|
||||||
|
|
||||||
|
if (retCode != null) result.set("retCode", retCode);
|
||||||
|
if (retMsg != null) result.set("retMsg", retMsg);
|
||||||
|
|
||||||
|
result.set("respData", responseBody);
|
||||||
|
} else if (response.getBody() != null) {
|
||||||
|
result.set("respData", response.getBody().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
// 处理其他HTTP状态码
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.set("retCode", String.valueOf(response.getStatusCode().value()));
|
||||||
|
result.set("retMsg", "HTTP状态码: " + response.getStatusCode().getReasonPhrase());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} catch (org.springframework.web.client.HttpClientErrorException e) {
|
||||||
|
// 处理4xx错误
|
||||||
|
return handleLklErrorResponse(e, String.valueOf(e.getStatusCode().value()));
|
||||||
|
} catch (org.springframework.web.client.HttpServerErrorException e) {
|
||||||
|
// 处理5xx错误
|
||||||
|
return handleLklErrorResponse(e, String.valueOf(e.getStatusCode().value()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 处理其他异常
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.set("retCode", "500");
|
||||||
|
result.set("retMsg", "请求异常: " + e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在JSONObject中查找第一个非空值
|
||||||
|
*
|
||||||
|
* @param json JSONObject对象
|
||||||
|
* @param fields 字段名数组
|
||||||
|
* @return 第一个非空值,如果都为空则返回null
|
||||||
|
*/
|
||||||
|
private static String findFirstNonNullValue(JSONObject json, String[] fields) {
|
||||||
|
for (String field : fields) {
|
||||||
|
String value = json.getStr(field);
|
||||||
|
if (value != null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理错误响应
|
||||||
|
*
|
||||||
|
* @param e 异常对象
|
||||||
|
* @param statusCode 状态码
|
||||||
|
* @return 包含错误信息的JSONObject
|
||||||
|
*/
|
||||||
|
private static JSONObject handleLklErrorResponse(org.springframework.web.client.RestClientResponseException e, String statusCode) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
|
try {
|
||||||
|
String errorResponse = e.getResponseBodyAsString();
|
||||||
|
if (cn.hutool.core.util.StrUtil.isNotBlank(errorResponse)) {
|
||||||
|
// 尝试解析错误响应
|
||||||
|
JSONObject errorJson;
|
||||||
|
try {
|
||||||
|
errorJson = JSONUtil.parseObj(errorResponse);
|
||||||
|
} catch (Exception parseException) {
|
||||||
|
// 如果解析失败,创建一个新的JSONObject
|
||||||
|
errorJson = new JSONObject();
|
||||||
|
errorJson.set("retCode", statusCode);
|
||||||
|
errorJson.set("retMsg", errorResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 统一定义需要查找的字段名
|
||||||
|
String[] codeFields = {"retCode", "ret_code", "code"};
|
||||||
|
String[] msgFields = {"retMsg", "ret_msg", "msg", "message"};
|
||||||
|
|
||||||
|
String retCode = findFirstNonNullValue(errorJson, codeFields);
|
||||||
|
String retMsg = findFirstNonNullValue(errorJson, msgFields);
|
||||||
|
|
||||||
|
result.set("retCode", cn.hutool.core.util.StrUtil.isNotBlank(retCode) ? retCode : statusCode);
|
||||||
|
result.set("retMsg", cn.hutool.core.util.StrUtil.isNotBlank(retMsg) ? retMsg : "请求失败: " + e.getStatusText());
|
||||||
|
|
||||||
|
// 保留原始错误信息
|
||||||
|
result.set("rawError", errorResponse);
|
||||||
|
} else {
|
||||||
|
result.set("retCode", statusCode);
|
||||||
|
result.set("retMsg", "请求失败: " + e.getStatusText());
|
||||||
|
}
|
||||||
|
} catch (Exception parseException) {
|
||||||
|
result.set("retCode", statusCode);
|
||||||
|
result.set("retMsg", "请求失败,无法解析错误响应: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,9 @@ public class UpdateOrderRefundJob extends QuartzJobBean {
|
|||||||
List<String> return_ids = orderReturnService.getOnlineRefundReturnId();
|
List<String> return_ids = orderReturnService.getOnlineRefundReturnId();
|
||||||
for (String return_id : return_ids) {
|
for (String return_id : return_ids) {
|
||||||
if (!orderReturnService.doOnlineRefund(return_id)) {
|
if (!orderReturnService.doOnlineRefund(return_id)) {
|
||||||
LogUtil.error(String.format("return_id : %s 原路退回出错", return_id));
|
LogUtil.error(String.format("return_id: %s 原路退回出错", return_id));
|
||||||
|
|
||||||
|
// 处理异常标记
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -316,7 +316,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新商家的hasEsigned状态=1
|
// 更新商家的hasEsigned状态=1
|
||||||
shopMchEntryService.updateMulStatus(esignContract.getMch_mobile(), "", 1, 0, 0, 0, 0, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
shopMchEntryService.updateMulStatus(0L, esignContract.getMch_mobile(), "", 1, 0, 0, 0, 0, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
||||||
|
|
||||||
return new ResponseEntity<>(new JSONObject().put("code", 200).put("msg", "success").toString(), HttpStatus.OK);
|
return new ResponseEntity<>(new JSONObject().put("code", 200).put("msg", "success").toString(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -493,6 +493,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
reqBody.put("req_data", reqData);
|
reqBody.put("req_data", reqData);
|
||||||
|
|
||||||
String reqUrl = serverUrl + "/api/v3/mms/open_api/ec/apply";
|
String reqUrl = serverUrl + "/api/v3/mms/open_api/ec/apply";
|
||||||
|
//"/api/v3/mms/open_api/ec/apply"; "/api/v2/mms/openApi/ec/apply";
|
||||||
|
|
||||||
String privateKey = LakalaUtil.getResourceFile(priKeyPath, false, true);
|
String privateKey = LakalaUtil.getResourceFile(priKeyPath, false, true);
|
||||||
String authorization = LakalaUtil.genAuthorization(privateKey, appId, serialNo, reqBody.toString());
|
String authorization = LakalaUtil.genAuthorization(privateKey, appId, serialNo, reqBody.toString());
|
||||||
@ -503,32 +504,24 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
log.debug("申请入网电子合同请求参数:{}", JsonUtil.toJSONString(reqBody));
|
log.debug("申请入网电子合同请求参数:{}", JsonUtil.toJSONString(reqBody));
|
||||||
|
|
||||||
String errMsg = "";
|
String errMsg = "";
|
||||||
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostBodyBackEntity(reqUrl, header, reqBody, JSONObject.class);
|
JSONObject response = RestTemplateHttpUtil.sendLklPost(reqUrl, header, reqBody, JSONObject.class);
|
||||||
log.debug("申请入网电子合同响应参数:{}", JsonUtil.toJSONString(response));
|
log.debug("拉卡拉申请入网电子合同响应参数:{}", JsonUtil.toJSONString(response));
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK) {
|
if (ObjectUtil.isEmpty(response) || !lklSuccessCode.equals(response.getStr("retCode"))) {
|
||||||
errMsg = "申请入网电子合同失败,无响应数据!";
|
errMsg = "拉卡拉申请入网电子合同," + response.getStr("retMsg");
|
||||||
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, errMsg);
|
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, errMsg);
|
||||||
return Pair.of(false, errMsg);
|
return Pair.of(false, errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject respBody = response.getBody();
|
JSONObject respData = response.getJSONObject("respData");
|
||||||
if (ObjectUtil.isNotEmpty(respBody) && !lklSuccessCode.equals(respBody.getStr("code"))) {
|
|
||||||
errMsg = "申请入网电子合同失败," + (StrUtil.isBlank(respBody.getStr("msg")) ? "返回状态有误" : respBody.getStr("msg"));
|
|
||||||
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, errMsg);
|
|
||||||
return Pair.of(false, errMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject respData = respBody.getJSONObject("resp_data");
|
|
||||||
if (respData == null) {
|
if (respData == null) {
|
||||||
errMsg = "申请入网电子合同失败,无data返回数据!";
|
errMsg = "拉卡拉申请入网电子合同," + response.getStr("retMsg");
|
||||||
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, errMsg);
|
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, errMsg);
|
||||||
return Pair.of(false, errMsg);
|
return Pair.of(false, errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 商家入网申请电子合同处理数据
|
// 商家入网申请电子合同处理数据
|
||||||
// 先写入本地数据库表中
|
// 先写入本地数据库表中
|
||||||
|
|
||||||
LklLedgerEc record = new LklLedgerEc();
|
LklLedgerEc record = new LklLedgerEc();
|
||||||
record.setMch_id(shopMchEntry.getId());
|
record.setMch_id(shopMchEntry.getId());
|
||||||
record.setMch_mobile(contractMobile);
|
record.setMch_mobile(contractMobile);
|
||||||
@ -538,7 +531,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
record.setStatus(CommonConstant.Enable);
|
record.setStatus(CommonConstant.Enable);
|
||||||
String ecResultUrl = respData.getStr("result_url");
|
String ecResultUrl = respData.getStr("result_url");
|
||||||
record.setResult_url(ecResultUrl);
|
record.setResult_url(ecResultUrl);
|
||||||
record.setResp_body(respBody.toString());
|
record.setResp_body(response.toString());
|
||||||
Boolean success = lklLedgerEcService.addOrUpdateByMchId(record);
|
Boolean success = lklLedgerEcService.addOrUpdateByMchId(record);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
errMsg = "申请入网电子合同失败,数据保存失败";
|
errMsg = "申请入网电子合同失败,数据保存失败";
|
||||||
@ -1041,7 +1034,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新商家分账申请状态为已申请(hasApplySplit=1)
|
// 更新商家分账申请状态为已申请(hasApplySplit=1)
|
||||||
shopMchEntryService.updateMulStatus("", merCupNo, 0, 0, 0, 1, 0, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
shopMchEntryService.updateMulStatus(lklLedgerMember.getMch_id(), "", merCupNo, 0, 0, 0, 1, 0, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
||||||
|
|
||||||
log.debug("商户分账业务申请回调:处理成功,applyId={}", applyId);
|
log.debug("商户分账业务申请回调:处理成功,applyId={}", applyId);
|
||||||
return JSONUtil.createObj().put("code", "SUCCESS").put("message", "操作成功!");
|
return JSONUtil.createObj().put("code", "SUCCESS").put("message", "操作成功!");
|
||||||
@ -1188,7 +1181,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新商户分账状态
|
// 更新商户分账状态
|
||||||
shopMchEntryService.updateMulStatus(mchMobile, "", 0, 0, 0, 0, 1, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
shopMchEntryService.updateMulStatus(mchId, "", "", 0, 0, 0, 0, 1, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
||||||
return CommonResult.success(receiver, "创建接收方成功!");
|
return CommonResult.success(receiver, "创建接收方成功!");
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -1431,7 +1424,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 7. 成功后更新商户绑定状态为已绑定
|
// 7. 成功后更新商户绑定状态为已绑定
|
||||||
shopMchEntryService.updateMulStatus("", merCupNo, 0, 0, 0, 0, 0, 1, CommonConstant.MCH_APPR_STA_PASS);
|
shopMchEntryService.updateMulStatus(0L, "", merCupNo, 0, 0, 0, 0, 0, 1, CommonConstant.MCH_APPR_STA_PASS);
|
||||||
|
|
||||||
// 8. 检查商户绑定状态是否完成, 更改总的审核状态
|
// 8. 检查商户绑定状态是否完成, 更改总的审核状态
|
||||||
shopMchEntryService.checkMerchEntryFinished("", merCupNo);
|
shopMchEntryService.checkMerchEntryFinished("", merCupNo);
|
||||||
@ -1953,5 +1946,4 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -245,7 +245,7 @@ public class LklLedgerReceiverServiceImpl extends BaseServiceImpl<LklLedgerRecei
|
|||||||
boolean success = successCnt > 0;
|
boolean success = successCnt > 0;
|
||||||
if (success) {
|
if (success) {
|
||||||
// 更新多个状态
|
// 更新多个状态
|
||||||
shopMchEntryService.updateMulStatus("", merCupNo, 0, 0, 0, 0, 1, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
shopMchEntryService.updateMulStatus(mchId, "", merCupNo, 0, 0, 0, 0, 1, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
|||||||
@ -344,72 +344,77 @@ public class LklTkServiceImpl {
|
|||||||
return Pair.of(false, "商家入驻信息不存在");
|
return Pair.of(false, "商家入驻信息不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject formData = new JSONObject();
|
JSONObject reqJsonBody = new JSONObject();
|
||||||
formData.put("userNo", userNo);
|
reqJsonBody.put("userNo", userNo);
|
||||||
formData.put("busiCode", "WECHAT_PAY");// WECHAT_PAY:专业化扫码;B2B_SYT:B2B收银台;
|
reqJsonBody.put("busiCode", "WECHAT_PAY");// WECHAT_PAY:专业化扫码;B2B_SYT:B2B收银台;
|
||||||
formData.put("email", shopMchEntry.getEmail());
|
reqJsonBody.put("email", shopMchEntry.getEmail());
|
||||||
formData.put("merRegName", shopMchEntry.getStore_name());
|
reqJsonBody.put("merRegName", shopMchEntry.getStore_name());
|
||||||
formData.put("merName", shopMchEntry.getStore_name());
|
reqJsonBody.put("merName", shopMchEntry.getStore_name());
|
||||||
AddressParseResultTO addressParseResultTO = AddressUtil.parseAddress(shopMchEntry.getStore_address());
|
AddressParseResultTO addressParseResultTO = AddressUtil.parseAddress(shopMchEntry.getStore_address());
|
||||||
formData.put("merAddr", addressParseResultTO.getDetailAddress());
|
reqJsonBody.put("merAddr", addressParseResultTO.getDetailAddress());
|
||||||
|
|
||||||
// 是企业类型商家
|
// 是企业类型商家
|
||||||
Boolean isQy = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type());
|
Boolean isQy = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type());
|
||||||
formData.put("merType", isQy ? "TP_MERCHANT" : "TP_PERSONAL");
|
reqJsonBody.put("merType", isQy ? "TP_MERCHANT" : "TP_PERSONAL");
|
||||||
|
|
||||||
|
|
||||||
formData.put("longtude", shopMchEntry.getStore_longitude()); //longitude 经度
|
reqJsonBody.put("longtude", shopMchEntry.getStore_longitude()); //longitude 经度
|
||||||
formData.put("latitude", shopMchEntry.getStore_latitude());
|
reqJsonBody.put("latitude", shopMchEntry.getStore_latitude());
|
||||||
formData.put("source", "H5");
|
reqJsonBody.put("source", "H5");
|
||||||
|
|
||||||
|
|
||||||
formData.put("larIdType", "01"); // 01 身份证 ,02 护照,03 港澳通行证,04 台胞证,10 外国人永久居留身份证,11 港妨澳居民居住证,12 台湾居民居住证,13 执行事务合伙人,99 其它证件
|
reqJsonBody.put("larIdType", "01"); // 01 身份证 ,02 护照,03 港澳通行证,04 台胞证,10 外国人永久居留身份证,11 港妨澳居民居住证,12 台湾居民居住证,13 执行事务合伙人,99 其它证件
|
||||||
String larName = isQy ? shopMchEntry.getLegal_person_name() : shopMchEntry.getContact_name();
|
String larName = isQy ? shopMchEntry.getLegal_person_name() : shopMchEntry.getContact_name();
|
||||||
String larIdCard = isQy ? shopMchEntry.getLegal_person_id_number() : shopMchEntry.getIndividual_id_number();
|
String larIdCard = isQy ? shopMchEntry.getLegal_person_id_number() : shopMchEntry.getIndividual_id_number();
|
||||||
String larIdCardStart = isQy ? shopMchEntry.getLegal_person_id_period_begin() : shopMchEntry.getIndividual_id_period_begin();
|
String larIdCardStart = isQy ? shopMchEntry.getLegal_person_id_period_begin() : shopMchEntry.getIndividual_id_period_begin();
|
||||||
String larIdCardEnd = isQy ? shopMchEntry.getLegal_person_id_period_end() : shopMchEntry.getIndividual_id_period_end();
|
String larIdCardEnd = isQy ? shopMchEntry.getLegal_person_id_period_end() : shopMchEntry.getIndividual_id_period_end();
|
||||||
|
|
||||||
// 法人相关信息
|
// 法人相关信息
|
||||||
formData.put("larName", larName);
|
reqJsonBody.put("larName", larName);
|
||||||
formData.put("larIdCard", larIdCard);
|
reqJsonBody.put("larIdCard", larIdCard);
|
||||||
formData.put("larIdCardStart", larIdCardStart); // 身份证有效期开始时间
|
reqJsonBody.put("larIdCardStart", larIdCardStart); // 身份证有效期开始时间
|
||||||
formData.put("larIdCardEnd", larIdCardEnd); // 身份证有效期结束时间,长期:9999-12-31
|
reqJsonBody.put("larIdCardEnd", larIdCardEnd); // 身份证有效期结束时间,长期:9999-12-31
|
||||||
|
|
||||||
// 营业执照上的经营内容(20字以内)
|
// 营业执照上的经营内容(20字以内)
|
||||||
String bizLicenseContent = CommonService.subZhCNString(shopMchEntry.getBiz_license_content(), 20);
|
String bizLicenseContent = CommonService.subZhCNString(shopMchEntry.getBiz_license_content(), 20);
|
||||||
formData.put("businessContent", bizLicenseContent);
|
reqJsonBody.put("businessContent", bizLicenseContent);
|
||||||
|
|
||||||
// 营业执照信息
|
// 营业执照信息
|
||||||
if (isQy) {
|
if (isQy) {
|
||||||
formData.put("licenseName", shopMchEntry.getBiz_license_company());
|
reqJsonBody.put("licenseName", shopMchEntry.getBiz_license_company());
|
||||||
formData.put("licenseNo", shopMchEntry.getBiz_license_number());
|
reqJsonBody.put("licenseNo", shopMchEntry.getBiz_license_number());
|
||||||
formData.put("licenseDtStart", shopMchEntry.getBiz_license_period_begin());
|
reqJsonBody.put("licenseDtStart", shopMchEntry.getBiz_license_period_begin());
|
||||||
formData.put("licenseDtEnd", shopMchEntry.getBiz_license_period_end()); // 长期:9999-12-31
|
reqJsonBody.put("licenseDtEnd", shopMchEntry.getBiz_license_period_end()); // 长期:9999-12-31
|
||||||
}
|
}
|
||||||
|
|
||||||
formData.put("contactMobile", shopMchEntry.getLegal_person_mobile());
|
reqJsonBody.put("contactMobile", shopMchEntry.getLegal_person_mobile());
|
||||||
formData.put("contactName", shopMchEntry.getContact_name());// 联系人姓名
|
reqJsonBody.put("contactName", shopMchEntry.getContact_name());// 联系人姓名
|
||||||
formData.put("contractNo", shopMchEntry.getLkl_ec_no()); // 拉卡拉入网合同编号
|
reqJsonBody.put("contractNo", shopMchEntry.getLkl_ec_no()); // 拉卡拉入网合同编号
|
||||||
|
|
||||||
// 银行账号关键字段
|
// 银行账号关键字段
|
||||||
formData.put("openningBankCode", shopMchEntry.getOpenning_bank_code());//结算账户开户⾏号
|
reqJsonBody.put("openningBankCode", shopMchEntry.getOpenning_bank_code());//结算账户开户⾏号
|
||||||
formData.put("openningBankName", shopMchEntry.getBank_name());//结算账户开户⾏名称
|
reqJsonBody.put("openningBankName", shopMchEntry.getBank_name());//结算账户开户⾏名称
|
||||||
formData.put("clearingBankCode", shopMchEntry.getClearing_bank_code());//结算账户清算⾏号
|
reqJsonBody.put("clearingBankCode", shopMchEntry.getClearing_bank_code());//结算账户清算⾏号
|
||||||
|
|
||||||
formData.put("accountType", isQy ? "57" : "58"); //结算账户类型: 57 对公 58 对私
|
reqJsonBody.put("accountType", isQy ? "57" : "58"); //结算账户类型: 57 对公 58 对私
|
||||||
formData.put("accountNo", shopMchEntry.getAccount_number()); //结算人银行卡号
|
reqJsonBody.put("accountNo", shopMchEntry.getAccount_number()); //结算人银行卡号
|
||||||
formData.put("accountName", shopMchEntry.getAccount_holder_name()); //结算人账户名称
|
reqJsonBody.put("accountName", shopMchEntry.getAccount_holder_name()); //结算人账户名称
|
||||||
formData.put("accountIdCard", shopMchEntry.getLegal_person_id_number());//结算⼈证件号码(身份证)
|
reqJsonBody.put("accountIdCard", shopMchEntry.getLegal_person_id_number());//结算⼈证件号码(身份证)
|
||||||
|
|
||||||
formData.put("settleType", "D1"); //结算类型,D0秒到,D1次日结算
|
Integer SettlementMethod = shopMchEntry.getSettlement_method();
|
||||||
|
if (SettlementMethod == null || SettlementMethod < 0 || SettlementMethod > 10) {
|
||||||
|
SettlementMethod = 0;
|
||||||
|
}
|
||||||
|
String settleType = String.format("D%d", SettlementMethod);
|
||||||
|
reqJsonBody.put("settleType", settleType); //结算类型,D0秒到,D1次日结算
|
||||||
// formData.put("settlementType", "AUTOMATIC"); // 结算方式:MANUAL:手动结算(结算至拉卡拉APP钱包),AUTOMATIC:自动结算到银行卡,REGULAR:定时结算(仅企业商户支持)
|
// formData.put("settlementType", "AUTOMATIC"); // 结算方式:MANUAL:手动结算(结算至拉卡拉APP钱包),AUTOMATIC:自动结算到银行卡,REGULAR:定时结算(仅企业商户支持)
|
||||||
|
|
||||||
// 店铺省市区信息
|
// 店铺省市区信息
|
||||||
Map<String, String> areaCode = getAreaCode(shopMchEntry.getStore_area(), false);
|
Map<String, String> areaCode = getAreaCode(shopMchEntry.getStore_area(), false);
|
||||||
if (ObjectUtil.isNotEmpty(areaCode)) {
|
if (ObjectUtil.isNotEmpty(areaCode)) {
|
||||||
formData.put("provinceCode", areaCode.get("provinceCode"));
|
reqJsonBody.put("provinceCode", areaCode.get("provinceCode"));
|
||||||
formData.put("cityCode", areaCode.get("cityCode"));
|
reqJsonBody.put("cityCode", areaCode.get("cityCode"));
|
||||||
formData.put("countyCode", areaCode.get("countyCode"));
|
reqJsonBody.put("countyCode", areaCode.get("countyCode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//银行结算信息省市信息
|
//银行结算信息省市信息
|
||||||
@ -426,20 +431,20 @@ public class LklTkServiceImpl {
|
|||||||
String[] bankAreaCodes = shopMchEntry.getBank_district().split("/");
|
String[] bankAreaCodes = shopMchEntry.getBank_district().split("/");
|
||||||
String[] bankAreaNames = shopMchEntry.getBank_area().split("/");
|
String[] bankAreaNames = shopMchEntry.getBank_area().split("/");
|
||||||
if (bankAreaCodes.length >= 2 && bankAreaNames.length >= 2) {
|
if (bankAreaCodes.length >= 2 && bankAreaNames.length >= 2) {
|
||||||
formData.put("settleProvinceCode", bankAreaCodes[0]);
|
reqJsonBody.put("settleProvinceCode", bankAreaCodes[0]);
|
||||||
formData.put("settleProvinceName", bankAreaCodes[1]);
|
reqJsonBody.put("settleProvinceName", bankAreaCodes[1]);
|
||||||
formData.put("settleCityCode", bankAreaNames[0]);
|
reqJsonBody.put("settleCityCode", bankAreaNames[0]);
|
||||||
formData.put("settleCityName", bankAreaNames[1]);
|
reqJsonBody.put("settleCityName", bankAreaNames[1]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Map<String, String> bankAreaCode = getAreaCode(shopMchEntry.getBank_area(), true);
|
Map<String, String> bankAreaCode = getAreaCode(shopMchEntry.getBank_area(), true);
|
||||||
if (ObjectUtil.isNotEmpty(bankAreaCode)) {
|
if (ObjectUtil.isNotEmpty(bankAreaCode)) {
|
||||||
formData.put("settleProvinceCode", bankAreaCode.get("provinceCode"));
|
reqJsonBody.put("settleProvinceCode", bankAreaCode.get("provinceCode"));
|
||||||
formData.put("settleCityCode", bankAreaCode.get("cityCode"));
|
reqJsonBody.put("settleCityCode", bankAreaCode.get("cityCode"));
|
||||||
String[] bankAreaName = shopMchEntry.getBank_area().split("/");
|
String[] bankAreaName = shopMchEntry.getBank_area().split("/");
|
||||||
if (bankAreaName.length >= 2) {
|
if (bankAreaName.length >= 2) {
|
||||||
formData.put("settleProvinceName", bankAreaName[0]);
|
reqJsonBody.put("settleProvinceName", bankAreaName[0]);
|
||||||
formData.put("settleCityName", bankAreaName[1]);
|
reqJsonBody.put("settleCityName", bankAreaName[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -457,7 +462,7 @@ public class LklTkServiceImpl {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}});
|
}});
|
||||||
formData.put("bizContent", bizContent);
|
reqJsonBody.put("bizContent", bizContent);
|
||||||
|
|
||||||
// 附件文件相关开始
|
// 附件文件相关开始
|
||||||
JSONArray attachments = new JSONArray();
|
JSONArray attachments = new JSONArray();
|
||||||
@ -503,7 +508,7 @@ public class LklTkServiceImpl {
|
|||||||
if (BANK_CARD != null) {
|
if (BANK_CARD != null) {
|
||||||
attachments.put(BANK_CARD); // 银行卡图片
|
attachments.put(BANK_CARD); // 银行卡图片
|
||||||
}
|
}
|
||||||
formData.put("attchments", attachments);
|
reqJsonBody.put("attchments", attachments);
|
||||||
// 附件文件相关结束
|
// 附件文件相关结束
|
||||||
|
|
||||||
String urlPath = "/sit/htkregistration/merchant";
|
String urlPath = "/sit/htkregistration/merchant";
|
||||||
@ -513,27 +518,24 @@ public class LklTkServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info("进件请求参数:{}", JSONUtil.toJsonStr(formData));
|
logger.info("进件请求参数:{}", JSONUtil.toJsonStr(reqJsonBody));
|
||||||
|
|
||||||
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostBodyBackEntity(buildLklTkUrl(urlPath), header, formData, JSONObject.class);
|
JSONObject response = RestTemplateHttpUtil.sendLklPost(buildLklTkUrl(urlPath), header, reqJsonBody, JSONObject.class);
|
||||||
if (ObjectUtil.isEmpty(response)) {
|
logger.debug("拉卡拉进件响应参数:{}", response);
|
||||||
return Pair.of(false, "请求进件服务无返回值");
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject respBody = response.getBody();
|
JSONObject respData = response.getJSONObject("respData");
|
||||||
logger.debug("进件返回结果:{}", respBody);
|
|
||||||
if (response.getStatusCode() != HttpStatus.OK && ObjectUtil.isNotEmpty(respBody)) {
|
if (ObjectUtil.isEmpty(response) || respData == null) {
|
||||||
String errMsg = respBody.getStr("message") == null ? "未知错误" : respBody.getStr("message");
|
String errMsg = response.getStr("retMsg") == null ? "拉卡拉进件出现未知错误" : response.getStr("retMsg");
|
||||||
|
|
||||||
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, "进件失败:" + errMsg);
|
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, "进件失败:" + errMsg);
|
||||||
|
|
||||||
return Pair.of(false, "提交进件失败:" + errMsg);
|
return Pair.of(false, "提交进件失败:" + errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更改入驻记录的拉卡拉内部商户号和进件请求参数
|
String lklMerInnerNo = respData.getStr("merchantNo"); //拉卡拉内部商户号
|
||||||
String lklMerInnerNo = respBody.getStr("merchantNo"); //拉卡拉内部商户号
|
|
||||||
// 表中的内部外部商户号暂时都传同一个内部商户号,以便异步通知更改记录
|
// 表中的内部外部商户号暂时都传同一个内部商户号,以便异步通知更改记录
|
||||||
Boolean success = shopMchEntryService.updateMerchEntryLklMerCupNo(mchId, CommonConstant.Disable2, lklMerInnerNo, lklMerInnerNo, formData.toString(), respBody.toString());
|
Boolean success = shopMchEntryService.updateMerchEntryLklMerCupNo(mchId, CommonConstant.Disable2, lklMerInnerNo, lklMerInnerNo, reqJsonBody.toString(), respData.toString());
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
|
||||||
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, "进件成功,但更新商户号失败!");
|
shopMchEntryService.updateMerchEntryApprovalByMchId(shopMchEntry.getId(), CommonConstant.MCH_APPR_STA_LKL_NOPASS, "进件成功,但更新商户号失败!");
|
||||||
|
|||||||
@ -133,6 +133,14 @@ public interface ShopOrderReturnService extends IBaseService<ShopOrderReturn> {
|
|||||||
*/
|
*/
|
||||||
boolean updateRefundOrderReturn(ShopOrderReturn shopOrderReturn);
|
boolean updateRefundOrderReturn(ShopOrderReturn shopOrderReturn);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 尝试更新退货单尝试次数
|
||||||
|
*
|
||||||
|
* @param returnId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean updateTryReturnCount(String returnId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否允许退货
|
* 是否允许退货
|
||||||
*
|
*
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
@ -1864,6 +1865,28 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
return Convert.toList(String.class, findKey(queryWrapper));
|
return Convert.toList(String.class, findKey(queryWrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateTryReturnCount(String returnId) {
|
||||||
|
if (StrUtil.isBlank(returnId)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShopOrderReturn shopOrderReturn = get(returnId);
|
||||||
|
if (shopOrderReturn == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateWrapper<ShopOrderReturn> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("return_id", returnId);
|
||||||
|
|
||||||
|
if (shopOrderReturn.getTry_return_count() >= 15) {
|
||||||
|
updateWrapper.set("return_channel_flag", 2);
|
||||||
|
} else {
|
||||||
|
updateWrapper.setSql("try_return_count = try_return_count + 1");
|
||||||
|
}
|
||||||
|
return update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在线原路退款(支持支付宝、微信、拉卡拉)
|
* 在线原路退款(支持支付宝、微信、拉卡拉)
|
||||||
*
|
*
|
||||||
@ -1880,15 +1903,20 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShopOrderReturn shopOrderReturn = get(return_id);
|
|
||||||
|
QueryWrapper<ShopOrderReturn> queryWrapper = new QueryWrapper<>();
|
||||||
|
//渠道是否退款(ENUM): 0-待退; 1-已退; 2-异常
|
||||||
|
queryWrapper.eq("return_id", return_id).eq("return_channel_flag", 0);
|
||||||
|
ShopOrderReturn shopOrderReturn = findOne(queryWrapper);
|
||||||
if (shopOrderReturn == null) {
|
if (shopOrderReturn == null) {
|
||||||
log.error("Order return not found: {}", return_id);
|
log.error("Order return not found: {}", return_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return_channel_flag:渠道是否退款(ENUM): 0-待退; 1-已退; 2-异常
|
||||||
String return_channel_code = shopOrderReturn.getReturn_channel_code();
|
String return_channel_code = shopOrderReturn.getReturn_channel_code();
|
||||||
if (StrUtil.isBlank(return_channel_code)) {
|
if (StrUtil.isBlank(return_channel_code)) {
|
||||||
log.error("Empty return_channel_code for return_id: {}", return_id);
|
log.error("return_id status error: {}", return_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1910,6 +1938,8 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shopOrderReturn == null) {
|
if (shopOrderReturn == null) {
|
||||||
|
// 累加尝试退款次数
|
||||||
|
updateTryReturnCount(return_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -236,6 +236,7 @@ public interface ShopMchEntryService {
|
|||||||
/**
|
/**
|
||||||
* 根据商户号或商家手机号修改商户入驻信息多个状态
|
* 根据商户号或商家手机号修改商户入驻信息多个状态
|
||||||
*
|
*
|
||||||
|
* @param mchId 商户入驻自增Id
|
||||||
* @param merchantMobile 商家手机号
|
* @param merchantMobile 商家手机号
|
||||||
* @param merchantCupNo 商户号
|
* @param merchantCupNo 商户号
|
||||||
* @param hasEcSigned 是否已签署电子合同
|
* @param hasEcSigned 是否已签署电子合同
|
||||||
@ -247,7 +248,7 @@ public interface ShopMchEntryService {
|
|||||||
* @param approvalStatus 审批状态
|
* @param approvalStatus 审批状态
|
||||||
* @return 更新结果,true为成功,false为失败
|
* @return 更新结果,true为成功,false为失败
|
||||||
*/
|
*/
|
||||||
Boolean updateMulStatus(String merchantMobile, String merchantCupNo, Integer hasEcSigned, Integer hasApplyMerchant, Integer storeStatus,
|
Boolean updateMulStatus(Long mchId, String merchantMobile, String merchantCupNo, Integer hasEcSigned, Integer hasApplyMerchant, Integer storeStatus,
|
||||||
Integer hasApplySplit, Integer hasApplyReceiver, Integer hasBindReceiver, Integer approvalStatus);
|
Integer hasApplySplit, Integer hasApplyReceiver, Integer hasBindReceiver, Integer approvalStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1487,6 +1487,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
/**
|
/**
|
||||||
* 根据商户号或商家手机号修改商户入驻信息多个状态
|
* 根据商户号或商家手机号修改商户入驻信息多个状态
|
||||||
*
|
*
|
||||||
|
* @param mchId 商户自增ID
|
||||||
* @param merchantMobile 商家手机号
|
* @param merchantMobile 商家手机号
|
||||||
* @param merchantCupNo 商户号
|
* @param merchantCupNo 商户号
|
||||||
* @param hasEcSigned 是否已签署电子合同
|
* @param hasEcSigned 是否已签署电子合同
|
||||||
@ -1499,11 +1500,11 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
* @return 更新结果,true为成功,false为失败
|
* @return 更新结果,true为成功,false为失败
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateMulStatus(String merchantMobile, String merchantCupNo, Integer hasEcSigned, Integer hasApplyMerchant, Integer storeStatus,
|
public Boolean updateMulStatus(Long mchId, String merchantMobile, String merchantCupNo, Integer hasEcSigned, Integer hasApplyMerchant, Integer storeStatus,
|
||||||
Integer hasApplySplit, Integer hasApplyReceiver, Integer hasBindReceiver, Integer approvalStatus) {
|
Integer hasApplySplit, Integer hasApplyReceiver, Integer hasBindReceiver, Integer approvalStatus) {
|
||||||
// 1. 参数校验:商户号和商家手机号不能同时为空
|
// 1. 参数校验:商户号和商家手机号不能同时为空
|
||||||
if (StrUtil.isAllBlank(merchantCupNo, merchantMobile)) {
|
if (StrUtil.isAllBlank(merchantCupNo, merchantMobile) && CheckUtil.isEmpty(mchId)) {
|
||||||
log.error("更新商户多个状态失败:商户号和商家手机号不能同时为空");
|
log.error("更新商户多个状态失败:缺少必要参数");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1512,6 +1513,10 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||||
|
|
||||||
// 3. 设置查询条件:优先使用商户手机号,如果为空则使用商户号
|
// 3. 设置查询条件:优先使用商户手机号,如果为空则使用商户号
|
||||||
|
if (CheckUtil.isEmpty(mchId)) {
|
||||||
|
updateWrapper.eq("id", mchId);
|
||||||
|
}
|
||||||
|
|
||||||
Optional.ofNullable(merchantMobile)
|
Optional.ofNullable(merchantMobile)
|
||||||
.filter(StrUtil::isNotBlank)
|
.filter(StrUtil::isNotBlank)
|
||||||
.ifPresent(mobile -> updateWrapper.eq("login_mobile", mobile));
|
.ifPresent(mobile -> updateWrapper.eq("login_mobile", mobile));
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.suisung.mall.shop.order.mapper.ShopOrderReturnMapper">
|
<mapper namespace="com.suisung.mall.shop.order.mapper.ShopOrderReturnMapper">
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
return_id
|
return_id
|
||||||
@ -11,7 +10,7 @@
|
|||||||
return_is_paid, return_is_shipping_fee, return_flag, return_type, return_order_lock, return_item_state_id,
|
return_is_paid, return_is_shipping_fee, return_flag, return_type, return_order_lock, return_item_state_id,
|
||||||
return_store_time, return_store_message, return_commision_fee, return_finish_time, return_platform_message,
|
return_store_time, return_store_message, return_commision_fee, return_finish_time, return_platform_message,
|
||||||
return_is_settlemented, return_settlement_time, return_channel_code, return_channel_flag, return_channel_time,
|
return_is_settlemented, return_settlement_time, return_channel_code, return_channel_flag, return_channel_time,
|
||||||
return_channel_trans_id, deposit_trade_no, payment_channel_id, trade_payment_amount
|
return_channel_trans_id, deposit_trade_no, payment_channel_id, trade_payment_amount, try_return_count, created_at, updated_at
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="statisticState" resultType="java.util.Map">
|
<select id="statisticState" resultType="java.util.Map">
|
||||||
@ -30,31 +29,29 @@
|
|||||||
|
|
||||||
<select id="statisticCountSeller" resultType="java.util.Map">
|
<select id="statisticCountSeller" resultType="java.util.Map">
|
||||||
SELECT t1.curr_date,
|
SELECT t1.curr_date,
|
||||||
ifnull(t2.record_count, 0) AS record_count
|
ifnull(t2.record_count, 0) AS record_count
|
||||||
FROM (
|
FROM (SELECT @num := @num + 1 AS num,date_format( date_add( #{end}, INTERVAL - @num DAY ), '%m/%d' ) AS curr_date
|
||||||
SELECT @num := @num + 1 AS num,date_format( date_add( #{end}, INTERVAL - @num DAY ), '%m/%d' ) AS curr_date
|
FROM account_base_config, ( SELECT @num := -1 ) t
|
||||||
FROM account_base_config, ( SELECT @num := -1 ) t
|
WHERE @num + 1 <= ( #{days} - 1)) t1
|
||||||
WHERE @num + 1 <= ( #{days} - 1)) t1
|
|
||||||
|
|
||||||
LEFT JOIN (SELECT date_format(return_add_time, '%m/%d') AS curr_date, count(order_id) AS record_count
|
LEFT JOIN (SELECT date_format(return_add_time, '%m/%d') AS curr_date, count(order_id) AS record_count
|
||||||
FROM shop_order_return
|
FROM shop_order_return
|
||||||
where #{store_id} = store_id
|
where #{store_id} = store_id
|
||||||
GROUP BY date_format(return_add_time, '%m/%d')) t2
|
GROUP BY date_format(return_add_time, '%m/%d')) t2
|
||||||
ON t1.curr_date = t2.curr_date
|
ON t1.curr_date = t2.curr_date
|
||||||
ORDER BY num desc
|
ORDER BY num desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="statisticCount" resultType="java.util.Map">
|
<select id="statisticCount" resultType="java.util.Map">
|
||||||
SELECT t1.curr_date,
|
SELECT t1.curr_date,
|
||||||
ifnull(t2.record_count, 0) AS record_count
|
ifnull(t2.record_count, 0) AS record_count
|
||||||
FROM (
|
FROM (SELECT @num := @num + 1 AS num,date_format( date_add( #{end}, INTERVAL - @num DAY ), '%m/%d' ) AS curr_date
|
||||||
SELECT @num := @num + 1 AS num,date_format( date_add( #{end}, INTERVAL - @num DAY ), '%m/%d' ) AS curr_date
|
FROM account_base_config, ( SELECT @num := -1 ) t
|
||||||
FROM account_base_config, ( SELECT @num := -1 ) t
|
WHERE @num + 1 <= ( #{days} - 1)) t1
|
||||||
WHERE @num + 1 <= ( #{days} - 1)) t1
|
LEFT JOIN (SELECT date_format(return_add_time, '%m/%d') AS 'curr_date', count(order_id) AS 'record_count'
|
||||||
LEFT JOIN (SELECT date_format(return_add_time, '%m/%d') AS 'curr_date', count(order_id) AS 'record_count'
|
FROM shop_order_return
|
||||||
FROM shop_order_return
|
GROUP BY date_format(return_add_time, '%m/%d')) t2
|
||||||
GROUP BY date_format(return_add_time, '%m/%d')) t2
|
ON t1.curr_date = t2.curr_date
|
||||||
ON t1.curr_date = t2.curr_date
|
|
||||||
ORDER BY num desc
|
ORDER BY num desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -88,8 +85,5 @@
|
|||||||
and shop_order_info.order_deal_time <= #{map.order_deal_time}
|
and shop_order_info.order_deal_time <= #{map.order_deal_time}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user