修改代理商表结构
This commit is contained in:
parent
17778c2e1c
commit
0f563493ef
@ -47,6 +47,12 @@ public class EsignPlatformInfo implements Serializable {
|
||||
@ApiModelProperty(value = "平台方营业执照公司名称")
|
||||
private String license_company;
|
||||
|
||||
@ApiModelProperty(value = "代理商的省/市/区,如:广东省/深圳市/福田区")
|
||||
private String license_area;
|
||||
|
||||
@ApiModelProperty(value = "代理商的省id/市id/区id,如:11000/11100/11101")
|
||||
private String license_district_id;
|
||||
|
||||
@ApiModelProperty(value = "平台方营业执照公司详细地址")
|
||||
private String license_address;
|
||||
|
||||
@ -74,7 +80,7 @@ public class EsignPlatformInfo implements Serializable {
|
||||
@ApiModelProperty(value = "收款账户名称")
|
||||
private String rec_acc_name;
|
||||
|
||||
@ApiModelProperty(value = "收款账户账户类型:1-个人;2-企业;")
|
||||
@ApiModelProperty(value = "收款账户账户类型:1-个人(对私);2-企业(对公);")
|
||||
private Integer rec_acc_type;
|
||||
|
||||
@ApiModelProperty(value = "收款账户证件号")
|
||||
@ -95,17 +101,11 @@ public class EsignPlatformInfo implements Serializable {
|
||||
@ApiModelProperty(value = "平台方公司维度")
|
||||
private String latitude;
|
||||
|
||||
@ApiModelProperty(value = "平台方公司店铺所在的省")
|
||||
private String province_id;
|
||||
@ApiModelProperty(value = "代理商等级:0-平台方(只能一条记录);1-一级代理;2-二级代理;3-三级代理;4-四级代理;")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty(value = "平台方公司所在的市")
|
||||
private String city_id;
|
||||
|
||||
@ApiModelProperty(value = "平台方公司所在的县区")
|
||||
private String county_id;
|
||||
|
||||
@ApiModelProperty(value = "类型:0-平台方(只能一条记录);1-一级代理;2-二级代理;3-三级代理;4-四级代理;")
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "邀请码,后期跟收益有关")
|
||||
private String invite_code;
|
||||
|
||||
@ApiModelProperty(value = "记录状态:1-有效;2-无效;")
|
||||
private Integer status;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.merch;
|
||||
package com.suisung.mall.common.modules.store;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -25,8 +25,8 @@ import java.util.Date;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("shop_mch_entry")
|
||||
@ApiModel(value = "ShopMerchEntry 实体", description = "商家入驻信息表")
|
||||
public class ShopMerchEntry implements Serializable {
|
||||
@ApiModel(value = "ShopMchEntry 实体", description = "商家入驻信息表")
|
||||
public class ShopMchEntry implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@ -192,13 +192,16 @@ public class ShopMerchEntry implements Serializable {
|
||||
@ApiModelProperty(value = "结算银行地区,格式: 省份/城市/乡县")
|
||||
private String bank_area;
|
||||
|
||||
@ApiModelProperty(value = "结算账号类型:57-对公 58-对私")
|
||||
private String account_type;
|
||||
|
||||
@ApiModelProperty(value = "入驻商家的收款账户号码")
|
||||
private String account_number;
|
||||
|
||||
@ApiModelProperty(value = "入驻商家的收款账户姓名")
|
||||
private String account_holder_name;
|
||||
|
||||
@ApiModelProperty(value = "入驻商家的审批状态:1-已通过;2-未通过;3-待审核;")
|
||||
@ApiModelProperty(value = "入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请过;5-已提交审核;")
|
||||
private Integer approval_status;
|
||||
|
||||
@ApiModelProperty(value = "入驻商家审批时的备注信息")
|
||||
@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.modules.esign.EsignContractFillingFile;
|
||||
import com.suisung.mall.common.modules.esign.EsignPlatformInfo;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.utils.StringUtils;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import com.suisung.mall.shop.esign.mapper.EsignContractFillingFileMapper;
|
||||
@ -32,7 +32,7 @@ import com.suisung.mall.shop.esign.utils.comm.EsignHttpResponse;
|
||||
import com.suisung.mall.shop.esign.utils.enums.EsignRequestType;
|
||||
import com.suisung.mall.shop.esign.utils.exception.EsignDemoException;
|
||||
import com.suisung.mall.shop.page.service.OssService;
|
||||
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -70,7 +70,7 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
private EsignPlatformInfoService esignPlatformInfoService;
|
||||
|
||||
@Resource
|
||||
private ShopMerchEntryService shopMerchEntryService;
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
|
||||
@Resource
|
||||
private EsignContractFillingFileService esignContractFillingFileService;
|
||||
@ -107,14 +107,14 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
}
|
||||
|
||||
// 获取入驻商家(审批通过的)的信息
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (shopMerchEntry == null) {
|
||||
ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (shopMchEntry == null) {
|
||||
log.error("缺少商家入驻信息");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 代理商信息
|
||||
EsignPlatformInfo distributor = esignPlatformInfoService.getDistributorInfoById(shopMerchEntry.getDistributor_id());
|
||||
EsignPlatformInfo distributor = esignPlatformInfoService.getDistributorInfoById(shopMchEntry.getDistributor_id());
|
||||
|
||||
String apiaddr = "/v3/files/create-by-doc-template";
|
||||
EsignRequestType requestType = EsignRequestType.POST;
|
||||
@ -128,14 +128,14 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
|
||||
String today = DateUtil.format(new Date(), "yyyy年MM月dd日");
|
||||
// 甲方公司名称,甲方是个人的时候,没有公司名,直接用店铺名(个人实名)
|
||||
String mchCompany = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getBiz_license_company() : shopMerchEntry.getStore_name() + "(" + shopMerchEntry.getContact_name() + ")";
|
||||
String mchCompany = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type()) ? shopMchEntry.getBiz_license_company() : shopMchEntry.getStore_name() + "(" + shopMchEntry.getContact_name() + ")";
|
||||
String platCompany = esignPlatformInfo.getLicense_company();
|
||||
// 甲方法人姓名,甲方是个人的时候,没有法人,直接用个人实名
|
||||
String legalPersonName = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_name() : shopMerchEntry.getContact_name();
|
||||
String LegalPersonMobile = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_mobile() : shopMerchEntry.getLogin_mobile();
|
||||
String legalPersonName = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type()) ? shopMchEntry.getLegal_person_name() : shopMchEntry.getContact_name();
|
||||
String LegalPersonMobile = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type()) ? shopMchEntry.getLegal_person_mobile() : shopMchEntry.getLogin_mobile();
|
||||
|
||||
// 甲方法人身份证号,甲方是个人的时候,没有法人,直接用个人身份证
|
||||
String legalPersonIdNumber = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_id_number() : shopMerchEntry.getIndividual_id_number();
|
||||
String legalPersonIdNumber = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type()) ? shopMchEntry.getLegal_person_id_number() : shopMchEntry.getIndividual_id_number();
|
||||
|
||||
|
||||
String contractNumber = StringUtils.genLklOrderNo(4);
|
||||
@ -180,7 +180,7 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
}});
|
||||
}
|
||||
|
||||
if (CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type())) {
|
||||
if (CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type())) {
|
||||
// 甲方公司名称,甲方是个人的时候,没有公司名,直接用店铺名
|
||||
for (int i = 1; i <= 17; i++) {
|
||||
int finalI = i;
|
||||
@ -200,10 +200,10 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
}
|
||||
|
||||
//特殊:甲方收款账方,企业是公司名,个人是个人实名
|
||||
if (!CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type())) {
|
||||
if (!CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type())) {
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_company17");
|
||||
put("componentValue", shopMerchEntry.getContact_name());
|
||||
put("componentValue", shopMchEntry.getContact_name());
|
||||
}});
|
||||
}
|
||||
}
|
||||
@ -234,7 +234,7 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_store_name1");
|
||||
put("componentValue", shopMerchEntry.getStore_name());
|
||||
put("componentValue", shopMchEntry.getStore_name());
|
||||
}});
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
@ -244,27 +244,27 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_ratio");
|
||||
put("componentValue", shopMerchEntry.getSplit_ratio());
|
||||
put("componentValue", shopMchEntry.getSplit_ratio());
|
||||
}});
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "settlement_method");
|
||||
put("componentValue", shopMerchEntry.getSettlement_method());
|
||||
put("componentValue", shopMchEntry.getSettlement_method());
|
||||
}});
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_address1");
|
||||
put("componentValue", shopMerchEntry.getStore_address());
|
||||
put("componentValue", shopMchEntry.getStore_address());
|
||||
}});
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_bank1");
|
||||
put("componentValue", shopMerchEntry.getBank_name());
|
||||
put("componentValue", shopMchEntry.getBank_name());
|
||||
}});
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_account_number1");
|
||||
put("componentValue", shopMerchEntry.getAccount_number());
|
||||
put("componentValue", shopMchEntry.getAccount_number());
|
||||
}});
|
||||
|
||||
// 乙方公司名称
|
||||
@ -407,9 +407,9 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
String fileId = jsonObject.getStr("fileId");
|
||||
|
||||
// 把合同文件 url 上传到cos服务器
|
||||
// String contractPath = StrUtil.isBlank(shopMerchEntry.getBiz_license_number()) ? mchMobile : shopMerchEntry.getBiz_license_number();
|
||||
// String contractPath = StrUtil.isBlank(shopMchEntry.getBiz_license_number()) ? mchMobile : shopMchEntry.getBiz_license_number();
|
||||
String cosFileName = TENGXUN_DEFAULT_DIR.concat("/").concat("contract")
|
||||
.concat("/").concat(shopMerchEntry.getLogin_mobile()).concat("/")
|
||||
.concat("/").concat(shopMchEntry.getLogin_mobile()).concat("/")
|
||||
.concat(jsonObject.getStr("fileId")).concat(".pdf");
|
||||
// 上传到cos服务器
|
||||
String localFileUrl = ossService.uploadObject4OSS(esignContractFillingFile.getUnsigned_contract_url(), cosFileName);
|
||||
|
||||
@ -21,7 +21,7 @@ import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.modules.esign.EsignContract;
|
||||
import com.suisung.mall.common.modules.esign.EsignContractFillingFile;
|
||||
import com.suisung.mall.common.modules.esign.EsignPlatformInfo;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import com.suisung.mall.shop.components.TaskService;
|
||||
import com.suisung.mall.shop.esign.mapper.EsignContractMapper;
|
||||
@ -33,7 +33,7 @@ import com.suisung.mall.shop.esign.utils.comm.EsignHttpResponse;
|
||||
import com.suisung.mall.shop.esign.utils.enums.EsignRequestType;
|
||||
import com.suisung.mall.shop.esign.utils.exception.EsignDemoException;
|
||||
import com.suisung.mall.shop.page.service.OssService;
|
||||
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -84,7 +84,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
private EsignContractFillingFileService esignContractFillingFileService;
|
||||
|
||||
@Resource
|
||||
private ShopMerchEntryService shopMerchEntryService;
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
|
||||
@Resource
|
||||
private EsignPlatformInfoService esignPlatformInfoService;
|
||||
@ -178,7 +178,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
|
||||
// 检查商户入驻信息是否被审核通过
|
||||
// 检查店铺是否已经申请过入驻
|
||||
Integer apprStatus = shopMerchEntryService.getApprovalStatus(mchMobile);
|
||||
Integer apprStatus = shopMchEntryService.getApprovalStatus(mchMobile);
|
||||
if (!CommonConstant.MCH_APPR_STA_PASS.equals(apprStatus)) {
|
||||
return CommonResult.failed("请先审核商家入驻信息");
|
||||
}
|
||||
@ -298,7 +298,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
// 填充合同模版表的店铺Id
|
||||
esignContractFillingFileService.updateContractFillingStoreId(esignContract.getMch_mobile(), retPair.getFirst());
|
||||
// 店铺创建状态已完成
|
||||
shopMerchEntryService.updateMerchEntryStoreStatus(esignContract.getMch_mobile(), CommonConstant.Enable);
|
||||
shopMchEntryService.updateMerchEntryStoreStatus(esignContract.getMch_mobile(), CommonConstant.Enable);
|
||||
}
|
||||
|
||||
});
|
||||
@ -499,7 +499,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
taskService.executeTask(() -> {
|
||||
log.debug("###更改同步合同审核状态和下载地址###");
|
||||
// 更改同步合同审核状态和下载地址
|
||||
if (!shopMerchEntryService.updateMerchEntrySignedStatusAndContractDownloadUrl(esignContract.getMch_mobile(), signFlowStatus, localFileUrl)) {
|
||||
if (!shopMchEntryService.updateMerchEntrySignedStatusAndContractDownloadUrl(esignContract.getMch_mobile(), signFlowStatus, localFileUrl)) {
|
||||
log.error("###更改同步合同审核状态和下载地址失败###");
|
||||
}
|
||||
});
|
||||
@ -527,8 +527,8 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
}
|
||||
|
||||
// 获取商家审核通过的入驻信息
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(esignContractFillingFile.getMobile(), "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (shopMerchEntry == null) {
|
||||
ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(esignContractFillingFile.getMobile(), "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (shopMchEntry == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -539,13 +539,13 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
}
|
||||
|
||||
// 获取代理商信息
|
||||
EsignPlatformInfo distributor = esignPlatformInfoService.getDistributorInfoById(shopMerchEntry.getDistributor_id());
|
||||
EsignPlatformInfo distributor = esignPlatformInfoService.getDistributorInfoById(shopMchEntry.getDistributor_id());
|
||||
|
||||
// 未签合同文件ID
|
||||
String fileId = esignContractFillingFile.getFile_id();
|
||||
|
||||
// (重要)组织生成签署合同的请求参数。
|
||||
String reqParams = buildSignReqParams(shopMerchEntry, esignPlatformInfo, distributor, esignContractFillingFile);
|
||||
String reqParams = buildSignReqParams(shopMchEntry, esignPlatformInfo, distributor, esignContractFillingFile);
|
||||
|
||||
// 保存签署合同记录
|
||||
EsignContract esignContract = new EsignContract();
|
||||
@ -554,12 +554,12 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
esignContract.setContract_name(esignContractFillingFile.getContract_name());
|
||||
esignContract.setContract_file_id(fileId);
|
||||
esignContract.setMch_mobile(esignContractFillingFile.getMobile());
|
||||
esignContract.setMch_company(shopMerchEntry.getBiz_license_company());
|
||||
esignContract.setMch_biz_license(shopMerchEntry.getBiz_license_number());
|
||||
esignContract.setMch_company(shopMchEntry.getBiz_license_company());
|
||||
esignContract.setMch_biz_license(shopMchEntry.getBiz_license_number());
|
||||
esignContract.setReq_params(reqParams);
|
||||
esignContract.setUnsigned_contract_url(esignContractFillingFile.getUnsigned_contract_local_url());
|
||||
esignContract.setStore_id(esignContractFillingFile.getStore_id());
|
||||
esignContract.setDistributor_id(shopMerchEntry.getDistributor_id()); // 代理商ID(esign_platform_info表id),0-表示只有平台方,没有代理商
|
||||
esignContract.setDistributor_id(shopMchEntry.getDistributor_id()); // 代理商ID(esign_platform_info表id),0-表示只有平台方,没有代理商
|
||||
esignContract.setSign_flow_status(-1);//合作方签署状态:-1:预备数据阶段;1-等待签署;2 - 已完成(所有签署方完成签署)3 - 已撤销(发起方撤销签署任务)5 - 已过期(签署截止日到期后触发)7 - 已拒签(签署方拒绝签署)
|
||||
|
||||
return saveOrUpdateByMchMobile(esignContract);
|
||||
@ -729,13 +729,13 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
/**
|
||||
* (重要)组织生成签署合同的所有请求参数。
|
||||
*
|
||||
* @param shopMerchEntry
|
||||
* @param shopMchEntry
|
||||
* @param esignPlatformInfo
|
||||
* @param esignContractFillingFile
|
||||
* @return
|
||||
*/
|
||||
protected String buildSignReqParams(ShopMerchEntry shopMerchEntry, EsignPlatformInfo esignPlatformInfo, EsignPlatformInfo distributor, EsignContractFillingFile esignContractFillingFile) {
|
||||
if (shopMerchEntry == null || esignPlatformInfo == null || esignContractFillingFile == null) {
|
||||
protected String buildSignReqParams(ShopMchEntry shopMchEntry, EsignPlatformInfo esignPlatformInfo, EsignPlatformInfo distributor, EsignContractFillingFile esignContractFillingFile) {
|
||||
if (shopMchEntry == null || esignPlatformInfo == null || esignContractFillingFile == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -765,19 +765,19 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
mchSigner.putByPath("signConfig.signOrder", 1);
|
||||
mchSigner.putByPath("noticeConfig.noticeTypes", "1");// 短信
|
||||
mchSigner.putByPath("signFields", JSONUtil.parseArray(esignContractFillingFile.getMch_sign_position()));
|
||||
if (shopMerchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
if (shopMchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
// 企业
|
||||
mchSigner.put("signerType", 1);
|
||||
mchSigner.putByPath("orgSignerInfo.orgName", shopMerchEntry.getBiz_license_company());
|
||||
mchSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", shopMerchEntry.getBiz_license_number());
|
||||
mchSigner.putByPath("orgSignerInfo.orgName", shopMchEntry.getBiz_license_company());
|
||||
mchSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", shopMchEntry.getBiz_license_number());
|
||||
mchSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardType", "CRED_ORG_USCC");
|
||||
mchSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", shopMerchEntry.getLogin_mobile());
|
||||
mchSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", shopMerchEntry.getLegal_person_name());
|
||||
mchSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", shopMchEntry.getLogin_mobile());
|
||||
mchSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", shopMchEntry.getLegal_person_name());
|
||||
} else {
|
||||
// 个人
|
||||
mchSigner.put("signerType", 0);
|
||||
mchSigner.putByPath("psnSignerInfo.psnAccount", shopMerchEntry.getLogin_mobile());
|
||||
mchSigner.putByPath("psnSignerInfo.psnInfo.psnName", shopMerchEntry.getContact_name());
|
||||
mchSigner.putByPath("psnSignerInfo.psnAccount", shopMchEntry.getLogin_mobile());
|
||||
mchSigner.putByPath("psnSignerInfo.psnInfo.psnName", shopMchEntry.getContact_name());
|
||||
}
|
||||
// 加入甲方信息
|
||||
signers.add(mchSigner);
|
||||
@ -787,7 +787,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
platSigner.putByPath("signConfig.signOrder", 2);
|
||||
platSigner.putByPath("noticeConfig.noticeTypes", "1,2"); // 短信和邮件
|
||||
platSigner.putByPath("signFields", JSONUtil.parseArray(esignContractFillingFile.getPlat_sign_position()));
|
||||
//if (shopMerchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
//if (shopMchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
// 企业(平台方只能企业)
|
||||
platSigner.put("signerType", 1);
|
||||
platSigner.putByPath("orgSignerInfo.orgName", esignPlatformInfo.getLicense_company());
|
||||
@ -810,7 +810,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
distrSigner.putByPath("signConfig.signOrder", 3);
|
||||
distrSigner.putByPath("noticeConfig.noticeTypes", "1"); // 短信和邮件
|
||||
distrSigner.putByPath("signFields", JSONUtil.parseArray(esignContractFillingFile.getDistri_sign_position()));
|
||||
//if (shopMerchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
//if (shopMchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
// 企业(代理商只能企业)
|
||||
distrSigner.put("signerType", 1);
|
||||
distrSigner.putByPath("orgSignerInfo.orgName", distributor.getLicense_company());
|
||||
|
||||
@ -15,13 +15,13 @@ import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.utils.RestTemplateHttpUtil;
|
||||
import com.suisung.mall.common.utils.StringUtils;
|
||||
import com.suisung.mall.common.utils.UploadUtil;
|
||||
import com.suisung.mall.core.web.service.RedisService;
|
||||
import com.suisung.mall.shop.lakala.utils.LakalaUtil;
|
||||
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -69,7 +69,7 @@ public class LklTkServiceImpl {
|
||||
private String profile;
|
||||
|
||||
@Resource
|
||||
private ShopMerchEntryService shopMerchEntryService;
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@ -121,6 +121,14 @@ public class LklTkServiceImpl {
|
||||
return "prod".equalsIgnoreCase(profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件(图片)到拉卡拉,带 OCR识别卡信息,身份证信息,营业执照信息
|
||||
*
|
||||
* @param fileBase64 图片的base64字符串
|
||||
* @param fileURL 图片的url地址
|
||||
* @param imgType 图片类型
|
||||
* @return
|
||||
*/
|
||||
public JSONObject uploadFileWithOcr(String fileBase64, String fileURL, String imgType) {
|
||||
String authorization = getLklTkAuthorization();
|
||||
if (StrUtil.isBlank(authorization)) {
|
||||
@ -130,28 +138,27 @@ public class LklTkServiceImpl {
|
||||
JSONObject header = new JSONObject();
|
||||
header.put("Authorization", authorization);
|
||||
|
||||
String urlPath = "/sit/htkregistration/file/upload";
|
||||
if (isProd()) {
|
||||
urlPath = "/registration/file/upload";
|
||||
}
|
||||
String urlPath = isProd() ? "/registration/file/upload" : "/sit/htkregistration/file/upload";
|
||||
|
||||
if (StrUtil.isBlank(fileBase64)) {
|
||||
// web url 转 base64 字节
|
||||
fileBase64 = UploadUtil.URLFileToBase64(fileURL);
|
||||
}
|
||||
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("fileBase64", fileBase64);
|
||||
// requestBody.put("file", fileBase64);
|
||||
requestBody.put("imgType", imgType);
|
||||
requestBody.put("sourcechnl", "0");
|
||||
requestBody.put("sourcechnl", "0"); // 来源: 0:PC,1:安卓,2:IOS
|
||||
requestBody.put("isOcr", "true");
|
||||
|
||||
|
||||
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostBodyBackEntity("https://htkactvi.lakala.com/registration/file/upload", header, requestBody, JSONObject.class);
|
||||
if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK || response.getBody() == null) {
|
||||
return null;
|
||||
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostBodyBackEntity(buildLklServiceUrl(urlPath), header, requestBody, JSONObject.class);
|
||||
if (ObjectUtil.isEmpty(response)
|
||||
|| response.getStatusCode() != HttpStatus.OK
|
||||
|| ObjectUtil.isEmpty(response.getBody())) {
|
||||
return JSONUtil.createObj().set("code", 500).set("msg", "返回值有误!");
|
||||
}
|
||||
|
||||
// {batchNo,status,url,showUrl,result{} }
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
@ -204,77 +211,81 @@ public class LklTkServiceImpl {
|
||||
header.put("Authorization", getLklTkAuthorization());
|
||||
|
||||
// 获取商家入驻信息,组成请求参数
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, null, CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (ObjectUtil.isEmpty(shopMerchEntry)) {
|
||||
ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, null, CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (ObjectUtil.isEmpty(shopMchEntry)) {
|
||||
return Pair.of(false, "商家入驻信息不存在");
|
||||
}
|
||||
|
||||
JSONObject formData = new JSONObject();
|
||||
formData.put("userNo", "29153396");
|
||||
formData.put("email", shopMerchEntry.getEmail());
|
||||
formData.put("busiCode", "B2B_SYT");
|
||||
formData.put("merRegName", shopMerchEntry.getStore_name());
|
||||
|
||||
Boolean isQy = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type());
|
||||
formData.put("busiCode", "WECHAT_PAY");// WECHAT_PAY:专业化扫码;B2B_SYT:B2B收银台;
|
||||
formData.put("email", shopMchEntry.getEmail());
|
||||
formData.put("merRegName", shopMchEntry.getStore_name());
|
||||
formData.put("merName", shopMchEntry.getStore_name());
|
||||
formData.put("merAddr", StringUtils.removeProvinceCityDistrict(shopMchEntry.getStore_address()));
|
||||
|
||||
// 是企业类型商家
|
||||
Boolean isQy = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMchEntry.getEntity_type());
|
||||
String merType = isQy ? "TP_MERCHANT" : "TP_PERSONAL";
|
||||
formData.put("merType", merType);
|
||||
|
||||
formData.put("merName", shopMerchEntry.getStore_name());
|
||||
formData.put("merAddr", StringUtils.removeProvinceCityDistrict(shopMerchEntry.getStore_address()));
|
||||
|
||||
Map<String, String> areaCode = getAreaCode(shopMerchEntry.getStore_area(), false);
|
||||
Map<String, String> areaCode = getAreaCode(shopMchEntry.getStore_area(), false);
|
||||
if (ObjectUtil.isNotEmpty(areaCode)) {
|
||||
formData.put("provinceCode", areaCode.get("provinceCode"));
|
||||
formData.put("cityCode", areaCode.get("cityCode"));
|
||||
formData.put("countyCode", areaCode.get("countyCode"));
|
||||
}
|
||||
|
||||
formData.put("longtude", shopMerchEntry.getStore_longitude()); //longitude 经度
|
||||
formData.put("latitude", shopMerchEntry.getStore_latitude());
|
||||
formData.put("longtude", shopMchEntry.getStore_longitude()); //longitude 经度
|
||||
formData.put("latitude", shopMchEntry.getStore_latitude());
|
||||
formData.put("source", "H5");
|
||||
|
||||
|
||||
formData.put("larIdType", "01"); // 01 身份证 ,02 护照,03 港澳通行证,04 台胞证,10 外国人永久居留身份证,11 港妨澳居民居住证,12 台湾居民居住证,13 执行事务合伙人,99 其它证件
|
||||
String larName = isQy ? shopMerchEntry.getLegal_person_name() : shopMerchEntry.getContact_name();
|
||||
String larIdCard = isQy ? shopMerchEntry.getLegal_person_id_number() : shopMerchEntry.getIndividual_id_number();
|
||||
String larIdCardStart = isQy ? shopMerchEntry.getLegal_person_id_period_begin() : shopMerchEntry.getIndividual_id_period_begin();
|
||||
String larIdCardEnd = isQy ? shopMerchEntry.getLegal_person_id_period_end() : shopMerchEntry.getIndividual_id_period_end();
|
||||
String larName = isQy ? shopMchEntry.getLegal_person_name() : shopMchEntry.getContact_name();
|
||||
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 larIdCardEnd = isQy ? shopMchEntry.getLegal_person_id_period_end() : shopMchEntry.getIndividual_id_period_end();
|
||||
|
||||
// 法人相关信息
|
||||
formData.put("larName", larName);
|
||||
formData.put("larIdCard", larIdCard);
|
||||
formData.put("larIdCardStart", larIdCardStart); // 身份证有效期开始时间
|
||||
formData.put("larIdCardEnd", larIdCardEnd); // 身份证有效期结束时间
|
||||
|
||||
formData.put("businessContent", shopMerchEntry.getSales_info());
|
||||
// 营业执照上的经营内容
|
||||
formData.put("businessContent", shopMchEntry.getSales_info());
|
||||
|
||||
// 营业执照信息
|
||||
if (isQy) {
|
||||
formData.put("licenseName", shopMerchEntry.getBiz_license_company());
|
||||
formData.put("licenseNo", shopMerchEntry.getBiz_license_number());
|
||||
formData.put("licenseDtStart", shopMerchEntry.getBiz_license_period_begin());
|
||||
formData.put("licenseDtEnd", shopMerchEntry.getBiz_license_period_end());
|
||||
formData.put("licenseName", shopMchEntry.getBiz_license_company());
|
||||
formData.put("licenseNo", shopMchEntry.getBiz_license_number());
|
||||
formData.put("licenseDtStart", shopMchEntry.getBiz_license_period_begin());
|
||||
formData.put("licenseDtEnd", shopMchEntry.getBiz_license_period_end());
|
||||
}
|
||||
|
||||
formData.put("contactMobile", mchMobile);
|
||||
formData.put("contactName", shopMerchEntry.getContact_name());
|
||||
formData.put("contactName", shopMchEntry.getContact_name());
|
||||
|
||||
formData.put("openningBankCode", shopMerchEntry.getBank_code());//结算账户开户⾏号
|
||||
formData.put("openningBankName", shopMerchEntry.getBank_name());//结算账户开户⾏名称
|
||||
formData.put("clearingBankCode", shopMerchEntry.getClearing_bank_code());//结算账户清算⾏号
|
||||
formData.put("openningBankCode", shopMchEntry.getBank_code());//结算账户开户⾏号
|
||||
formData.put("openningBankName", shopMchEntry.getBank_name());//结算账户开户⾏名称
|
||||
formData.put("clearingBankCode", shopMchEntry.getClearing_bank_code());//结算账户清算⾏号
|
||||
|
||||
formData.put("accountNo", shopMerchEntry.getAccount_number()); //结算人银行卡号
|
||||
formData.put("accountName", shopMerchEntry.getAccount_holder_name()); //结算人账户名称
|
||||
formData.put("accountIdCard", shopMerchEntry.getLegal_person_id_number());//结算⼈证件号码(身份证)
|
||||
formData.put("accountType", isQy ? "57" : "58"); //结算账户类型: 57 对公 58 对私
|
||||
formData.put("accountNo", shopMchEntry.getAccount_number()); //结算人银行卡号
|
||||
formData.put("accountName", shopMchEntry.getAccount_holder_name()); //结算人账户名称
|
||||
formData.put("accountIdCard", shopMchEntry.getLegal_person_id_number());//结算⼈证件号码(身份证)
|
||||
|
||||
formData.put("settleType", "D1"); //结算类型,D0秒到,D1次日结算
|
||||
formData.put("settlementType", "AUTOMATIC"); // 结算方式:MANUAL:手动结算(结算至拉卡拉APP钱包),AUTOMATIC:自动结算到银行卡,REGULAR:定时结算(仅企业商户支持)
|
||||
formData.put("accountType", isQy ? "57" : "58"); //结算账户类型: 57 对公 58 对私
|
||||
|
||||
//结算信息省份代码
|
||||
Map<String, String> bankAreaCode = getAreaCode(shopMerchEntry.getBank_area(), true);
|
||||
Map<String, String> bankAreaCode = getAreaCode(shopMchEntry.getBank_area(), true);
|
||||
if (ObjectUtil.isNotEmpty(bankAreaCode)) {
|
||||
formData.put("settleProvinceCode", bankAreaCode.get("provinceCode"));
|
||||
formData.put("settleCityCode", bankAreaCode.get("cityCode"));
|
||||
String[] bankAreaName = shopMerchEntry.getBank_area().split(",");
|
||||
String[] bankAreaName = shopMchEntry.getBank_area().split(",");
|
||||
if (bankAreaName.length >= 2) {
|
||||
formData.put("settleProvinceName", bankAreaName[0]);
|
||||
formData.put("settleCityName", bankAreaName[1]);
|
||||
@ -294,72 +305,69 @@ public class LklTkServiceImpl {
|
||||
}});
|
||||
formData.put("bizContent", bizContent);
|
||||
|
||||
// 附件文件
|
||||
// 附件文件相关开始
|
||||
JSONArray attachments = new JSONArray();
|
||||
JSONObject ID_CARD_FRONT = updatePhoto(shopMerchEntry.getIndividual_id_images(), "ID_CARD_FRONT", true);
|
||||
JSONObject ID_CARD_FRONT = updatePhoto(shopMchEntry.getIndividual_id_images(), "ID_CARD_FRONT", true);
|
||||
if (ID_CARD_FRONT != null) {
|
||||
attachments.put(ID_CARD_FRONT); // 身份证正面
|
||||
}
|
||||
|
||||
JSONObject ID_CARD_BEHIND = updatePhoto(shopMerchEntry.getIndividual_id_images2(), "ID_CARD_BEHIND", true);
|
||||
JSONObject ID_CARD_BEHIND = updatePhoto(shopMchEntry.getIndividual_id_images2(), "ID_CARD_BEHIND", true);
|
||||
if (ID_CARD_BEHIND != null) {
|
||||
attachments.put(ID_CARD_BEHIND); // 身份证国徽面
|
||||
}
|
||||
|
||||
JSONObject SETTLE_ID_CARD_FRONT = updatePhoto(shopMerchEntry.getLegal_person_id_images(), "SETTLE_ID_CARD_FRONT", true);
|
||||
JSONObject SETTLE_ID_CARD_FRONT = updatePhoto(shopMchEntry.getLegal_person_id_images(), "SETTLE_ID_CARD_FRONT", true);
|
||||
if (SETTLE_ID_CARD_FRONT != null) {
|
||||
attachments.put(SETTLE_ID_CARD_FRONT); // 结算人身份证正面
|
||||
}
|
||||
|
||||
JSONObject SETTLE_ID_CARD_BEHIND = updatePhoto(shopMerchEntry.getLegal_person_id_images2(), "SETTLE_ID_CARD_BEHIND", true);
|
||||
JSONObject SETTLE_ID_CARD_BEHIND = updatePhoto(shopMchEntry.getLegal_person_id_images2(), "SETTLE_ID_CARD_BEHIND", true);
|
||||
if (SETTLE_ID_CARD_BEHIND != null) {
|
||||
attachments.put(SETTLE_ID_CARD_BEHIND); // 结算人身份证国徽面
|
||||
}
|
||||
|
||||
JSONObject BUSINESS_LICENCE = updatePhoto(shopMerchEntry.getBiz_license_image(), "BUSINESS_LICENCE", true);
|
||||
JSONObject BUSINESS_LICENCE = updatePhoto(shopMchEntry.getBiz_license_image(), "BUSINESS_LICENCE", true);
|
||||
if (BUSINESS_LICENCE != null) {
|
||||
attachments.put(BUSINESS_LICENCE); // 营业执照
|
||||
}
|
||||
|
||||
JSONObject SHOP_OUTSIDE_IMG = updatePhoto(shopMerchEntry.getFront_facade_image(), "SHOP_OUTSIDE_IMG", false);
|
||||
JSONObject SHOP_OUTSIDE_IMG = updatePhoto(shopMchEntry.getFront_facade_image(), "SHOP_OUTSIDE_IMG", false);
|
||||
if (SHOP_OUTSIDE_IMG != null) {
|
||||
attachments.put(SHOP_OUTSIDE_IMG); // 门店门面图片
|
||||
}
|
||||
|
||||
JSONObject SHOP_INSIDE_IMG = updatePhoto(shopMerchEntry.getEnvironment_image(), "SHOP_INSIDE_IMG", false);
|
||||
JSONObject SHOP_INSIDE_IMG = updatePhoto(shopMchEntry.getEnvironment_image(), "SHOP_INSIDE_IMG", false);
|
||||
if (SHOP_INSIDE_IMG != null) {
|
||||
attachments.put(SHOP_INSIDE_IMG); // 门店内部图片
|
||||
}
|
||||
|
||||
JSONObject BANK_CARD = updatePhoto(shopMerchEntry.getBank_image(), "BANK_CARD", true);
|
||||
JSONObject BANK_CARD = updatePhoto(shopMchEntry.getBank_image(), "BANK_CARD", true);
|
||||
if (BANK_CARD != null) {
|
||||
attachments.put(BANK_CARD); // 银行卡图片
|
||||
}
|
||||
formData.put("attchments", attachments);
|
||||
// 附件文件相关结束
|
||||
|
||||
|
||||
String urlPath = "/sit/htkregistration/merchant";
|
||||
if (isProd()) {
|
||||
urlPath = "/registration/merchant";
|
||||
}
|
||||
String urlPath = isProd() ? "/registration/merchant" : "/sit/htkregistration/merchant";
|
||||
|
||||
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostFormDataBackEntity(buildLklTkUrl(urlPath), header, formData, JSONObject.class);
|
||||
if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK) {
|
||||
String errMsg = "请求分账系统出错!";
|
||||
String errMsg = "返回空或请求状态异常。";
|
||||
if (ObjectUtil.isNotEmpty(response.getBody()) && ObjectUtil.isNotEmpty(response.getBody().getStr("message"))) {
|
||||
errMsg = response.getBody().getStr("message");
|
||||
}
|
||||
return Pair.of(false, "进件失败:" + errMsg);
|
||||
}
|
||||
|
||||
// 根据入驻商家的代理商或平台方,顺便新增一个接收方记录
|
||||
|
||||
|
||||
// 更改入驻记录的拉卡拉内部商户号和进件请求参数
|
||||
String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号
|
||||
shopMerchEntryService.updateMerchEntryLklMerCupNo(mchMobile, CommonConstant.Disable2, merchantNo, formData.toString());
|
||||
Boolean success = shopMchEntryService.updateMerchEntryLklMerCupNo(mchMobile, CommonConstant.Disable2, merchantNo, formData.toString());
|
||||
if (!success) {
|
||||
return Pair.of(false, "提交进件成功,但更新商户号失败!");
|
||||
}
|
||||
|
||||
return Pair.of(true, "提交成功待审核!");
|
||||
return Pair.of(true, "提交进件成功,请等待审核!");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -386,45 +394,46 @@ public class LklTkServiceImpl {
|
||||
|
||||
// 公钥解密出来的数据
|
||||
String data = decryptNotifyData(notifyPubKeyPath, reqBodyJSON.getStr("data"));
|
||||
log.debug("拉卡拉进件异步通知返回解密后的参数:{}", data);
|
||||
if (StrUtil.isBlank(data)) {
|
||||
return new JSONObject().set("code", "500").set("message", "参数解密出错");
|
||||
}
|
||||
log.debug("拉卡拉进件异步通知返回解密后的参数:{}", data);
|
||||
|
||||
// 逻辑处理
|
||||
JSONObject dataJSON = JSONUtil.parseObj(data);
|
||||
if (respData.isEmpty() || StrUtil.isBlank(dataJSON.getStr("externalCustomerNo"))) {
|
||||
if (dataJSON.isEmpty() || StrUtil.isBlank(dataJSON.getStr("externalCustomerNo"))) {
|
||||
return new JSONObject().set("code", "500").set("message", "参数解析出错");
|
||||
}
|
||||
|
||||
String externalCustomerNo = dataJSON.getStr("externalCustomerNo"); //拉卡拉外部商户号
|
||||
shopMerchEntryService.updateMerchEntryLklAuditStatusByLklMerCupNo(externalCustomerNo, dataJSON.getStr("customerNo"), CommonConstant.Enable, data);
|
||||
// 给商家入驻表增加拉卡拉的商户号和拉卡拉返回的数据
|
||||
String merCupNo = dataJSON.getStr("externalCustomerNo"); //拉卡拉外部商户号
|
||||
Boolean success = shopMchEntryService.updateMerchEntryLklAuditStatusByLklMerCupNo(merCupNo, dataJSON.getStr("customerNo"), CommonConstant.Enable, data);
|
||||
if (!success) {
|
||||
return new JSONObject().set("code", "500").set("message", "更新商户号失败");
|
||||
}
|
||||
|
||||
// 根据入驻商家的代理商或平台方,顺便新增一个接收方记录
|
||||
|
||||
return new JSONObject().set("code", "200").set("message", "成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取拉卡拉省市区编码
|
||||
* 获取拉卡拉店铺的(或银行的)省市区编码
|
||||
*
|
||||
* @param areaName 省份/城市/乡县
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getAreaCode(String areaName, Boolean isBankArea) {
|
||||
if (StrUtil.isBlank(areaName)) {
|
||||
return new HashMap<String, String>() {{
|
||||
put("provinceCode", "");
|
||||
put("cityCode", "");
|
||||
put("countyCode", "");
|
||||
}};
|
||||
}
|
||||
Map retMap = new HashMap<String, String>() {{
|
||||
put("provinceCode", "");
|
||||
put("cityCode", "");
|
||||
put("countyCode", "");
|
||||
}};
|
||||
|
||||
|
||||
String[] areaNames = areaName.split("/");
|
||||
if (areaNames.length < 2) {
|
||||
return new HashMap<String, String>() {{
|
||||
put("provinceCode", "");
|
||||
put("cityCode", "");
|
||||
put("countyCode", "");
|
||||
}};
|
||||
if (StrUtil.isBlank(areaName) || areaNames.length < 2) {
|
||||
return retMap;
|
||||
}
|
||||
|
||||
String provinceName = areaNames[0];
|
||||
@ -434,29 +443,18 @@ public class LklTkServiceImpl {
|
||||
countryName = areaNames[2];
|
||||
}
|
||||
|
||||
String urlPath = "/sit/htkregistration/organization";
|
||||
if (isProd()) {
|
||||
urlPath = "/registration/organization";
|
||||
}
|
||||
|
||||
if (isBankArea) {
|
||||
urlPath += "/bank";
|
||||
}
|
||||
String urlPath = isProd() ? "/registration/organization" : "/sit/htkregistration/organization";
|
||||
urlPath = isBankArea ? urlPath + "/bank" : urlPath; // 银行地区
|
||||
|
||||
String authorization = getLklTkAuthorization();
|
||||
if (StrUtil.isBlank(authorization)) {
|
||||
log.error("获取拉卡拉token失败");
|
||||
return new HashMap<String, String>() {{
|
||||
put("provinceCode", "");
|
||||
put("cityCode", "");
|
||||
put("countyCode", "");
|
||||
}};
|
||||
return retMap;
|
||||
}
|
||||
|
||||
JSONObject header = new JSONObject();
|
||||
header.put("Authorization", getLklTkAuthorization());
|
||||
|
||||
Map<String, String> areaCodeMap = new HashMap<>();
|
||||
|
||||
// 省份列表
|
||||
ResponseEntity<JSONArray> response = RestTemplateHttpUtil.sendGetWithHeader(buildLklTkUrl(urlPath + "/1"), header, JSONArray.class);
|
||||
@ -467,10 +465,11 @@ public class LklTkServiceImpl {
|
||||
|
||||
JSONArray jsonArray = response.getBody();
|
||||
if (CollUtil.isNotEmpty(jsonArray)) {
|
||||
// 省份列表
|
||||
for (JSONObject jsonObject : jsonArray.jsonIter()) {
|
||||
if (StrUtil.contains(jsonObject.getStr("name"), provinceName)) {
|
||||
provinceCode = jsonObject.getStr("code");
|
||||
areaCodeMap.put("provinceCode", provinceCode);
|
||||
retMap.put("provinceCode", provinceCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -483,15 +482,14 @@ public class LklTkServiceImpl {
|
||||
for (JSONObject jsonObject : jsonArray.jsonIter()) {
|
||||
if (StrUtil.contains(jsonObject.getStr("name"), cityName)) {
|
||||
cityCode = jsonObject.getStr("code");
|
||||
areaCodeMap.put("cityCode", cityCode);
|
||||
retMap.put("cityCode", cityCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 乡列表
|
||||
// 乡县列表
|
||||
if (StrUtil.isNotBlank(cityCode)) {
|
||||
response = RestTemplateHttpUtil.sendGetWithHeader(buildLklTkUrl(urlPath + "/" + cityCode), header, JSONArray.class);
|
||||
jsonArray = response.getBody();
|
||||
@ -499,7 +497,7 @@ public class LklTkServiceImpl {
|
||||
for (JSONObject jsonObject : jsonArray.jsonIter()) {
|
||||
if (StrUtil.contains(jsonObject.getStr("name"), countryName)) {
|
||||
countyCode = jsonObject.getStr("code");
|
||||
areaCodeMap.put("countyCode", countyCode);
|
||||
retMap.put("countyCode", countyCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -508,8 +506,7 @@ public class LklTkServiceImpl {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return areaCodeMap;
|
||||
return retMap;
|
||||
}
|
||||
|
||||
public JSONObject updatePhoto(String fileUrl, String imgType, Boolean isOcr) {
|
||||
|
||||
@ -11,7 +11,7 @@ package com.suisung.mall.shop.store.controller.admin;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -24,10 +24,10 @@ import javax.annotation.Resource;
|
||||
@Api(tags = "店铺基础信息表")
|
||||
@RestController
|
||||
@RequestMapping("/admin/shop/merch")
|
||||
public class ShopMerchEntryAdminController extends BaseControllerImpl {
|
||||
public class ShopMchEntryAdminController extends BaseControllerImpl {
|
||||
|
||||
@Resource
|
||||
private ShopMerchEntryService shopMerchEntryService;
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
|
||||
/**
|
||||
* 商家申请入驻商城平台
|
||||
@ -38,20 +38,20 @@ public class ShopMerchEntryAdminController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "后台-商家申请入驻分页列表", notes = "商家申请入驻分页列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryList(@RequestBody JSONObject shopMerchEntryJSON) {
|
||||
return shopMerchEntryService.shopMerchEntryList(shopMerchEntryJSON.getStr("keyword"), shopMerchEntryJSON.getInt("page"), shopMerchEntryJSON.getInt("pageSize"));
|
||||
return shopMchEntryService.shopMerchEntryList(shopMerchEntryJSON.getStr("keyword"), shopMerchEntryJSON.getInt("page"), shopMerchEntryJSON.getInt("pageSize"));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "后台-获取商家入驻资料详情", notes = "后台-获取商家入驻资料详情")
|
||||
@RequestMapping(value = "/detail", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryDetail(@RequestBody JSONObject jsonParam) {
|
||||
return shopMerchEntryService.shopMerchEntryDetail(jsonParam.getLong("id"), "", null);
|
||||
return shopMchEntryService.shopMerchEntryDetail(jsonParam.getLong("id"), "", null);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "商家入驻审批", notes = "商家入驻审批")
|
||||
@RequestMapping(value = "/approval", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryApproval(@RequestBody JSONObject jsonParam) {
|
||||
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;
|
||||
return shopMerchEntryService.shopMerchEntryApproval(jsonParam.getLong("id"), jsonParam.getInt("approvalStatus"), jsonParam.getStr("approvalRemark"), jsonParam.getStr("approvalInvalidCol"));
|
||||
return shopMchEntryService.shopMerchEntryApproval(jsonParam.getLong("id"), jsonParam.getInt("approvalStatus"), jsonParam.getStr("approvalRemark"), jsonParam.getStr("approvalInvalidCol"));
|
||||
}
|
||||
|
||||
|
||||
@ -10,11 +10,11 @@ package com.suisung.mall.shop.store.controller.mobile;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.service.impl.BaiduMapServiceImpl;
|
||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||
import com.suisung.mall.shop.esign.service.EsignContractFillingFileService;
|
||||
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -26,10 +26,10 @@ import java.util.Map;
|
||||
@Api(tags = "店铺基础信息表")
|
||||
@RestController
|
||||
@RequestMapping("/mobile/shop/merch")
|
||||
public class ShopMerchEntryController extends BaseControllerImpl {
|
||||
public class ShopMchEntryController extends BaseControllerImpl {
|
||||
|
||||
@Resource
|
||||
private ShopMerchEntryService shopMerchEntryService;
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
|
||||
@Resource
|
||||
private EsignContractFillingFileService esignContractFillingFileService;
|
||||
@ -47,26 +47,26 @@ public class ShopMerchEntryController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "店铺主营分类(类目)", notes = "店铺主营分类(类目)")
|
||||
@RequestMapping(value = "/business/category", method = RequestMethod.POST)
|
||||
public CommonResult shopStoreBusinessCategoryList() {
|
||||
return shopMerchEntryService.storeBusinessCategoryList();
|
||||
return shopMchEntryService.storeBusinessCategoryList();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "商家申请入驻商城平台", notes = "商家申请入驻商城平台")
|
||||
@RequestMapping(value = "/apply", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryApply(@RequestBody JSONObject shopMerchEntryJSON) {
|
||||
return shopMerchEntryService.shopMerchEntryApply(shopMerchEntryJSON);
|
||||
return shopMchEntryService.shopMerchEntryApply(shopMerchEntryJSON);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家入驻资料详情", notes = "获取商家入驻资料详情")
|
||||
@RequestMapping(value = "/detail", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryDetail(@RequestBody JSONObject jsonParam) {
|
||||
return shopMerchEntryService.shopMerchEntryDetail(null, jsonParam.getStr("mobile"), null);
|
||||
return shopMchEntryService.shopMerchEntryDetail(null, jsonParam.getStr("mobile"), null);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,远程调用用途")
|
||||
@RequestMapping(value = "/approval/status", method = RequestMethod.POST)
|
||||
public Integer shopMerchEntryApprovalStatus(@RequestBody JSONObject jsonParam) {
|
||||
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||
ShopMerchEntry record = shopMerchEntryService.shopMerchEntryApprovalInfo(jsonParam.getStr("mobile"));
|
||||
ShopMchEntry record = shopMchEntryService.shopMerchEntryApprovalInfo(jsonParam.getStr("mobile"));
|
||||
if (record == null || record.getApproval_status() == null) {
|
||||
return 4;
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class ShopMerchEntryController extends BaseControllerImpl {
|
||||
@RequestMapping(value = "/fresh/approval/status", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryApprovalStatus2(@RequestBody JSONObject jsonParam) {
|
||||
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||
ShopMerchEntry record = shopMerchEntryService.shopMerchEntryApprovalInfo(jsonParam.getStr("mobile"));
|
||||
ShopMchEntry record = shopMchEntryService.shopMerchEntryApprovalInfo(jsonParam.getStr("mobile"));
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
if (record == null || record.getApproval_status() == null) {
|
||||
// 配合前端的要求,没有申请过入驻商城平台的时候,返回未申请状态
|
||||
@ -103,7 +103,7 @@ public class ShopMerchEntryController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "商家重新申请入驻商城平台", notes = "商家申请入驻材料被驳回的时候,修正材料,重新申请入驻")
|
||||
@RequestMapping(value = "/re-apply", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryReApply(@RequestBody JSONObject shopMerchEntryJSON) {
|
||||
return shopMerchEntryService.shopMerchEntryReApply(shopMerchEntryJSON);
|
||||
return shopMchEntryService.shopMerchEntryReApply(shopMerchEntryJSON);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -9,9 +9,9 @@
|
||||
package com.suisung.mall.shop.store.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public interface ShopMerchEntryMapper extends BaseMapper<ShopMerchEntry> {
|
||||
public interface ShopMchEntryMapper extends BaseMapper<ShopMchEntry> {
|
||||
}
|
||||
@ -10,12 +10,12 @@ package com.suisung.mall.shop.store.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import org.springframework.data.util.Pair;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopMerchEntryService {
|
||||
public interface ShopMchEntryService {
|
||||
|
||||
/**
|
||||
* 获取店铺的经营类目列表
|
||||
@ -96,7 +96,7 @@ public interface ShopMerchEntryService {
|
||||
* @param loginMobile
|
||||
* @return
|
||||
*/
|
||||
ShopMerchEntry shopMerchEntryApprovalInfo(String loginMobile);
|
||||
ShopMchEntry shopMerchEntryApprovalInfo(String loginMobile);
|
||||
|
||||
/**
|
||||
* 根据商家手机号、营业执照、审批状态获取有效的商家入驻申请记录
|
||||
@ -106,7 +106,7 @@ public interface ShopMerchEntryService {
|
||||
* @param approvalStatus
|
||||
* @return
|
||||
*/
|
||||
ShopMerchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus);
|
||||
ShopMchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus);
|
||||
|
||||
/**
|
||||
* 根据商家注册的手机号,更新合同签署状态和合同下载地址
|
||||
@ -19,7 +19,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.utils.BankUtil;
|
||||
import com.suisung.mall.common.utils.StringUtils;
|
||||
import com.suisung.mall.common.utils.phone.PhoneNumberUtils;
|
||||
@ -31,8 +31,8 @@ import com.suisung.mall.shop.esign.service.EsignContractFillingFileService;
|
||||
import com.suisung.mall.shop.esign.service.EsignContractService;
|
||||
import com.suisung.mall.shop.esign.service.EsignPlatformInfoService;
|
||||
import com.suisung.mall.shop.message.service.ShopMessageTemplateService;
|
||||
import com.suisung.mall.shop.store.mapper.ShopMerchEntryMapper;
|
||||
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
||||
import com.suisung.mall.shop.store.mapper.ShopMchEntryMapper;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -51,7 +51,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMapper, ShopMerchEntry> implements ShopMerchEntryService {
|
||||
public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper, ShopMchEntry> implements ShopMchEntryService {
|
||||
|
||||
@Resource
|
||||
private AccountBaseConfigService accountBaseConfigService;
|
||||
@ -127,7 +127,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return CommonResult.failed("缺少必要参数!");
|
||||
}
|
||||
|
||||
ShopMerchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMerchEntry.class);
|
||||
ShopMchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMchEntry.class);
|
||||
if (record == null || StrUtil.isBlank(record.getLogin_mobile())) {
|
||||
log.error("###商家入驻参数转换失败###");
|
||||
return CommonResult.failed("参数转换失败,请联系管理员!");
|
||||
@ -251,7 +251,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
}
|
||||
|
||||
// 验证合同签署状态,如果已经签署,不能再次申请
|
||||
ShopMerchEntry oldRecord = getById(shopMerchEntryJSON.getInt("id"));
|
||||
ShopMchEntry oldRecord = getById(shopMerchEntryJSON.getInt("id"));
|
||||
if (oldRecord == null) {
|
||||
return CommonResult.failed("未找到入驻记录!");
|
||||
}
|
||||
@ -260,7 +260,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return CommonResult.failed("合同签署进行中(或已签署),不能再次申请!");
|
||||
}
|
||||
|
||||
ShopMerchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMerchEntry.class);
|
||||
ShopMchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMchEntry.class);
|
||||
if (record == null) {
|
||||
log.error("###商家入驻参数转换失败###");
|
||||
return CommonResult.failed("参数转换失败,请联系管理员!");
|
||||
@ -338,7 +338,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
// return CommonResult.failed("权限不足!");
|
||||
// }
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
queryWrapper.like("store_name", keyword);
|
||||
}
|
||||
@ -353,7 +353,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
pageSize = 20;
|
||||
}
|
||||
|
||||
Page<ShopMerchEntry> listPage = lists(queryWrapper, pageIndex, pageSize);
|
||||
Page<ShopMchEntry> listPage = lists(queryWrapper, pageIndex, pageSize);
|
||||
|
||||
return CommonResult.success(listPage);
|
||||
}
|
||||
@ -375,7 +375,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return CommonResult.failed("缺少必要参数!");
|
||||
}
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(recordId)) {
|
||||
queryWrapper.eq("id", recordId);
|
||||
}
|
||||
@ -389,12 +389,12 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
queryWrapper.in("approval_status", approvalStatusList);
|
||||
}
|
||||
queryWrapper.orderByDesc("id");
|
||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return CommonResult.success(null, "暂无申请记录!");
|
||||
}
|
||||
|
||||
ShopMerchEntry record = recordList.get(0);
|
||||
ShopMchEntry record = recordList.get(0);
|
||||
|
||||
// 试试更新入驻表的合同下载地址和合同签署状态
|
||||
updateMerchEntrySignedStatusAndContractDownloadUrl(record);
|
||||
@ -407,7 +407,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
*
|
||||
* @param record
|
||||
*/
|
||||
private void updateMerchEntrySignedStatusAndContractDownloadUrl(ShopMerchEntry record) {
|
||||
private void updateMerchEntrySignedStatusAndContractDownloadUrl(ShopMchEntry record) {
|
||||
if (record == null) {
|
||||
return;
|
||||
}
|
||||
@ -459,13 +459,13 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return CommonResult.failed("审批状态有误!");
|
||||
}
|
||||
|
||||
ShopMerchEntry record = getById(id);
|
||||
ShopMchEntry record = getById(id);
|
||||
if (record == null) {
|
||||
return CommonResult.failed("未找到入驻记录!");
|
||||
}
|
||||
|
||||
// TODO 已经审核通过的,不能再审核了。
|
||||
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
if (approvalStatus.equals(CommonConstant.Enable) && StrUtil.isBlank(approvalRemark)) {
|
||||
// 审核通过
|
||||
approvalRemark = "审核通过,后续将向您发起签署电子合同流程。";
|
||||
@ -524,7 +524,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return Pair.of(false, msg);
|
||||
}
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(mobile) && StrUtil.isBlank(bizLicenseNumber)) {
|
||||
queryWrapper.eq("login_mobile", mobile);
|
||||
boolean isApplied = count(queryWrapper) > 0;
|
||||
@ -561,9 +561,9 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return 0;
|
||||
}
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("login_mobile", mobile).select("approval_status").orderByAsc("id");
|
||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return 0;
|
||||
}
|
||||
@ -579,22 +579,22 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ShopMerchEntry shopMerchEntryApprovalInfo(String loginMobile) {
|
||||
public ShopMchEntry shopMerchEntryApprovalInfo(String loginMobile) {
|
||||
if (StrUtil.isBlank(loginMobile)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("login_mobile", loginMobile)
|
||||
.select("id", "approval_status", "approval_remark", "login_mobile", "approval_invalid_col", "signed_status", "contract_download_url", "store_status")
|
||||
.orderByAsc("id");
|
||||
|
||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ShopMerchEntry record = recordList.get(0);
|
||||
ShopMchEntry record = recordList.get(0);
|
||||
|
||||
// 试试更新入驻表的合同下载地址和合同签署状态
|
||||
updateMerchEntrySignedStatusAndContractDownloadUrl(record);
|
||||
@ -611,12 +611,12 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ShopMerchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus) {
|
||||
public ShopMchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus) {
|
||||
if (StrUtil.isBlank(loginMobile) && StrUtil.isBlank(bizLicenseNumber) && ObjectUtil.isEmpty(approvalStatus)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status", CommonConstant.Enable).orderByAsc("id");
|
||||
if (StrUtil.isNotBlank(loginMobile)) {
|
||||
queryWrapper.eq("login_mobile", loginMobile);
|
||||
@ -632,7 +632,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
|
||||
// todo 合同签署状态条件
|
||||
|
||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return null;
|
||||
}
|
||||
@ -654,7 +654,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return null;
|
||||
}
|
||||
|
||||
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("login_mobile", loginMobile);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(signedStatus)) {
|
||||
@ -681,7 +681,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("login_mobile", loginMobile).set("store_status", storeStatus);
|
||||
return update(updateWrapper);
|
||||
}
|
||||
@ -692,7 +692,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("login_mobile", loginMobile);
|
||||
if (ObjectUtil.isNotEmpty(lklAuditStatus)) {
|
||||
updateWrapper.set("lkl_audit_status", lklAuditStatus);
|
||||
@ -721,7 +721,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("lkl_mer_cup_no", lklMerCupNo);
|
||||
if (ObjectUtil.isNotEmpty(lklAuditStatus)) {
|
||||
updateWrapper.set("lkl_audit_status", lklAuditStatus);
|
||||
@ -748,7 +748,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return false;
|
||||
}
|
||||
|
||||
return update(new UpdateWrapper<ShopMerchEntry>()
|
||||
return update(new UpdateWrapper<ShopMchEntry>()
|
||||
.eq("id", id)
|
||||
.set("store_id", storeId));
|
||||
}
|
||||
@ -35,7 +35,6 @@ import com.suisung.mall.common.modules.base.*;
|
||||
import com.suisung.mall.common.modules.distribution.ShopDistributionPlantformUser;
|
||||
import com.suisung.mall.common.modules.invoicing.InvoicingCustomerLevel;
|
||||
import com.suisung.mall.common.modules.invoicing.InvoicingWarehouseBase;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import com.suisung.mall.common.modules.page.ShopPageBase;
|
||||
import com.suisung.mall.common.modules.pay.PayUserResource;
|
||||
import com.suisung.mall.common.modules.plantform.ShopPlantformSubsite;
|
||||
@ -171,7 +170,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
private ShopBaseDistrictService shopBaseDistrictService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopMerchEntryService shopMerchEntryService;
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
@Autowired
|
||||
private ThreadPoolExecutor executor;
|
||||
|
||||
@ -3006,13 +3005,13 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
return Pair.of(0, "商家账号异常!");
|
||||
}
|
||||
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (ObjectUtil.isEmpty(shopMerchEntry)) {
|
||||
ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (ObjectUtil.isEmpty(shopMchEntry)) {
|
||||
logger.error("生成店铺:入驻信息不能为空");
|
||||
return Pair.of(0, "入驻信息不能为空");
|
||||
}
|
||||
|
||||
if (isExistsByStoreName(shopMerchEntry.getStore_name())) {
|
||||
if (isExistsByStoreName(shopMchEntry.getStore_name())) {
|
||||
logger.error("生成店铺:店铺名称已存在");
|
||||
return Pair.of(0, "店铺名称已存在");
|
||||
}
|
||||
@ -3023,20 +3022,20 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
// shop_store_base
|
||||
ShopStoreBase shopStoreBase = new ShopStoreBase();
|
||||
shopStoreBase.setUser_id(userId); // 店铺管理员用户Id
|
||||
shopStoreBase.setStore_name(shopMerchEntry.getStore_name());
|
||||
shopStoreBase.setStore_category_id(shopMerchEntry.getBiz_category()); // 重要,店铺分类id,对应 shop_base_store_category 表的分类
|
||||
shopStoreBase.setSplit_ratio(shopMerchEntry.getSplit_ratio()); // 分账比例
|
||||
String storeFacadeImage = shopMerchEntry.getFront_facade_image();
|
||||
shopStoreBase.setStore_name(shopMchEntry.getStore_name());
|
||||
shopStoreBase.setStore_category_id(shopMchEntry.getBiz_category()); // 重要,店铺分类id,对应 shop_base_store_category 表的分类
|
||||
shopStoreBase.setSplit_ratio(shopMchEntry.getSplit_ratio()); // 分账比例
|
||||
String storeFacadeImage = shopMchEntry.getFront_facade_image();
|
||||
shopStoreBase.setStore_logo(storeFacadeImage); // 临时使用门面照片做logo
|
||||
|
||||
|
||||
// 省市区记录有序列表
|
||||
List<ShopBaseDistrict> districtList = shopBaseDistrictService.getFullDistrictByDistrictCode(shopMerchEntry.getCounty_id());
|
||||
List<ShopBaseDistrict> districtList = shopBaseDistrictService.getFullDistrictByDistrictCode(shopMchEntry.getCounty_id());
|
||||
shopStoreBase.setStore_district_id(shopBaseDistrictService.joinDistrict(districtList, 1, true, "/"));
|
||||
shopStoreBase.setStore_area(shopBaseDistrictService.joinDistrict(districtList, 2, true, "/"));
|
||||
shopStoreBase.setStore_address(shopMerchEntry.getStore_address());
|
||||
shopStoreBase.setStore_longitude(shopMerchEntry.getStore_longitude());
|
||||
shopStoreBase.setStore_latitude(shopMerchEntry.getStore_latitude());
|
||||
shopStoreBase.setStore_address(shopMchEntry.getStore_address());
|
||||
shopStoreBase.setStore_longitude(shopMchEntry.getStore_longitude());
|
||||
shopStoreBase.setStore_latitude(shopMchEntry.getStore_latitude());
|
||||
shopStoreBase.setStore_grade_id(1001); // 店铺等级,默认为普通店铺
|
||||
shopStoreBase.setStore_type(1);//店铺类型(ENUM): 1-卖家店铺; 2-供应商店铺
|
||||
shopStoreBase.setStore_is_open(1);
|
||||
@ -3062,7 +3061,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
shopStoreInfo.setStore_opening_hours("08:00");
|
||||
shopStoreInfo.setStore_close_hours("22:00");
|
||||
shopStoreInfo.setStore_discount(BigDecimal.valueOf(10));// 原价
|
||||
shopStoreInfo.setStore_tel(shopMerchEntry.getLogin_mobile());
|
||||
shopStoreInfo.setStore_tel(shopMchEntry.getLogin_mobile());
|
||||
shopStoreInfo.setStore_banner(storeFacadeImage);
|
||||
|
||||
JSONArray list = new JSONArray();
|
||||
@ -3074,16 +3073,16 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
slide.put("url", "https://www.gpsxcs.cn");
|
||||
list.put(slide);
|
||||
}
|
||||
if (StrUtil.isNotBlank(shopMerchEntry.getEnvironment_image())) {
|
||||
if (StrUtil.isNotBlank(shopMchEntry.getEnvironment_image())) {
|
||||
JSONObject slide = new JSONObject();
|
||||
slide.put("img", shopMerchEntry.getEnvironment_image());
|
||||
slide.put("img", shopMchEntry.getEnvironment_image());
|
||||
slide.put("name", "店铺环境照片");
|
||||
slide.put("check", true);
|
||||
slide.put("url", "https://www.gpsxcs.cn");
|
||||
list.put(slide);
|
||||
}
|
||||
shopStoreInfo.setStore_slide(list.toString());
|
||||
shopStoreInfo.setStore_address(shopMerchEntry.getStore_address()); // 包含省市区的详细地址
|
||||
shopStoreInfo.setStore_address(shopMchEntry.getStore_address()); // 包含省市区的详细地址
|
||||
shopStoreInfo.setStore_state_id(StateCode.STORE_STATE_YES);
|
||||
if (!shopStoreInfoService.save(shopStoreInfo)) {
|
||||
logger.error("生成店铺:新增店铺info失败");
|
||||
@ -3097,28 +3096,28 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
shopStoreCompany.setStore_id(storeId);
|
||||
|
||||
// 联系人
|
||||
shopStoreCompany.setContacts_name(shopMerchEntry.getContact_name());
|
||||
shopStoreCompany.setContacts_phone(shopMerchEntry.getLogin_mobile());
|
||||
shopStoreCompany.setContacts_name(shopMchEntry.getContact_name());
|
||||
shopStoreCompany.setContacts_phone(shopMchEntry.getLogin_mobile());
|
||||
|
||||
// 公司名
|
||||
String companyName = StrUtil.isBlank(shopMerchEntry.getBiz_license_company()) ? shopMerchEntry.getStore_name() : shopMerchEntry.getBiz_license_company();
|
||||
String companyName = StrUtil.isBlank(shopMchEntry.getBiz_license_company()) ? shopMchEntry.getStore_name() : shopMchEntry.getBiz_license_company();
|
||||
shopStoreCompany.setCompany_name(companyName);
|
||||
shopStoreCompany.setCompany_area(shopStoreBase.getStore_area());
|
||||
shopStoreCompany.setCompany_address(shopMerchEntry.getStore_address());
|
||||
shopStoreCompany.setCompany_address(shopMchEntry.getStore_address());
|
||||
|
||||
// 营业执照
|
||||
shopStoreCompany.setBusiness_id(shopMerchEntry.getBiz_license_number());
|
||||
shopStoreCompany.setBusiness_license_electronic(shopMerchEntry.getBiz_license_image());
|
||||
shopStoreCompany.setBusiness_id(shopMchEntry.getBiz_license_number());
|
||||
shopStoreCompany.setBusiness_license_electronic(shopMchEntry.getBiz_license_image());
|
||||
|
||||
// 企业法人
|
||||
shopStoreCompany.setLegal_person(shopMerchEntry.getLegal_person_name());
|
||||
shopStoreCompany.setLegal_person_number(shopMerchEntry.getLegal_person_id_number());
|
||||
shopStoreCompany.setLegal_person_electronic(shopMerchEntry.getLegal_person_id_images());
|
||||
shopStoreCompany.setLegal_person(shopMchEntry.getLegal_person_name());
|
||||
shopStoreCompany.setLegal_person_number(shopMchEntry.getLegal_person_id_number());
|
||||
shopStoreCompany.setLegal_person_electronic(shopMchEntry.getLegal_person_id_images());
|
||||
|
||||
// 银行对公账号
|
||||
shopStoreCompany.setBank_account_name(shopMerchEntry.getAccount_holder_name());
|
||||
shopStoreCompany.setBank_account_number(shopMerchEntry.getAccount_number());
|
||||
shopStoreCompany.setBank_name(shopMerchEntry.getBank_name());
|
||||
shopStoreCompany.setBank_account_name(shopMchEntry.getAccount_holder_name());
|
||||
shopStoreCompany.setBank_account_number(shopMchEntry.getAccount_number());
|
||||
shopStoreCompany.setBank_name(shopMchEntry.getBank_name());
|
||||
|
||||
Date today = new Date(); // 当前时间
|
||||
shopStoreCompany.setOrganization_code_start(today);
|
||||
@ -3127,7 +3126,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
shopStoreCompany.setBusiness_licence_start(today);
|
||||
shopStoreCompany.setBusiness_licence_end(DateUtil.offsetDay(today, 365 * 10));
|
||||
|
||||
shopStoreCompany.setCompany_description(shopMerchEntry.getStore_name());
|
||||
shopStoreCompany.setCompany_description(shopMchEntry.getStore_name());
|
||||
shopStoreCompany.setStore_class_ids("");
|
||||
shopStoreCompany.setStore_class_names("");
|
||||
shopStoreCompany.setStore_class_commission("");
|
||||
@ -3162,7 +3161,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
initStoreExtraInfo(userId, storeId);
|
||||
|
||||
// 更改店铺Id
|
||||
shopMerchEntryService.updateMerchEntryStoreId(shopMerchEntry.getId(), storeId);
|
||||
shopMchEntryService.updateMerchEntryStoreId(shopMchEntry.getId(), storeId);
|
||||
|
||||
return Pair.of(storeId, "新增成功");
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?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">
|
||||
<mapper namespace="com.suisung.mall.shop.store.mapper.ShopMerchEntryMapper">
|
||||
<mapper namespace="com.suisung.mall.shop.store.mapper.ShopMchEntryMapper">
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
*
|
||||
Loading…
Reference in New Issue
Block a user