修改代理商表结构

This commit is contained in:
Jack 2025-05-03 19:07:41 +08:00
parent 17778c2e1c
commit 0f563493ef
12 changed files with 247 additions and 248 deletions

View File

@ -47,6 +47,12 @@ public class EsignPlatformInfo implements Serializable {
@ApiModelProperty(value = "平台方营业执照公司名称") @ApiModelProperty(value = "平台方营业执照公司名称")
private String license_company; private String license_company;
@ApiModelProperty(value = "代理商的省/市/区,如:广东省/深圳市/福田区")
private String license_area;
@ApiModelProperty(value = "代理商的省id/市id/区id11000/11100/11101")
private String license_district_id;
@ApiModelProperty(value = "平台方营业执照公司详细地址") @ApiModelProperty(value = "平台方营业执照公司详细地址")
private String license_address; private String license_address;
@ -74,7 +80,7 @@ public class EsignPlatformInfo implements Serializable {
@ApiModelProperty(value = "收款账户名称") @ApiModelProperty(value = "收款账户名称")
private String rec_acc_name; private String rec_acc_name;
@ApiModelProperty(value = "收款账户账户类型:1-个人2-企业;") @ApiModelProperty(value = "收款账户账户类型:1-个人(对私)2-企业(对公)")
private Integer rec_acc_type; private Integer rec_acc_type;
@ApiModelProperty(value = "收款账户证件号") @ApiModelProperty(value = "收款账户证件号")
@ -95,17 +101,11 @@ public class EsignPlatformInfo implements Serializable {
@ApiModelProperty(value = "平台方公司维度") @ApiModelProperty(value = "平台方公司维度")
private String latitude; private String latitude;
@ApiModelProperty(value = "平台方公司店铺所在的省") @ApiModelProperty(value = "代理商等级:0-平台方(只能一条记录)1-一级代理2-二级代理3-三级代理4-四级代理;")
private String province_id; private Integer level;
@ApiModelProperty(value = "平台方公司所在的市") @ApiModelProperty(value = "邀请码,后期跟收益有关")
private String city_id; private String invite_code;
@ApiModelProperty(value = "平台方公司所在的县区")
private String county_id;
@ApiModelProperty(value = "类型:0-平台方(只能一条记录)1-一级代理2-二级代理3-三级代理4-四级代理;")
private Integer type;
@ApiModelProperty(value = "记录状态:1-有效2-无效;") @ApiModelProperty(value = "记录状态:1-有效2-无效;")
private Integer status; private Integer status;

View File

@ -6,7 +6,7 @@
* Vestibulum commodo. Ut rhoncus gravida arcu. * 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.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
@ -25,8 +25,8 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("shop_mch_entry") @TableName("shop_mch_entry")
@ApiModel(value = "ShopMerchEntry 实体", description = "商家入驻信息表") @ApiModel(value = "ShopMchEntry 实体", description = "商家入驻信息表")
public class ShopMerchEntry implements Serializable { public class ShopMchEntry implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID") @ApiModelProperty(value = "自增ID")
@ -192,13 +192,16 @@ public class ShopMerchEntry implements Serializable {
@ApiModelProperty(value = "结算银行地区,格式: 省份/城市/乡县") @ApiModelProperty(value = "结算银行地区,格式: 省份/城市/乡县")
private String bank_area; private String bank_area;
@ApiModelProperty(value = "结算账号类型57-对公 58-对私")
private String account_type;
@ApiModelProperty(value = "入驻商家的收款账户号码") @ApiModelProperty(value = "入驻商家的收款账户号码")
private String account_number; private String account_number;
@ApiModelProperty(value = "入驻商家的收款账户姓名") @ApiModelProperty(value = "入驻商家的收款账户姓名")
private String account_holder_name; private String account_holder_name;
@ApiModelProperty(value = "入驻商家的审批状态1-已通过2-未通过3-待审核;") @ApiModelProperty(value = "入驻商家的审批状态1-已通过2-未通过3-待审核;4-未申请过5-已提交审核;")
private Integer approval_status; private Integer approval_status;
@ApiModelProperty(value = "入驻商家审批时的备注信息") @ApiModelProperty(value = "入驻商家审批时的备注信息")

View File

@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.suisung.mall.common.constant.CommonConstant; import com.suisung.mall.common.constant.CommonConstant;
import com.suisung.mall.common.modules.esign.EsignContractFillingFile; import com.suisung.mall.common.modules.esign.EsignContractFillingFile;
import com.suisung.mall.common.modules.esign.EsignPlatformInfo; 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.common.utils.StringUtils;
import com.suisung.mall.core.web.service.impl.BaseServiceImpl; import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
import com.suisung.mall.shop.esign.mapper.EsignContractFillingFileMapper; 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.enums.EsignRequestType;
import com.suisung.mall.shop.esign.utils.exception.EsignDemoException; import com.suisung.mall.shop.esign.utils.exception.EsignDemoException;
import com.suisung.mall.shop.page.service.OssService; 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 lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
@ -70,7 +70,7 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
private EsignPlatformInfoService esignPlatformInfoService; private EsignPlatformInfoService esignPlatformInfoService;
@Resource @Resource
private ShopMerchEntryService shopMerchEntryService; private ShopMchEntryService shopMchEntryService;
@Resource @Resource
private EsignContractFillingFileService esignContractFillingFileService; private EsignContractFillingFileService esignContractFillingFileService;
@ -107,14 +107,14 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
} }
// 获取入驻商家(审批通过的)的信息 // 获取入驻商家(审批通过的)的信息
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS); ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
if (shopMerchEntry == null) { if (shopMchEntry == null) {
log.error("缺少商家入驻信息"); log.error("缺少商家入驻信息");
return null; return null;
} }
// 代理商信息 // 代理商信息
EsignPlatformInfo distributor = esignPlatformInfoService.getDistributorInfoById(shopMerchEntry.getDistributor_id()); EsignPlatformInfo distributor = esignPlatformInfoService.getDistributorInfoById(shopMchEntry.getDistributor_id());
String apiaddr = "/v3/files/create-by-doc-template"; String apiaddr = "/v3/files/create-by-doc-template";
EsignRequestType requestType = EsignRequestType.POST; EsignRequestType requestType = EsignRequestType.POST;
@ -128,14 +128,14 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
String today = DateUtil.format(new Date(), "yyyy年MM月dd日"); 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 platCompany = esignPlatformInfo.getLicense_company();
// 甲方法人姓名甲方是个人的时候没有法人直接用个人实名 // 甲方法人姓名甲方是个人的时候没有法人直接用个人实名
String legalPersonName = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_name() : shopMerchEntry.getContact_name(); 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(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_mobile() : shopMerchEntry.getLogin_mobile(); 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); 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++) { for (int i = 1; i <= 17; i++) {
int finalI = 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>() {{ list.add(new HashMap<String, Object>() {{
put("componentKey", "mch_company17"); 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>() {{ list.add(new HashMap<String, Object>() {{
put("componentKey", "mch_store_name1"); put("componentKey", "mch_store_name1");
put("componentValue", shopMerchEntry.getStore_name()); put("componentValue", shopMchEntry.getStore_name());
}}); }});
list.add(new HashMap<String, Object>() {{ list.add(new HashMap<String, Object>() {{
@ -244,27 +244,27 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
list.add(new HashMap<String, Object>() {{ list.add(new HashMap<String, Object>() {{
put("componentKey", "mch_ratio"); put("componentKey", "mch_ratio");
put("componentValue", shopMerchEntry.getSplit_ratio()); put("componentValue", shopMchEntry.getSplit_ratio());
}}); }});
list.add(new HashMap<String, Object>() {{ list.add(new HashMap<String, Object>() {{
put("componentKey", "settlement_method"); put("componentKey", "settlement_method");
put("componentValue", shopMerchEntry.getSettlement_method()); put("componentValue", shopMchEntry.getSettlement_method());
}}); }});
list.add(new HashMap<String, Object>() {{ list.add(new HashMap<String, Object>() {{
put("componentKey", "mch_address1"); put("componentKey", "mch_address1");
put("componentValue", shopMerchEntry.getStore_address()); put("componentValue", shopMchEntry.getStore_address());
}}); }});
list.add(new HashMap<String, Object>() {{ list.add(new HashMap<String, Object>() {{
put("componentKey", "mch_bank1"); put("componentKey", "mch_bank1");
put("componentValue", shopMerchEntry.getBank_name()); put("componentValue", shopMchEntry.getBank_name());
}}); }});
list.add(new HashMap<String, Object>() {{ list.add(new HashMap<String, Object>() {{
put("componentKey", "mch_account_number1"); 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"); String fileId = jsonObject.getStr("fileId");
// 把合同文件 url 上传到cos服务器 // 把合同文件 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") 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"); .concat(jsonObject.getStr("fileId")).concat(".pdf");
// 上传到cos服务器 // 上传到cos服务器
String localFileUrl = ossService.uploadObject4OSS(esignContractFillingFile.getUnsigned_contract_url(), cosFileName); String localFileUrl = ossService.uploadObject4OSS(esignContractFillingFile.getUnsigned_contract_url(), cosFileName);

View File

@ -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.EsignContract;
import com.suisung.mall.common.modules.esign.EsignContractFillingFile; import com.suisung.mall.common.modules.esign.EsignContractFillingFile;
import com.suisung.mall.common.modules.esign.EsignPlatformInfo; 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.core.web.service.impl.BaseServiceImpl;
import com.suisung.mall.shop.components.TaskService; import com.suisung.mall.shop.components.TaskService;
import com.suisung.mall.shop.esign.mapper.EsignContractMapper; 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.enums.EsignRequestType;
import com.suisung.mall.shop.esign.utils.exception.EsignDemoException; import com.suisung.mall.shop.esign.utils.exception.EsignDemoException;
import com.suisung.mall.shop.page.service.OssService; 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 com.suisung.mall.shop.store.service.ShopStoreBaseService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -84,7 +84,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
private EsignContractFillingFileService esignContractFillingFileService; private EsignContractFillingFileService esignContractFillingFileService;
@Resource @Resource
private ShopMerchEntryService shopMerchEntryService; private ShopMchEntryService shopMchEntryService;
@Resource @Resource
private EsignPlatformInfoService esignPlatformInfoService; 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)) { if (!CommonConstant.MCH_APPR_STA_PASS.equals(apprStatus)) {
return CommonResult.failed("请先审核商家入驻信息"); return CommonResult.failed("请先审核商家入驻信息");
} }
@ -298,7 +298,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
// 填充合同模版表的店铺Id // 填充合同模版表的店铺Id
esignContractFillingFileService.updateContractFillingStoreId(esignContract.getMch_mobile(), retPair.getFirst()); 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(() -> { taskService.executeTask(() -> {
log.debug("###更改同步合同审核状态和下载地址###"); log.debug("###更改同步合同审核状态和下载地址###");
// 更改同步合同审核状态和下载地址 // 更改同步合同审核状态和下载地址
if (!shopMerchEntryService.updateMerchEntrySignedStatusAndContractDownloadUrl(esignContract.getMch_mobile(), signFlowStatus, localFileUrl)) { if (!shopMchEntryService.updateMerchEntrySignedStatusAndContractDownloadUrl(esignContract.getMch_mobile(), signFlowStatus, localFileUrl)) {
log.error("###更改同步合同审核状态和下载地址失败###"); log.error("###更改同步合同审核状态和下载地址失败###");
} }
}); });
@ -527,8 +527,8 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
} }
// 获取商家审核通过的入驻信息 // 获取商家审核通过的入驻信息
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(esignContractFillingFile.getMobile(), "", CommonConstant.MCH_APPR_STA_PASS); ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(esignContractFillingFile.getMobile(), "", CommonConstant.MCH_APPR_STA_PASS);
if (shopMerchEntry == null) { if (shopMchEntry == null) {
return false; 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 // 未签合同文件ID
String fileId = esignContractFillingFile.getFile_id(); String fileId = esignContractFillingFile.getFile_id();
// (重要)组织生成签署合同的请求参数 // (重要)组织生成签署合同的请求参数
String reqParams = buildSignReqParams(shopMerchEntry, esignPlatformInfo, distributor, esignContractFillingFile); String reqParams = buildSignReqParams(shopMchEntry, esignPlatformInfo, distributor, esignContractFillingFile);
// 保存签署合同记录 // 保存签署合同记录
EsignContract esignContract = new EsignContract(); EsignContract esignContract = new EsignContract();
@ -554,12 +554,12 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
esignContract.setContract_name(esignContractFillingFile.getContract_name()); esignContract.setContract_name(esignContractFillingFile.getContract_name());
esignContract.setContract_file_id(fileId); esignContract.setContract_file_id(fileId);
esignContract.setMch_mobile(esignContractFillingFile.getMobile()); esignContract.setMch_mobile(esignContractFillingFile.getMobile());
esignContract.setMch_company(shopMerchEntry.getBiz_license_company()); esignContract.setMch_company(shopMchEntry.getBiz_license_company());
esignContract.setMch_biz_license(shopMerchEntry.getBiz_license_number()); esignContract.setMch_biz_license(shopMchEntry.getBiz_license_number());
esignContract.setReq_params(reqParams); esignContract.setReq_params(reqParams);
esignContract.setUnsigned_contract_url(esignContractFillingFile.getUnsigned_contract_local_url()); esignContract.setUnsigned_contract_url(esignContractFillingFile.getUnsigned_contract_local_url());
esignContract.setStore_id(esignContractFillingFile.getStore_id()); 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 - 已拒签签署方拒绝签署 esignContract.setSign_flow_status(-1);//合作方签署状态-1:预备数据阶段1-等待签署2 - 已完成所有签署方完成签署3 - 已撤销发起方撤销签署任务5 - 已过期签署截止日到期后触发7 - 已拒签签署方拒绝签署
return saveOrUpdateByMchMobile(esignContract); return saveOrUpdateByMchMobile(esignContract);
@ -729,13 +729,13 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
/** /**
* 重要组织生成签署合同的所有请求参数 * 重要组织生成签署合同的所有请求参数
* *
* @param shopMerchEntry * @param shopMchEntry
* @param esignPlatformInfo * @param esignPlatformInfo
* @param esignContractFillingFile * @param esignContractFillingFile
* @return * @return
*/ */
protected String buildSignReqParams(ShopMerchEntry shopMerchEntry, EsignPlatformInfo esignPlatformInfo, EsignPlatformInfo distributor, EsignContractFillingFile esignContractFillingFile) { protected String buildSignReqParams(ShopMchEntry shopMchEntry, EsignPlatformInfo esignPlatformInfo, EsignPlatformInfo distributor, EsignContractFillingFile esignContractFillingFile) {
if (shopMerchEntry == null || esignPlatformInfo == null || esignContractFillingFile == null) { if (shopMchEntry == null || esignPlatformInfo == null || esignContractFillingFile == null) {
return ""; return "";
} }
@ -765,19 +765,19 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
mchSigner.putByPath("signConfig.signOrder", 1); mchSigner.putByPath("signConfig.signOrder", 1);
mchSigner.putByPath("noticeConfig.noticeTypes", "1");// 短信 mchSigner.putByPath("noticeConfig.noticeTypes", "1");// 短信
mchSigner.putByPath("signFields", JSONUtil.parseArray(esignContractFillingFile.getMch_sign_position())); 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.put("signerType", 1);
mchSigner.putByPath("orgSignerInfo.orgName", shopMerchEntry.getBiz_license_company()); mchSigner.putByPath("orgSignerInfo.orgName", shopMchEntry.getBiz_license_company());
mchSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", shopMerchEntry.getBiz_license_number()); mchSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", shopMchEntry.getBiz_license_number());
mchSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardType", "CRED_ORG_USCC"); mchSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardType", "CRED_ORG_USCC");
mchSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", shopMerchEntry.getLogin_mobile()); mchSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", shopMchEntry.getLogin_mobile());
mchSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", shopMerchEntry.getLegal_person_name()); mchSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", shopMchEntry.getLegal_person_name());
} else { } else {
// 个人 // 个人
mchSigner.put("signerType", 0); mchSigner.put("signerType", 0);
mchSigner.putByPath("psnSignerInfo.psnAccount", shopMerchEntry.getLogin_mobile()); mchSigner.putByPath("psnSignerInfo.psnAccount", shopMchEntry.getLogin_mobile());
mchSigner.putByPath("psnSignerInfo.psnInfo.psnName", shopMerchEntry.getContact_name()); mchSigner.putByPath("psnSignerInfo.psnInfo.psnName", shopMchEntry.getContact_name());
} }
// 加入甲方信息 // 加入甲方信息
signers.add(mchSigner); signers.add(mchSigner);
@ -787,7 +787,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
platSigner.putByPath("signConfig.signOrder", 2); platSigner.putByPath("signConfig.signOrder", 2);
platSigner.putByPath("noticeConfig.noticeTypes", "1,2"); // 短信和邮件 platSigner.putByPath("noticeConfig.noticeTypes", "1,2"); // 短信和邮件
platSigner.putByPath("signFields", JSONUtil.parseArray(esignContractFillingFile.getPlat_sign_position())); 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.put("signerType", 1);
platSigner.putByPath("orgSignerInfo.orgName", esignPlatformInfo.getLicense_company()); platSigner.putByPath("orgSignerInfo.orgName", esignPlatformInfo.getLicense_company());
@ -810,7 +810,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
distrSigner.putByPath("signConfig.signOrder", 3); distrSigner.putByPath("signConfig.signOrder", 3);
distrSigner.putByPath("noticeConfig.noticeTypes", "1"); // 短信和邮件 distrSigner.putByPath("noticeConfig.noticeTypes", "1"); // 短信和邮件
distrSigner.putByPath("signFields", JSONUtil.parseArray(esignContractFillingFile.getDistri_sign_position())); 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.put("signerType", 1);
distrSigner.putByPath("orgSignerInfo.orgName", distributor.getLicense_company()); distrSigner.putByPath("orgSignerInfo.orgName", distributor.getLicense_company());

View File

@ -15,13 +15,13 @@ import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.suisung.mall.common.constant.CommonConstant; 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.RestTemplateHttpUtil;
import com.suisung.mall.common.utils.StringUtils; import com.suisung.mall.common.utils.StringUtils;
import com.suisung.mall.common.utils.UploadUtil; import com.suisung.mall.common.utils.UploadUtil;
import com.suisung.mall.core.web.service.RedisService; import com.suisung.mall.core.web.service.RedisService;
import com.suisung.mall.shop.lakala.utils.LakalaUtil; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -69,7 +69,7 @@ public class LklTkServiceImpl {
private String profile; private String profile;
@Resource @Resource
private ShopMerchEntryService shopMerchEntryService; private ShopMchEntryService shopMchEntryService;
@Autowired @Autowired
private RedisService redisService; private RedisService redisService;
@ -121,6 +121,14 @@ public class LklTkServiceImpl {
return "prod".equalsIgnoreCase(profile); return "prod".equalsIgnoreCase(profile);
} }
/**
* 上传文件图片到拉卡拉 OCR识别卡信息身份证信息营业执照信息
*
* @param fileBase64 图片的base64字符串
* @param fileURL 图片的url地址
* @param imgType 图片类型
* @return
*/
public JSONObject uploadFileWithOcr(String fileBase64, String fileURL, String imgType) { public JSONObject uploadFileWithOcr(String fileBase64, String fileURL, String imgType) {
String authorization = getLklTkAuthorization(); String authorization = getLklTkAuthorization();
if (StrUtil.isBlank(authorization)) { if (StrUtil.isBlank(authorization)) {
@ -130,28 +138,27 @@ public class LklTkServiceImpl {
JSONObject header = new JSONObject(); JSONObject header = new JSONObject();
header.put("Authorization", authorization); header.put("Authorization", authorization);
String urlPath = "/sit/htkregistration/file/upload"; String urlPath = isProd() ? "/registration/file/upload" : "/sit/htkregistration/file/upload";
if (isProd()) {
urlPath = "/registration/file/upload";
}
if (StrUtil.isBlank(fileBase64)) { if (StrUtil.isBlank(fileBase64)) {
// web url base64 字节
fileBase64 = UploadUtil.URLFileToBase64(fileURL); fileBase64 = UploadUtil.URLFileToBase64(fileURL);
} }
JSONObject requestBody = new JSONObject(); JSONObject requestBody = new JSONObject();
requestBody.put("fileBase64", fileBase64); requestBody.put("fileBase64", fileBase64);
// requestBody.put("file", fileBase64);
requestBody.put("imgType", imgType); requestBody.put("imgType", imgType);
requestBody.put("sourcechnl", "0"); requestBody.put("sourcechnl", "0"); // 来源: 0:PC,1:安卓,2:IOS
requestBody.put("isOcr", "true"); requestBody.put("isOcr", "true");
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostBodyBackEntity(buildLklServiceUrl(urlPath), header, requestBody, JSONObject.class);
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostBodyBackEntity("https://htkactvi.lakala.com/registration/file/upload", header, requestBody, JSONObject.class); if (ObjectUtil.isEmpty(response)
if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK || response.getBody() == null) { || response.getStatusCode() != HttpStatus.OK
return null; || ObjectUtil.isEmpty(response.getBody())) {
return JSONUtil.createObj().set("code", 500).set("msg", "返回值有误!");
} }
// {batchNo,status,url,showUrl,result{} }
return response.getBody(); return response.getBody();
} }
@ -204,77 +211,81 @@ public class LklTkServiceImpl {
header.put("Authorization", getLklTkAuthorization()); header.put("Authorization", getLklTkAuthorization());
// 获取商家入驻信息组成请求参数 // 获取商家入驻信息组成请求参数
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, null, CommonConstant.MCH_APPR_STA_PASS); ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, null, CommonConstant.MCH_APPR_STA_PASS);
if (ObjectUtil.isEmpty(shopMerchEntry)) { if (ObjectUtil.isEmpty(shopMchEntry)) {
return Pair.of(false, "商家入驻信息不存在"); return Pair.of(false, "商家入驻信息不存在");
} }
JSONObject formData = new JSONObject(); JSONObject formData = new JSONObject();
formData.put("userNo", "29153396"); 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"; String merType = isQy ? "TP_MERCHANT" : "TP_PERSONAL";
formData.put("merType", merType); formData.put("merType", merType);
formData.put("merName", shopMerchEntry.getStore_name()); Map<String, String> areaCode = getAreaCode(shopMchEntry.getStore_area(), false);
formData.put("merAddr", StringUtils.removeProvinceCityDistrict(shopMerchEntry.getStore_address()));
Map<String, String> areaCode = getAreaCode(shopMerchEntry.getStore_area(), false);
if (ObjectUtil.isNotEmpty(areaCode)) { if (ObjectUtil.isNotEmpty(areaCode)) {
formData.put("provinceCode", areaCode.get("provinceCode")); formData.put("provinceCode", areaCode.get("provinceCode"));
formData.put("cityCode", areaCode.get("cityCode")); formData.put("cityCode", areaCode.get("cityCode"));
formData.put("countyCode", areaCode.get("countyCode")); formData.put("countyCode", areaCode.get("countyCode"));
} }
formData.put("longtude", shopMerchEntry.getStore_longitude()); //longitude 经度 formData.put("longtude", shopMchEntry.getStore_longitude()); //longitude 经度
formData.put("latitude", shopMerchEntry.getStore_latitude()); formData.put("latitude", shopMchEntry.getStore_latitude());
formData.put("source", "H5"); formData.put("source", "H5");
formData.put("larIdType", "01"); // 01 身份证 02 护照03 港澳通行证04 台胞证10 外国人永久居留身份证11 港妨澳居民居住证12 台湾居民居住证13 执行事务合伙人99 其它证件 formData.put("larIdType", "01"); // 01 身份证 02 护照03 港澳通行证04 台胞证10 外国人永久居留身份证11 港妨澳居民居住证12 台湾居民居住证13 执行事务合伙人99 其它证件
String larName = isQy ? shopMerchEntry.getLegal_person_name() : shopMerchEntry.getContact_name(); String larName = isQy ? shopMchEntry.getLegal_person_name() : shopMchEntry.getContact_name();
String larIdCard = isQy ? shopMerchEntry.getLegal_person_id_number() : shopMerchEntry.getIndividual_id_number(); String larIdCard = isQy ? shopMchEntry.getLegal_person_id_number() : shopMchEntry.getIndividual_id_number();
String larIdCardStart = isQy ? shopMerchEntry.getLegal_person_id_period_begin() : shopMerchEntry.getIndividual_id_period_begin(); String larIdCardStart = isQy ? shopMchEntry.getLegal_person_id_period_begin() : shopMchEntry.getIndividual_id_period_begin();
String larIdCardEnd = isQy ? shopMerchEntry.getLegal_person_id_period_end() : shopMerchEntry.getIndividual_id_period_end(); String larIdCardEnd = isQy ? shopMchEntry.getLegal_person_id_period_end() : shopMchEntry.getIndividual_id_period_end();
// 法人相关信息
formData.put("larName", larName); formData.put("larName", larName);
formData.put("larIdCard", larIdCard); formData.put("larIdCard", larIdCard);
formData.put("larIdCardStart", larIdCardStart); // 身份证有效期开始时间 formData.put("larIdCardStart", larIdCardStart); // 身份证有效期开始时间
formData.put("larIdCardEnd", larIdCardEnd); // 身份证有效期结束时间 formData.put("larIdCardEnd", larIdCardEnd); // 身份证有效期结束时间
formData.put("businessContent", shopMerchEntry.getSales_info()); // 营业执照上的经营内容
formData.put("businessContent", shopMchEntry.getSales_info());
// 营业执照信息 // 营业执照信息
if (isQy) { if (isQy) {
formData.put("licenseName", shopMerchEntry.getBiz_license_company()); formData.put("licenseName", shopMchEntry.getBiz_license_company());
formData.put("licenseNo", shopMerchEntry.getBiz_license_number()); formData.put("licenseNo", shopMchEntry.getBiz_license_number());
formData.put("licenseDtStart", shopMerchEntry.getBiz_license_period_begin()); formData.put("licenseDtStart", shopMchEntry.getBiz_license_period_begin());
formData.put("licenseDtEnd", shopMerchEntry.getBiz_license_period_end()); formData.put("licenseDtEnd", shopMchEntry.getBiz_license_period_end());
} }
formData.put("contactMobile", mchMobile); formData.put("contactMobile", mchMobile);
formData.put("contactName", shopMerchEntry.getContact_name()); formData.put("contactName", shopMchEntry.getContact_name());
formData.put("openningBankCode", shopMerchEntry.getBank_code());//结算账户开户 formData.put("openningBankCode", shopMchEntry.getBank_code());//结算账户开户
formData.put("openningBankName", shopMerchEntry.getBank_name());//结算账户开户名称 formData.put("openningBankName", shopMchEntry.getBank_name());//结算账户开户名称
formData.put("clearingBankCode", shopMerchEntry.getClearing_bank_code());//结算账户清算 formData.put("clearingBankCode", shopMchEntry.getClearing_bank_code());//结算账户清算
formData.put("accountNo", shopMerchEntry.getAccount_number()); //结算人银行卡号 formData.put("accountType", isQy ? "57" : "58"); //结算账户类型: 57 对公 58 对私
formData.put("accountName", shopMerchEntry.getAccount_holder_name()); //结算人账户名称 formData.put("accountNo", shopMchEntry.getAccount_number()); //结算人银行卡号
formData.put("accountIdCard", shopMerchEntry.getLegal_person_id_number());//结算证件号码(身份证) formData.put("accountName", shopMchEntry.getAccount_holder_name()); //结算人账户名称
formData.put("accountIdCard", shopMchEntry.getLegal_person_id_number());//结算证件号码(身份证)
formData.put("settleType", "D1"); //结算类型D0秒到D1次日结算 formData.put("settleType", "D1"); //结算类型D0秒到D1次日结算
formData.put("settlementType", "AUTOMATIC"); // 结算方式MANUAL:手动结算(结算至拉卡拉APP钱包),AUTOMATIC:自动结算到银行卡,REGULAR:定时结算仅企业商户支持 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)) { if (ObjectUtil.isNotEmpty(bankAreaCode)) {
formData.put("settleProvinceCode", bankAreaCode.get("provinceCode")); formData.put("settleProvinceCode", bankAreaCode.get("provinceCode"));
formData.put("settleCityCode", bankAreaCode.get("cityCode")); formData.put("settleCityCode", bankAreaCode.get("cityCode"));
String[] bankAreaName = shopMerchEntry.getBank_area().split(","); String[] bankAreaName = shopMchEntry.getBank_area().split(",");
if (bankAreaName.length >= 2) { if (bankAreaName.length >= 2) {
formData.put("settleProvinceName", bankAreaName[0]); formData.put("settleProvinceName", bankAreaName[0]);
formData.put("settleCityName", bankAreaName[1]); formData.put("settleCityName", bankAreaName[1]);
@ -294,72 +305,69 @@ public class LklTkServiceImpl {
}}); }});
formData.put("bizContent", bizContent); formData.put("bizContent", bizContent);
// 附件文件 // 附件文件相关开始
JSONArray attachments = new JSONArray(); 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) { if (ID_CARD_FRONT != null) {
attachments.put(ID_CARD_FRONT); // 身份证正面 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) { if (ID_CARD_BEHIND != null) {
attachments.put(ID_CARD_BEHIND); // 身份证国徽面 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) { if (SETTLE_ID_CARD_FRONT != null) {
attachments.put(SETTLE_ID_CARD_FRONT); // 结算人身份证正面 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) { if (SETTLE_ID_CARD_BEHIND != null) {
attachments.put(SETTLE_ID_CARD_BEHIND); // 结算人身份证国徽面 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) { if (BUSINESS_LICENCE != null) {
attachments.put(BUSINESS_LICENCE); // 营业执照 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) { if (SHOP_OUTSIDE_IMG != null) {
attachments.put(SHOP_OUTSIDE_IMG); // 门店门面图片 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) { if (SHOP_INSIDE_IMG != null) {
attachments.put(SHOP_INSIDE_IMG); // 门店内部图片 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) { if (BANK_CARD != null) {
attachments.put(BANK_CARD); // 银行卡图片 attachments.put(BANK_CARD); // 银行卡图片
} }
formData.put("attchments", attachments); formData.put("attchments", attachments);
// 附件文件相关结束
String urlPath = isProd() ? "/registration/merchant" : "/sit/htkregistration/merchant";
String urlPath = "/sit/htkregistration/merchant";
if (isProd()) {
urlPath = "/registration/merchant";
}
ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostFormDataBackEntity(buildLklTkUrl(urlPath), header, formData, JSONObject.class); ResponseEntity<JSONObject> response = RestTemplateHttpUtil.sendPostFormDataBackEntity(buildLklTkUrl(urlPath), header, formData, JSONObject.class);
if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK) { if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK) {
String errMsg = "请求分账系统出错!"; String errMsg = "返回空或请求状态异常。";
if (ObjectUtil.isNotEmpty(response.getBody()) && ObjectUtil.isNotEmpty(response.getBody().getStr("message"))) { if (ObjectUtil.isNotEmpty(response.getBody()) && ObjectUtil.isNotEmpty(response.getBody().getStr("message"))) {
errMsg = response.getBody().getStr("message"); errMsg = response.getBody().getStr("message");
} }
return Pair.of(false, "进件失败:" + errMsg); return Pair.of(false, "进件失败:" + errMsg);
} }
// 根据入驻商家的代理商或平台方顺便新增一个接收方记录
// 更改入驻记录的拉卡拉内部商户号和进件请求参数 // 更改入驻记录的拉卡拉内部商户号和进件请求参数
String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号 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")); String data = decryptNotifyData(notifyPubKeyPath, reqBodyJSON.getStr("data"));
log.debug("拉卡拉进件异步通知返回解密后的参数:{}", data);
if (StrUtil.isBlank(data)) { if (StrUtil.isBlank(data)) {
return new JSONObject().set("code", "500").set("message", "参数解密出错"); return new JSONObject().set("code", "500").set("message", "参数解密出错");
} }
log.debug("拉卡拉进件异步通知返回解密后的参数:{}", data);
// 逻辑处理 // 逻辑处理
JSONObject dataJSON = JSONUtil.parseObj(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", "参数解析出错"); 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", "成功"); return new JSONObject().set("code", "200").set("message", "成功");
} }
/** /**
* 获取拉卡拉省市区编码 * 获取拉卡拉店铺的(或银行的)省市区编码
* *
* @param areaName 省份/城市/乡县 * @param areaName 省份/城市/乡县
* @return * @return
*/ */
public Map<String, String> getAreaCode(String areaName, Boolean isBankArea) { public Map<String, String> getAreaCode(String areaName, Boolean isBankArea) {
if (StrUtil.isBlank(areaName)) { Map retMap = new HashMap<String, String>() {{
return new HashMap<String, String>() {{ put("provinceCode", "");
put("provinceCode", ""); put("cityCode", "");
put("cityCode", ""); put("countyCode", "");
put("countyCode", ""); }};
}};
}
String[] areaNames = areaName.split("/"); String[] areaNames = areaName.split("/");
if (areaNames.length < 2) { if (StrUtil.isBlank(areaName) || areaNames.length < 2) {
return new HashMap<String, String>() {{ return retMap;
put("provinceCode", "");
put("cityCode", "");
put("countyCode", "");
}};
} }
String provinceName = areaNames[0]; String provinceName = areaNames[0];
@ -434,29 +443,18 @@ public class LklTkServiceImpl {
countryName = areaNames[2]; countryName = areaNames[2];
} }
String urlPath = "/sit/htkregistration/organization"; String urlPath = isProd() ? "/registration/organization" : "/sit/htkregistration/organization";
if (isProd()) { urlPath = isBankArea ? urlPath + "/bank" : urlPath; // 银行地区
urlPath = "/registration/organization";
}
if (isBankArea) {
urlPath += "/bank";
}
String authorization = getLklTkAuthorization(); String authorization = getLklTkAuthorization();
if (StrUtil.isBlank(authorization)) { if (StrUtil.isBlank(authorization)) {
log.error("获取拉卡拉token失败"); log.error("获取拉卡拉token失败");
return new HashMap<String, String>() {{ return retMap;
put("provinceCode", "");
put("cityCode", "");
put("countyCode", "");
}};
} }
JSONObject header = new JSONObject(); JSONObject header = new JSONObject();
header.put("Authorization", getLklTkAuthorization()); header.put("Authorization", getLklTkAuthorization());
Map<String, String> areaCodeMap = new HashMap<>();
// 省份列表 // 省份列表
ResponseEntity<JSONArray> response = RestTemplateHttpUtil.sendGetWithHeader(buildLklTkUrl(urlPath + "/1"), header, JSONArray.class); ResponseEntity<JSONArray> response = RestTemplateHttpUtil.sendGetWithHeader(buildLklTkUrl(urlPath + "/1"), header, JSONArray.class);
@ -467,10 +465,11 @@ public class LklTkServiceImpl {
JSONArray jsonArray = response.getBody(); JSONArray jsonArray = response.getBody();
if (CollUtil.isNotEmpty(jsonArray)) { if (CollUtil.isNotEmpty(jsonArray)) {
// 省份列表
for (JSONObject jsonObject : jsonArray.jsonIter()) { for (JSONObject jsonObject : jsonArray.jsonIter()) {
if (StrUtil.contains(jsonObject.getStr("name"), provinceName)) { if (StrUtil.contains(jsonObject.getStr("name"), provinceName)) {
provinceCode = jsonObject.getStr("code"); provinceCode = jsonObject.getStr("code");
areaCodeMap.put("provinceCode", provinceCode); retMap.put("provinceCode", provinceCode);
break; break;
} }
} }
@ -483,15 +482,14 @@ public class LklTkServiceImpl {
for (JSONObject jsonObject : jsonArray.jsonIter()) { for (JSONObject jsonObject : jsonArray.jsonIter()) {
if (StrUtil.contains(jsonObject.getStr("name"), cityName)) { if (StrUtil.contains(jsonObject.getStr("name"), cityName)) {
cityCode = jsonObject.getStr("code"); cityCode = jsonObject.getStr("code");
areaCodeMap.put("cityCode", cityCode); retMap.put("cityCode", cityCode);
break; break;
} }
} }
} }
} }
// 乡县列表
// 乡列表
if (StrUtil.isNotBlank(cityCode)) { if (StrUtil.isNotBlank(cityCode)) {
response = RestTemplateHttpUtil.sendGetWithHeader(buildLklTkUrl(urlPath + "/" + cityCode), header, JSONArray.class); response = RestTemplateHttpUtil.sendGetWithHeader(buildLklTkUrl(urlPath + "/" + cityCode), header, JSONArray.class);
jsonArray = response.getBody(); jsonArray = response.getBody();
@ -499,7 +497,7 @@ public class LklTkServiceImpl {
for (JSONObject jsonObject : jsonArray.jsonIter()) { for (JSONObject jsonObject : jsonArray.jsonIter()) {
if (StrUtil.contains(jsonObject.getStr("name"), countryName)) { if (StrUtil.contains(jsonObject.getStr("name"), countryName)) {
countyCode = jsonObject.getStr("code"); countyCode = jsonObject.getStr("code");
areaCodeMap.put("countyCode", countyCode); retMap.put("countyCode", countyCode);
break; break;
} }
} }
@ -508,8 +506,7 @@ public class LklTkServiceImpl {
} }
} }
return retMap;
return areaCodeMap;
} }
public JSONObject updatePhoto(String fileUrl, String imgType, Boolean isOcr) { public JSONObject updatePhoto(String fileUrl, String imgType, Boolean isOcr) {

View File

@ -11,7 +11,7 @@ package com.suisung.mall.shop.store.controller.admin;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.api.CommonResult;
import com.suisung.mall.common.service.impl.BaseControllerImpl; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -24,10 +24,10 @@ import javax.annotation.Resource;
@Api(tags = "店铺基础信息表") @Api(tags = "店铺基础信息表")
@RestController @RestController
@RequestMapping("/admin/shop/merch") @RequestMapping("/admin/shop/merch")
public class ShopMerchEntryAdminController extends BaseControllerImpl { public class ShopMchEntryAdminController extends BaseControllerImpl {
@Resource @Resource
private ShopMerchEntryService shopMerchEntryService; private ShopMchEntryService shopMchEntryService;
/** /**
* 商家申请入驻商城平台 * 商家申请入驻商城平台
@ -38,20 +38,20 @@ public class ShopMerchEntryAdminController extends BaseControllerImpl {
@ApiOperation(value = "后台-商家申请入驻分页列表", notes = "商家申请入驻分页列表") @ApiOperation(value = "后台-商家申请入驻分页列表", notes = "商家申请入驻分页列表")
@RequestMapping(value = "/list", method = RequestMethod.POST) @RequestMapping(value = "/list", method = RequestMethod.POST)
public CommonResult shopMerchEntryList(@RequestBody JSONObject shopMerchEntryJSON) { 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 = "后台-获取商家入驻资料详情") @ApiOperation(value = "后台-获取商家入驻资料详情", notes = "后台-获取商家入驻资料详情")
@RequestMapping(value = "/detail", method = RequestMethod.POST) @RequestMapping(value = "/detail", method = RequestMethod.POST)
public CommonResult shopMerchEntryDetail(@RequestBody JSONObject jsonParam) { public CommonResult shopMerchEntryDetail(@RequestBody JSONObject jsonParam) {
return shopMerchEntryService.shopMerchEntryDetail(jsonParam.getLong("id"), "", null); return shopMchEntryService.shopMerchEntryDetail(jsonParam.getLong("id"), "", null);
} }
@ApiOperation(value = "商家入驻审批", notes = "商家入驻审批") @ApiOperation(value = "商家入驻审批", notes = "商家入驻审批")
@RequestMapping(value = "/approval", method = RequestMethod.POST) @RequestMapping(value = "/approval", method = RequestMethod.POST)
public CommonResult shopMerchEntryApproval(@RequestBody JSONObject jsonParam) { public CommonResult shopMerchEntryApproval(@RequestBody JSONObject jsonParam) {
// approvalStatus 入驻商家的审批状态1-已通过2-未通过3-待审核 // 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"));
} }

View File

@ -10,11 +10,11 @@ package com.suisung.mall.shop.store.controller.mobile;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.suisung.mall.common.api.CommonResult; 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.BaiduMapServiceImpl;
import com.suisung.mall.common.service.impl.BaseControllerImpl; import com.suisung.mall.common.service.impl.BaseControllerImpl;
import com.suisung.mall.shop.esign.service.EsignContractFillingFileService; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -26,10 +26,10 @@ import java.util.Map;
@Api(tags = "店铺基础信息表") @Api(tags = "店铺基础信息表")
@RestController @RestController
@RequestMapping("/mobile/shop/merch") @RequestMapping("/mobile/shop/merch")
public class ShopMerchEntryController extends BaseControllerImpl { public class ShopMchEntryController extends BaseControllerImpl {
@Resource @Resource
private ShopMerchEntryService shopMerchEntryService; private ShopMchEntryService shopMchEntryService;
@Resource @Resource
private EsignContractFillingFileService esignContractFillingFileService; private EsignContractFillingFileService esignContractFillingFileService;
@ -47,26 +47,26 @@ public class ShopMerchEntryController extends BaseControllerImpl {
@ApiOperation(value = "店铺主营分类(类目)", notes = "店铺主营分类(类目)") @ApiOperation(value = "店铺主营分类(类目)", notes = "店铺主营分类(类目)")
@RequestMapping(value = "/business/category", method = RequestMethod.POST) @RequestMapping(value = "/business/category", method = RequestMethod.POST)
public CommonResult shopStoreBusinessCategoryList() { public CommonResult shopStoreBusinessCategoryList() {
return shopMerchEntryService.storeBusinessCategoryList(); return shopMchEntryService.storeBusinessCategoryList();
} }
@ApiOperation(value = "商家申请入驻商城平台", notes = "商家申请入驻商城平台") @ApiOperation(value = "商家申请入驻商城平台", notes = "商家申请入驻商城平台")
@RequestMapping(value = "/apply", method = RequestMethod.POST) @RequestMapping(value = "/apply", method = RequestMethod.POST)
public CommonResult shopMerchEntryApply(@RequestBody JSONObject shopMerchEntryJSON) { public CommonResult shopMerchEntryApply(@RequestBody JSONObject shopMerchEntryJSON) {
return shopMerchEntryService.shopMerchEntryApply(shopMerchEntryJSON); return shopMchEntryService.shopMerchEntryApply(shopMerchEntryJSON);
} }
@ApiOperation(value = "获取商家入驻资料详情", notes = "获取商家入驻资料详情") @ApiOperation(value = "获取商家入驻资料详情", notes = "获取商家入驻资料详情")
@RequestMapping(value = "/detail", method = RequestMethod.POST) @RequestMapping(value = "/detail", method = RequestMethod.POST)
public CommonResult shopMerchEntryDetail(@RequestBody JSONObject jsonParam) { 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 = "通过手机号获取商家入驻审核状态,远程调用用途") @ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,远程调用用途")
@RequestMapping(value = "/approval/status", method = RequestMethod.POST) @RequestMapping(value = "/approval/status", method = RequestMethod.POST)
public Integer shopMerchEntryApprovalStatus(@RequestBody JSONObject jsonParam) { public Integer shopMerchEntryApprovalStatus(@RequestBody JSONObject jsonParam) {
// approvalStatus 入驻商家的审批状态1-已通过2-未通过3-待审核4-未申请 // 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) { if (record == null || record.getApproval_status() == null) {
return 4; return 4;
} }
@ -78,7 +78,7 @@ public class ShopMerchEntryController extends BaseControllerImpl {
@RequestMapping(value = "/fresh/approval/status", method = RequestMethod.POST) @RequestMapping(value = "/fresh/approval/status", method = RequestMethod.POST)
public CommonResult shopMerchEntryApprovalStatus2(@RequestBody JSONObject jsonParam) { public CommonResult shopMerchEntryApprovalStatus2(@RequestBody JSONObject jsonParam) {
// approvalStatus 入驻商家的审批状态1-已通过2-未通过3-待审核4-未申请 // 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<>(); Map<String, Object> result = new HashMap<>();
if (record == null || record.getApproval_status() == null) { if (record == null || record.getApproval_status() == null) {
// 配合前端的要求没有申请过入驻商城平台的时候返回未申请状态 // 配合前端的要求没有申请过入驻商城平台的时候返回未申请状态
@ -103,7 +103,7 @@ public class ShopMerchEntryController extends BaseControllerImpl {
@ApiOperation(value = "商家重新申请入驻商城平台", notes = "商家申请入驻材料被驳回的时候,修正材料,重新申请入驻") @ApiOperation(value = "商家重新申请入驻商城平台", notes = "商家申请入驻材料被驳回的时候,修正材料,重新申请入驻")
@RequestMapping(value = "/re-apply", method = RequestMethod.POST) @RequestMapping(value = "/re-apply", method = RequestMethod.POST)
public CommonResult shopMerchEntryReApply(@RequestBody JSONObject shopMerchEntryJSON) { public CommonResult shopMerchEntryReApply(@RequestBody JSONObject shopMerchEntryJSON) {
return shopMerchEntryService.shopMerchEntryReApply(shopMerchEntryJSON); return shopMchEntryService.shopMerchEntryReApply(shopMerchEntryJSON);
} }
/** /**

View File

@ -9,9 +9,9 @@
package com.suisung.mall.shop.store.mapper; package com.suisung.mall.shop.store.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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; import org.springframework.stereotype.Component;
@Component @Component
public interface ShopMerchEntryMapper extends BaseMapper<ShopMerchEntry> { public interface ShopMchEntryMapper extends BaseMapper<ShopMchEntry> {
} }

View File

@ -10,12 +10,12 @@ package com.suisung.mall.shop.store.service;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.suisung.mall.common.api.CommonResult; 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 org.springframework.data.util.Pair;
import java.util.List; import java.util.List;
public interface ShopMerchEntryService { public interface ShopMchEntryService {
/** /**
* 获取店铺的经营类目列表 * 获取店铺的经营类目列表
@ -96,7 +96,7 @@ public interface ShopMerchEntryService {
* @param loginMobile * @param loginMobile
* @return * @return
*/ */
ShopMerchEntry shopMerchEntryApprovalInfo(String loginMobile); ShopMchEntry shopMerchEntryApprovalInfo(String loginMobile);
/** /**
* 根据商家手机号营业执照审批状态获取有效的商家入驻申请记录 * 根据商家手机号营业执照审批状态获取有效的商家入驻申请记录
@ -106,7 +106,7 @@ public interface ShopMerchEntryService {
* @param approvalStatus * @param approvalStatus
* @return * @return
*/ */
ShopMerchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus); ShopMchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus);
/** /**
* 根据商家注册的手机号更新合同签署状态和合同下载地址 * 根据商家注册的手机号更新合同签署状态和合同下载地址

View File

@ -19,7 +19,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
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;
import com.suisung.mall.common.constant.CommonConstant; 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.BankUtil;
import com.suisung.mall.common.utils.StringUtils; import com.suisung.mall.common.utils.StringUtils;
import com.suisung.mall.common.utils.phone.PhoneNumberUtils; 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.EsignContractService;
import com.suisung.mall.shop.esign.service.EsignPlatformInfoService; import com.suisung.mall.shop.esign.service.EsignPlatformInfoService;
import com.suisung.mall.shop.message.service.ShopMessageTemplateService; import com.suisung.mall.shop.message.service.ShopMessageTemplateService;
import com.suisung.mall.shop.store.mapper.ShopMerchEntryMapper; import com.suisung.mall.shop.store.mapper.ShopMchEntryMapper;
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 com.suisung.mall.shop.store.service.ShopStoreBaseService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -51,7 +51,7 @@ import java.util.Map;
*/ */
@Slf4j @Slf4j
@Service @Service
public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMapper, ShopMerchEntry> implements ShopMerchEntryService { public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper, ShopMchEntry> implements ShopMchEntryService {
@Resource @Resource
private AccountBaseConfigService accountBaseConfigService; private AccountBaseConfigService accountBaseConfigService;
@ -127,7 +127,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return CommonResult.failed("缺少必要参数!"); 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())) { if (record == null || StrUtil.isBlank(record.getLogin_mobile())) {
log.error("###商家入驻参数转换失败###"); log.error("###商家入驻参数转换失败###");
return CommonResult.failed("参数转换失败,请联系管理员!"); 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) { if (oldRecord == null) {
return CommonResult.failed("未找到入驻记录!"); return CommonResult.failed("未找到入驻记录!");
} }
@ -260,7 +260,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return CommonResult.failed("合同签署进行中(或已签署),不能再次申请!"); return CommonResult.failed("合同签署进行中(或已签署),不能再次申请!");
} }
ShopMerchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMerchEntry.class); ShopMchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMchEntry.class);
if (record == null) { if (record == null) {
log.error("###商家入驻参数转换失败###"); log.error("###商家入驻参数转换失败###");
return CommonResult.failed("参数转换失败,请联系管理员!"); return CommonResult.failed("参数转换失败,请联系管理员!");
@ -338,7 +338,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
// return CommonResult.failed("权限不足!"); // return CommonResult.failed("权限不足!");
// } // }
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
if (StrUtil.isNotBlank(keyword)) { if (StrUtil.isNotBlank(keyword)) {
queryWrapper.like("store_name", keyword); queryWrapper.like("store_name", keyword);
} }
@ -353,7 +353,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
pageSize = 20; pageSize = 20;
} }
Page<ShopMerchEntry> listPage = lists(queryWrapper, pageIndex, pageSize); Page<ShopMchEntry> listPage = lists(queryWrapper, pageIndex, pageSize);
return CommonResult.success(listPage); return CommonResult.success(listPage);
} }
@ -375,7 +375,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return CommonResult.failed("缺少必要参数!"); return CommonResult.failed("缺少必要参数!");
} }
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(recordId)) { if (ObjectUtil.isNotEmpty(recordId)) {
queryWrapper.eq("id", recordId); queryWrapper.eq("id", recordId);
} }
@ -389,12 +389,12 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
queryWrapper.in("approval_status", approvalStatusList); queryWrapper.in("approval_status", approvalStatusList);
} }
queryWrapper.orderByDesc("id"); queryWrapper.orderByDesc("id");
List<ShopMerchEntry> recordList = list(queryWrapper); List<ShopMchEntry> recordList = list(queryWrapper);
if (CollectionUtil.isEmpty(recordList)) { if (CollectionUtil.isEmpty(recordList)) {
return CommonResult.success(null, "暂无申请记录!"); return CommonResult.success(null, "暂无申请记录!");
} }
ShopMerchEntry record = recordList.get(0); ShopMchEntry record = recordList.get(0);
// 试试更新入驻表的合同下载地址和合同签署状态 // 试试更新入驻表的合同下载地址和合同签署状态
updateMerchEntrySignedStatusAndContractDownloadUrl(record); updateMerchEntrySignedStatusAndContractDownloadUrl(record);
@ -407,7 +407,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
* *
* @param record * @param record
*/ */
private void updateMerchEntrySignedStatusAndContractDownloadUrl(ShopMerchEntry record) { private void updateMerchEntrySignedStatusAndContractDownloadUrl(ShopMchEntry record) {
if (record == null) { if (record == null) {
return; return;
} }
@ -459,13 +459,13 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return CommonResult.failed("审批状态有误!"); return CommonResult.failed("审批状态有误!");
} }
ShopMerchEntry record = getById(id); ShopMchEntry record = getById(id);
if (record == null) { if (record == null) {
return CommonResult.failed("未找到入驻记录!"); return CommonResult.failed("未找到入驻记录!");
} }
// TODO 已经审核通过的不能再审核了 // TODO 已经审核通过的不能再审核了
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
if (approvalStatus.equals(CommonConstant.Enable) && StrUtil.isBlank(approvalRemark)) { if (approvalStatus.equals(CommonConstant.Enable) && StrUtil.isBlank(approvalRemark)) {
// 审核通过 // 审核通过
approvalRemark = "审核通过,后续将向您发起签署电子合同流程。"; approvalRemark = "审核通过,后续将向您发起签署电子合同流程。";
@ -524,7 +524,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return Pair.of(false, msg); return Pair.of(false, msg);
} }
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
if (StrUtil.isNotBlank(mobile) && StrUtil.isBlank(bizLicenseNumber)) { if (StrUtil.isNotBlank(mobile) && StrUtil.isBlank(bizLicenseNumber)) {
queryWrapper.eq("login_mobile", mobile); queryWrapper.eq("login_mobile", mobile);
boolean isApplied = count(queryWrapper) > 0; boolean isApplied = count(queryWrapper) > 0;
@ -561,9 +561,9 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return 0; return 0;
} }
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("login_mobile", mobile).select("approval_status").orderByAsc("id"); queryWrapper.eq("login_mobile", mobile).select("approval_status").orderByAsc("id");
List<ShopMerchEntry> recordList = list(queryWrapper); List<ShopMchEntry> recordList = list(queryWrapper);
if (CollectionUtil.isEmpty(recordList)) { if (CollectionUtil.isEmpty(recordList)) {
return 0; return 0;
} }
@ -579,22 +579,22 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
* @return * @return
*/ */
@Override @Override
public ShopMerchEntry shopMerchEntryApprovalInfo(String loginMobile) { public ShopMchEntry shopMerchEntryApprovalInfo(String loginMobile) {
if (StrUtil.isBlank(loginMobile)) { if (StrUtil.isBlank(loginMobile)) {
return null; return null;
} }
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("login_mobile", loginMobile) queryWrapper.eq("login_mobile", loginMobile)
.select("id", "approval_status", "approval_remark", "login_mobile", "approval_invalid_col", "signed_status", "contract_download_url", "store_status") .select("id", "approval_status", "approval_remark", "login_mobile", "approval_invalid_col", "signed_status", "contract_download_url", "store_status")
.orderByAsc("id"); .orderByAsc("id");
List<ShopMerchEntry> recordList = list(queryWrapper); List<ShopMchEntry> recordList = list(queryWrapper);
if (CollectionUtil.isEmpty(recordList)) { if (CollectionUtil.isEmpty(recordList)) {
return null; return null;
} }
ShopMerchEntry record = recordList.get(0); ShopMchEntry record = recordList.get(0);
// 试试更新入驻表的合同下载地址和合同签署状态 // 试试更新入驻表的合同下载地址和合同签署状态
updateMerchEntrySignedStatusAndContractDownloadUrl(record); updateMerchEntrySignedStatusAndContractDownloadUrl(record);
@ -611,12 +611,12 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
* @return * @return
*/ */
@Override @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)) { if (StrUtil.isBlank(loginMobile) && StrUtil.isBlank(bizLicenseNumber) && ObjectUtil.isEmpty(approvalStatus)) {
return null; return null;
} }
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", CommonConstant.Enable).orderByAsc("id"); queryWrapper.eq("status", CommonConstant.Enable).orderByAsc("id");
if (StrUtil.isNotBlank(loginMobile)) { if (StrUtil.isNotBlank(loginMobile)) {
queryWrapper.eq("login_mobile", loginMobile); queryWrapper.eq("login_mobile", loginMobile);
@ -632,7 +632,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
// todo 合同签署状态条件 // todo 合同签署状态条件
List<ShopMerchEntry> recordList = list(queryWrapper); List<ShopMchEntry> recordList = list(queryWrapper);
if (CollectionUtil.isEmpty(recordList)) { if (CollectionUtil.isEmpty(recordList)) {
return null; return null;
} }
@ -654,7 +654,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return null; return null;
} }
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("login_mobile", loginMobile); updateWrapper.eq("login_mobile", loginMobile);
if (ObjectUtil.isNotEmpty(signedStatus)) { if (ObjectUtil.isNotEmpty(signedStatus)) {
@ -681,7 +681,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return false; return false;
} }
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("login_mobile", loginMobile).set("store_status", storeStatus); updateWrapper.eq("login_mobile", loginMobile).set("store_status", storeStatus);
return update(updateWrapper); return update(updateWrapper);
} }
@ -692,7 +692,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return false; return false;
} }
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("login_mobile", loginMobile); updateWrapper.eq("login_mobile", loginMobile);
if (ObjectUtil.isNotEmpty(lklAuditStatus)) { if (ObjectUtil.isNotEmpty(lklAuditStatus)) {
updateWrapper.set("lkl_audit_status", lklAuditStatus); updateWrapper.set("lkl_audit_status", lklAuditStatus);
@ -721,7 +721,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return false; return false;
} }
UpdateWrapper<ShopMerchEntry> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("lkl_mer_cup_no", lklMerCupNo); updateWrapper.eq("lkl_mer_cup_no", lklMerCupNo);
if (ObjectUtil.isNotEmpty(lklAuditStatus)) { if (ObjectUtil.isNotEmpty(lklAuditStatus)) {
updateWrapper.set("lkl_audit_status", lklAuditStatus); updateWrapper.set("lkl_audit_status", lklAuditStatus);
@ -748,7 +748,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
return false; return false;
} }
return update(new UpdateWrapper<ShopMerchEntry>() return update(new UpdateWrapper<ShopMchEntry>()
.eq("id", id) .eq("id", id)
.set("store_id", storeId)); .set("store_id", storeId));
} }

View File

@ -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.distribution.ShopDistributionPlantformUser;
import com.suisung.mall.common.modules.invoicing.InvoicingCustomerLevel; import com.suisung.mall.common.modules.invoicing.InvoicingCustomerLevel;
import com.suisung.mall.common.modules.invoicing.InvoicingWarehouseBase; 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.page.ShopPageBase;
import com.suisung.mall.common.modules.pay.PayUserResource; import com.suisung.mall.common.modules.pay.PayUserResource;
import com.suisung.mall.common.modules.plantform.ShopPlantformSubsite; import com.suisung.mall.common.modules.plantform.ShopPlantformSubsite;
@ -171,7 +170,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
private ShopBaseDistrictService shopBaseDistrictService; private ShopBaseDistrictService shopBaseDistrictService;
@Lazy @Lazy
@Autowired @Autowired
private ShopMerchEntryService shopMerchEntryService; private ShopMchEntryService shopMchEntryService;
@Autowired @Autowired
private ThreadPoolExecutor executor; private ThreadPoolExecutor executor;
@ -3006,13 +3005,13 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
return Pair.of(0, "商家账号异常!"); return Pair.of(0, "商家账号异常!");
} }
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS); ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
if (ObjectUtil.isEmpty(shopMerchEntry)) { if (ObjectUtil.isEmpty(shopMchEntry)) {
logger.error("生成店铺:入驻信息不能为空"); logger.error("生成店铺:入驻信息不能为空");
return Pair.of(0, "入驻信息不能为空"); return Pair.of(0, "入驻信息不能为空");
} }
if (isExistsByStoreName(shopMerchEntry.getStore_name())) { if (isExistsByStoreName(shopMchEntry.getStore_name())) {
logger.error("生成店铺:店铺名称已存在"); logger.error("生成店铺:店铺名称已存在");
return Pair.of(0, "店铺名称已存在"); return Pair.of(0, "店铺名称已存在");
} }
@ -3023,20 +3022,20 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
// shop_store_base // shop_store_base
ShopStoreBase shopStoreBase = new ShopStoreBase(); ShopStoreBase shopStoreBase = new ShopStoreBase();
shopStoreBase.setUser_id(userId); // 店铺管理员用户Id shopStoreBase.setUser_id(userId); // 店铺管理员用户Id
shopStoreBase.setStore_name(shopMerchEntry.getStore_name()); shopStoreBase.setStore_name(shopMchEntry.getStore_name());
shopStoreBase.setStore_category_id(shopMerchEntry.getBiz_category()); // 重要店铺分类id对应 shop_base_store_category 表的分类 shopStoreBase.setStore_category_id(shopMchEntry.getBiz_category()); // 重要店铺分类id对应 shop_base_store_category 表的分类
shopStoreBase.setSplit_ratio(shopMerchEntry.getSplit_ratio()); // 分账比例 shopStoreBase.setSplit_ratio(shopMchEntry.getSplit_ratio()); // 分账比例
String storeFacadeImage = shopMerchEntry.getFront_facade_image(); String storeFacadeImage = shopMchEntry.getFront_facade_image();
shopStoreBase.setStore_logo(storeFacadeImage); // 临时使用门面照片做logo 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_district_id(shopBaseDistrictService.joinDistrict(districtList, 1, true, "/"));
shopStoreBase.setStore_area(shopBaseDistrictService.joinDistrict(districtList, 2, true, "/")); shopStoreBase.setStore_area(shopBaseDistrictService.joinDistrict(districtList, 2, true, "/"));
shopStoreBase.setStore_address(shopMerchEntry.getStore_address()); shopStoreBase.setStore_address(shopMchEntry.getStore_address());
shopStoreBase.setStore_longitude(shopMerchEntry.getStore_longitude()); shopStoreBase.setStore_longitude(shopMchEntry.getStore_longitude());
shopStoreBase.setStore_latitude(shopMerchEntry.getStore_latitude()); shopStoreBase.setStore_latitude(shopMchEntry.getStore_latitude());
shopStoreBase.setStore_grade_id(1001); // 店铺等级默认为普通店铺 shopStoreBase.setStore_grade_id(1001); // 店铺等级默认为普通店铺
shopStoreBase.setStore_type(1);//店铺类型(ENUM): 1-卖家店铺; 2-供应商店铺 shopStoreBase.setStore_type(1);//店铺类型(ENUM): 1-卖家店铺; 2-供应商店铺
shopStoreBase.setStore_is_open(1); shopStoreBase.setStore_is_open(1);
@ -3062,7 +3061,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
shopStoreInfo.setStore_opening_hours("08:00"); shopStoreInfo.setStore_opening_hours("08:00");
shopStoreInfo.setStore_close_hours("22:00"); shopStoreInfo.setStore_close_hours("22:00");
shopStoreInfo.setStore_discount(BigDecimal.valueOf(10));// 原价 shopStoreInfo.setStore_discount(BigDecimal.valueOf(10));// 原价
shopStoreInfo.setStore_tel(shopMerchEntry.getLogin_mobile()); shopStoreInfo.setStore_tel(shopMchEntry.getLogin_mobile());
shopStoreInfo.setStore_banner(storeFacadeImage); shopStoreInfo.setStore_banner(storeFacadeImage);
JSONArray list = new JSONArray(); JSONArray list = new JSONArray();
@ -3074,16 +3073,16 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
slide.put("url", "https://www.gpsxcs.cn"); slide.put("url", "https://www.gpsxcs.cn");
list.put(slide); list.put(slide);
} }
if (StrUtil.isNotBlank(shopMerchEntry.getEnvironment_image())) { if (StrUtil.isNotBlank(shopMchEntry.getEnvironment_image())) {
JSONObject slide = new JSONObject(); JSONObject slide = new JSONObject();
slide.put("img", shopMerchEntry.getEnvironment_image()); slide.put("img", shopMchEntry.getEnvironment_image());
slide.put("name", "店铺环境照片"); slide.put("name", "店铺环境照片");
slide.put("check", true); slide.put("check", true);
slide.put("url", "https://www.gpsxcs.cn"); slide.put("url", "https://www.gpsxcs.cn");
list.put(slide); list.put(slide);
} }
shopStoreInfo.setStore_slide(list.toString()); 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); shopStoreInfo.setStore_state_id(StateCode.STORE_STATE_YES);
if (!shopStoreInfoService.save(shopStoreInfo)) { if (!shopStoreInfoService.save(shopStoreInfo)) {
logger.error("生成店铺新增店铺info失败"); logger.error("生成店铺新增店铺info失败");
@ -3097,28 +3096,28 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
shopStoreCompany.setStore_id(storeId); shopStoreCompany.setStore_id(storeId);
// 联系人 // 联系人
shopStoreCompany.setContacts_name(shopMerchEntry.getContact_name()); shopStoreCompany.setContacts_name(shopMchEntry.getContact_name());
shopStoreCompany.setContacts_phone(shopMerchEntry.getLogin_mobile()); 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_name(companyName);
shopStoreCompany.setCompany_area(shopStoreBase.getStore_area()); 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_id(shopMchEntry.getBiz_license_number());
shopStoreCompany.setBusiness_license_electronic(shopMerchEntry.getBiz_license_image()); shopStoreCompany.setBusiness_license_electronic(shopMchEntry.getBiz_license_image());
// 企业法人 // 企业法人
shopStoreCompany.setLegal_person(shopMerchEntry.getLegal_person_name()); shopStoreCompany.setLegal_person(shopMchEntry.getLegal_person_name());
shopStoreCompany.setLegal_person_number(shopMerchEntry.getLegal_person_id_number()); shopStoreCompany.setLegal_person_number(shopMchEntry.getLegal_person_id_number());
shopStoreCompany.setLegal_person_electronic(shopMerchEntry.getLegal_person_id_images()); shopStoreCompany.setLegal_person_electronic(shopMchEntry.getLegal_person_id_images());
// 银行对公账号 // 银行对公账号
shopStoreCompany.setBank_account_name(shopMerchEntry.getAccount_holder_name()); shopStoreCompany.setBank_account_name(shopMchEntry.getAccount_holder_name());
shopStoreCompany.setBank_account_number(shopMerchEntry.getAccount_number()); shopStoreCompany.setBank_account_number(shopMchEntry.getAccount_number());
shopStoreCompany.setBank_name(shopMerchEntry.getBank_name()); shopStoreCompany.setBank_name(shopMchEntry.getBank_name());
Date today = new Date(); // 当前时间 Date today = new Date(); // 当前时间
shopStoreCompany.setOrganization_code_start(today); shopStoreCompany.setOrganization_code_start(today);
@ -3127,7 +3126,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
shopStoreCompany.setBusiness_licence_start(today); shopStoreCompany.setBusiness_licence_start(today);
shopStoreCompany.setBusiness_licence_end(DateUtil.offsetDay(today, 365 * 10)); 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_ids("");
shopStoreCompany.setStore_class_names(""); shopStoreCompany.setStore_class_names("");
shopStoreCompany.setStore_class_commission(""); shopStoreCompany.setStore_class_commission("");
@ -3162,7 +3161,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
initStoreExtraInfo(userId, storeId); initStoreExtraInfo(userId, storeId);
// 更改店铺Id // 更改店铺Id
shopMerchEntryService.updateMerchEntryStoreId(shopMerchEntry.getId(), storeId); shopMchEntryService.updateMerchEntryStoreId(shopMchEntry.getId(), storeId);
return Pair.of(storeId, "新增成功"); return Pair.of(storeId, "新增成功");
} catch (Exception e) { } catch (Exception e) {

View File

@ -1,6 +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.store.mapper.ShopMerchEntryMapper"> <mapper namespace="com.suisung.mall.shop.store.mapper.ShopMchEntryMapper">
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
* *