修正合同签名bug
This commit is contained in:
parent
cec5020eb2
commit
fd932d61f5
@ -162,7 +162,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
// 解析获取user 信息
|
||||
Map data = (Map) restResult.getData();
|
||||
String token = (String) data.get("token");
|
||||
JWSObject jwsObject = null;
|
||||
JWSObject jwsObject;
|
||||
String JWSObjectPayload = "";
|
||||
try {
|
||||
jwsObject = JWSObject.parse(token);
|
||||
|
||||
@ -24,12 +24,17 @@ public class UserDto {
|
||||
private String client_id; // 客户端 :后台管理-admin-app,移动端-mobile-app,入驻商家移动端-mch-app
|
||||
private String user_salt;
|
||||
private List<String> roles;
|
||||
// 服务端返回rid 角色编号 0-用户;2-商家;3-门店;9-平台;
|
||||
// 服务端返回rid 角色编号: 0-用户;2-商家;3-门店;9-平台;
|
||||
private Integer role_id;
|
||||
private Integer site_id = 0; //分站编号
|
||||
private String store_id;
|
||||
private String chain_id;
|
||||
|
||||
/**
|
||||
* 用户角色是平台
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPlatform() {
|
||||
return this.role_id != null && this.role_id == 9;
|
||||
}
|
||||
@ -38,18 +43,38 @@ public class UserDto {
|
||||
return this.role_id != null && this.role_id == 9 && this.site_id > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户有店铺的
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isStore() {
|
||||
return StrUtil.isNotBlank(this.store_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isChain() {
|
||||
return StrUtil.isNotBlank(this.chain_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理端
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isAdmin() {
|
||||
return ObjectUtil.equal(client_id, AuthConstant.ADMIN_CLIENT_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机端
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isMobile() {
|
||||
return ObjectUtil.equal(client_id, AuthConstant.MOBILE_CLIENT_ID);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ public class EsignController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "测试填充模版控件", notes = "测试填充模版控件")
|
||||
@RequestMapping(value = "/testcase", method = RequestMethod.POST)
|
||||
public Object testCase() {
|
||||
return esignContractFillingFileService.fillDocTemplate("91450881MA5P8MWX69", "91450881MADEQ92533");
|
||||
return esignContractFillingFileService.fillDocTemplate("13128997057", "91450881MADEQ92533");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "管理员发起签署电子合同流程", notes = "基于文件发起签署电子合同")
|
||||
|
||||
@ -18,11 +18,11 @@ public interface EsignContractFillingFileService {
|
||||
/**
|
||||
* 填充合同模版,生成合同文件地址
|
||||
*
|
||||
* @param mchLicenseNumber 入驻商家的营业执照号
|
||||
* @param mchMobile 入驻商家注册手机号
|
||||
* @param platLicenseNumber 平台方(代理商方)营业执照号
|
||||
* @return
|
||||
*/
|
||||
Boolean fillDocTemplate(String mchLicenseNumber, String platLicenseNumber);
|
||||
Boolean fillDocTemplate(String mchMobile, String platLicenseNumber);
|
||||
|
||||
/**
|
||||
* 获取模版的甲方与乙方印章XY位置数据
|
||||
|
||||
@ -83,18 +83,18 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
private OssService ossService;
|
||||
|
||||
/**
|
||||
* 根据双方营业执照号码填充合同模版,生成合同文件地址
|
||||
* 根据双方营业执照号码(或个人身份证)填充合同模版,生成合同文件地址
|
||||
* <p>
|
||||
* 后台管理员审核商家通过之后,触发调用这个方法,生成未签署合同文件,预备签署
|
||||
*
|
||||
* @param mchLicenseNumber 入驻商家(甲方)的营业执照号
|
||||
* @param mchMobile 入驻商家(甲方)的注册手机号
|
||||
* @param platLicenseNumber 平台方(代理商方)(乙方)营业执照号
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean fillDocTemplate(String mchLicenseNumber, String platLicenseNumber) {
|
||||
if (StrUtil.isEmpty(mchLicenseNumber)) {
|
||||
log.error("商家营业执照号为空");
|
||||
public Boolean fillDocTemplate(String mchMobile, String platLicenseNumber) {
|
||||
if (StrUtil.isEmpty(mchMobile)) {
|
||||
log.error("商家手机号为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
}
|
||||
|
||||
// 获取入驻商家(审批通过的)的信息
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByLicenseNumber("", mchLicenseNumber, CommonConstant.MCH_APPR_STA_PASS);
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (shopMerchEntry == null) {
|
||||
log.error("缺少商家入驻信息");
|
||||
return null;
|
||||
@ -129,7 +129,7 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
String mchCompany = shopMerchEntry.getBiz_license_company();
|
||||
String platCompany = esignPlatformInfo.getLicense_company();
|
||||
String legalPersonName = shopMerchEntry.getLegal_person_name();
|
||||
String mchMobile = shopMerchEntry.getLogin_mobile();
|
||||
// String mchMobile = shopMerchEntry.getLogin_mobile();
|
||||
|
||||
String contractNumber = StringUtils.genLklOrderNo(4);
|
||||
|
||||
@ -356,8 +356,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 cosFileName = TENGXUN_DEFAULT_DIR.concat("/").concat("contract")
|
||||
.concat("/").concat(mchLicenseNumber).concat("/")
|
||||
.concat("/").concat(shopMerchEntry.getLogin_mobile()).concat("/")
|
||||
.concat(jsonObject.getStr("fileId")).concat(".pdf");
|
||||
// 上传到cos服务器
|
||||
String localFileUrl = ossService.uploadObject4OSS(esignContractFillingFile.getUnsigned_contract_url(), cosFileName);
|
||||
@ -366,7 +367,7 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
|
||||
esignContractFillingFile.setDoc_template_id(templateId);
|
||||
esignContractFillingFile.setContract_number(contractNumber + seq);
|
||||
esignContractFillingFile.setContract_name(fileName);
|
||||
esignContractFillingFile.setContract_name("商户入驻小发同城平台合同协议");
|
||||
esignContractFillingFile.setStore_id(contractNumber);
|
||||
esignContractFillingFile.setMobile(mchMobile);
|
||||
esignContractFillingFile.setDoc_template_filling_values(jsonParma);
|
||||
|
||||
@ -287,7 +287,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 200).put("msg", "success").toString(), HttpStatus.OK);
|
||||
}
|
||||
} else if (action.equals("SIGN_MISSON_COMPLETE") && ObjectUtil.isNotEmpty(signResult)) {// 签署方-签署结果(含拒签)通知
|
||||
Integer signFlowStatus = 1;
|
||||
Integer signFlowStatus = null;
|
||||
if (signResult.equals(2)) {
|
||||
signFlowStatus = CommonConstant.CONTRACT_SIGN_STA_PARTIALLY;
|
||||
} else if (signResult.equals(4)) {
|
||||
@ -380,7 +380,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
// REMARK 把合同文件 url 上传到cos服务器
|
||||
String cosFileName = TENGXUN_DEFAULT_DIR.concat("/").concat("contract")
|
||||
.concat("/")
|
||||
.concat(esignContract.getMch_biz_license()).concat("/")
|
||||
.concat(esignContract.getMch_mobile()).concat("/")
|
||||
.concat("signed").concat("/")
|
||||
.concat(esignContract.getContract_file_id()).concat(".pdf");
|
||||
// 上传到cos服务器
|
||||
@ -428,7 +428,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
// REMARK 把合同文件 url 上传到cos服务器
|
||||
String cosFileName = TENGXUN_DEFAULT_DIR.concat("/").concat("contract")
|
||||
.concat("/")
|
||||
.concat(esignContract.getMch_biz_license()).concat("/")
|
||||
.concat(esignContract.getMch_mobile()).concat("/")
|
||||
.concat("signed").concat("/")
|
||||
.concat(esignContract.getContract_file_id()).concat(".pdf");
|
||||
// 上传到cos服务器
|
||||
@ -464,7 +464,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
// REMARK 把合同文件 url 上传到cos服务器
|
||||
String cosFileName = TENGXUN_DEFAULT_DIR.concat("/").concat("contract")
|
||||
.concat("/")
|
||||
.concat(esignContract.getMch_biz_license()).concat("/")
|
||||
.concat(esignContract.getMch_mobile()).concat("/")
|
||||
.concat("signed").concat("/")
|
||||
.concat(esignContract.getContract_file_id()).concat(".pdf");
|
||||
// 上传到cos服务器
|
||||
@ -508,7 +508,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
}
|
||||
|
||||
// 获取商家审核通过的入驻信息
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByLicenseNumber(esignContractFillingFile.getMobile(), "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(esignContractFillingFile.getMobile(), "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (shopMerchEntry == null) {
|
||||
return false;
|
||||
}
|
||||
@ -680,7 +680,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
}
|
||||
|
||||
/**
|
||||
* (重要)组织生成签署合同的请求参数。
|
||||
* (重要)组织生成签署合同的所有请求参数。
|
||||
*
|
||||
* @param shopMerchEntry
|
||||
* @param esignPlatformInfo
|
||||
@ -740,20 +740,20 @@ 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)) {
|
||||
// 企业
|
||||
platSigner.put("signerType", 1);
|
||||
platSigner.putByPath("orgSignerInfo.orgName", esignPlatformInfo.getLicense_company());
|
||||
platSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", esignPlatformInfo.getLicense_number());
|
||||
platSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardType", "CRED_ORG_USCC");
|
||||
platSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", esignPlatformInfo.getLegal_person_mobile());
|
||||
platSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", esignPlatformInfo.getLegal_person_name());
|
||||
} else {
|
||||
// 个人
|
||||
platSigner.put("signerType", 0);
|
||||
platSigner.putByPath("psnSignerInfo.psnAccount", esignPlatformInfo.getLegal_person_mobile());
|
||||
platSigner.putByPath("psnSignerInfo.psnInfo.psnName", esignPlatformInfo.getLegal_person_name());
|
||||
}
|
||||
//if (shopMerchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
// 企业(平台方只能企业)
|
||||
platSigner.put("signerType", 1);
|
||||
platSigner.putByPath("orgSignerInfo.orgName", esignPlatformInfo.getLicense_company());
|
||||
platSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", esignPlatformInfo.getLicense_number());
|
||||
platSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardType", "CRED_ORG_USCC");
|
||||
platSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", esignPlatformInfo.getLegal_person_mobile());
|
||||
platSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", esignPlatformInfo.getLegal_person_name());
|
||||
// } else {
|
||||
// // 个人
|
||||
// platSigner.put("signerType", 0);
|
||||
// platSigner.putByPath("psnSignerInfo.psnAccount", esignPlatformInfo.getLegal_person_mobile());
|
||||
// platSigner.putByPath("psnSignerInfo.psnInfo.psnName", esignPlatformInfo.getLegal_person_name());
|
||||
// }
|
||||
// 加入乙方平台方信息
|
||||
signers.add(platSigner);
|
||||
|
||||
@ -763,20 +763,20 @@ 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)) {
|
||||
// 企业
|
||||
distrSigner.put("signerType", 1);
|
||||
distrSigner.putByPath("orgSignerInfo.orgName", distributor.getLicense_company());
|
||||
distrSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", distributor.getLicense_number());
|
||||
distrSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardType", "CRED_ORG_USCC");
|
||||
distrSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", distributor.getLegal_person_mobile());
|
||||
distrSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", distributor.getLegal_person_name());
|
||||
} else {
|
||||
// 个人
|
||||
distrSigner.put("signerType", 0);
|
||||
distrSigner.putByPath("psnSignerInfo.psnAccount", distributor.getLegal_person_mobile());
|
||||
distrSigner.putByPath("psnSignerInfo.psnInfo.psnName", distributor.getLegal_person_name());
|
||||
}
|
||||
//if (shopMerchEntry.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_QY)) {
|
||||
// 企业(代理商只能企业)
|
||||
distrSigner.put("signerType", 1);
|
||||
distrSigner.putByPath("orgSignerInfo.orgName", distributor.getLicense_company());
|
||||
distrSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardNum", distributor.getLicense_number());
|
||||
distrSigner.putByPath("orgSignerInfo.orgInfo.orgIDCardType", "CRED_ORG_USCC");
|
||||
distrSigner.putByPath("orgSignerInfo.transactorInfo.psnAccount", distributor.getLegal_person_mobile());
|
||||
distrSigner.putByPath("orgSignerInfo.transactorInfo.psnInfo.psnName", distributor.getLegal_person_name());
|
||||
// } else {
|
||||
// // 个人
|
||||
// distrSigner.put("signerType", 0);
|
||||
// distrSigner.putByPath("psnSignerInfo.psnAccount", distributor.getLegal_person_mobile());
|
||||
// distrSigner.putByPath("psnSignerInfo.psnInfo.psnName", distributor.getLegal_person_name());
|
||||
// }
|
||||
// 加入代理商信息
|
||||
signers.add(distrSigner);
|
||||
}
|
||||
|
||||
@ -133,21 +133,26 @@ public class ShopStoreBaseController extends BaseControllerImpl {
|
||||
return CommonResult.success(shopStoreBaseService.getBase(store_id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "插入店铺基础信息", notes = "插入店铺基础信息")
|
||||
@ApiOperation(value = "新增店铺基础信息", notes = "新增店铺基础信息")
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.POST)
|
||||
public CommonResult edit(ShopStoreBase shopStoreBase,
|
||||
@RequestParam(name = "user_account") String user_account,
|
||||
@RequestParam(name = "user_password") String user_password) {
|
||||
|
||||
Integer store_id = shopStoreBase.getStore_id();
|
||||
// 店铺地区
|
||||
String store_district_id = shopStoreBase.getStore_district_id();
|
||||
if (store_id == null && store_district_id == null) {
|
||||
shopStoreBase.setStore_district_id("");
|
||||
}
|
||||
|
||||
UserDto user = getCurrentUser();
|
||||
if (user.isSubsite()) {
|
||||
shopStoreBase.setSubsite_id(user.getSite_id());
|
||||
}
|
||||
|
||||
return shopStoreBaseService.saveOrUpdateBase(shopStoreBase, user_account, user_password);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改店铺基础信息", notes = "修改店铺基础信息")
|
||||
|
||||
@ -41,7 +41,7 @@ public class ShopMerchEntryController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "测试", notes = "测试")
|
||||
@RequestMapping(value = "/gencon", method = RequestMethod.POST)
|
||||
public Object fillDocTemplate() {
|
||||
return esignContractFillingFileService.fillDocTemplate("yyzz787654566543", "91450881MADEQ92533");
|
||||
return esignContractFillingFileService.fillDocTemplate("13128997057", "91450881MADEQ92533");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "店铺主营分类(类目)", notes = "店铺主营分类(类目)")
|
||||
|
||||
@ -106,7 +106,7 @@ public interface ShopMerchEntryService {
|
||||
* @param approvalStatus
|
||||
* @return
|
||||
*/
|
||||
ShopMerchEntry getShopMerchEntryByLicenseNumber(String loginMobile, String bizLicenseNumber, Integer approvalStatus);
|
||||
ShopMerchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus);
|
||||
|
||||
/**
|
||||
* 根据商家注册的手机号,更新合同签署状态和合同下载地址
|
||||
@ -117,4 +117,6 @@ public interface ShopMerchEntryService {
|
||||
* @return
|
||||
*/
|
||||
Boolean updateMerchEntrySignedStatusAndContractDownloadUrl(String loginMobile, Integer signedStatus, String contractDownloadUrl);
|
||||
|
||||
|
||||
}
|
||||
@ -2,7 +2,6 @@ package com.suisung.mall.shop.store.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
||||
import com.suisung.mall.common.modules.base.ShopBaseStoreCategory;
|
||||
@ -10,7 +9,6 @@ import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreCompany;
|
||||
import com.suisung.mall.common.pojo.dto.StandardAddressDTO;
|
||||
import com.suisung.mall.core.web.service.IBaseService;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.springframework.data.util.Pair;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -114,6 +112,7 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
||||
|
||||
/**
|
||||
* 搜索附近店铺,排序:从近到远 2024-12-26
|
||||
*
|
||||
* @param provinceId
|
||||
* @param cityId
|
||||
* @param countyId
|
||||
@ -126,12 +125,22 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<Map> getNearShop2(String provinceId,String cityId, String countyId, String userLng,String userLat, Integer categoryId,Integer subsiteId, String storeName, Integer pageNum, Integer pageSize);
|
||||
IPage<Map> getNearShop2(String provinceId, String cityId, String countyId, String userLng, String userLat, Integer categoryId, Integer subsiteId, String storeName, Integer pageNum, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 获取店铺的拉卡拉商户号和终端号(仅仅两个字段)
|
||||
*
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
ShopStoreBase getLklMerchantNoAndTermNo(Integer storeId);
|
||||
|
||||
|
||||
/**
|
||||
* (重要)入驻审批通过并且合同盖章完结之后,把商家入驻信息转换成店铺信息,正式生成店铺所需的数据
|
||||
*
|
||||
* @param mchMobile
|
||||
* @return 店铺Id
|
||||
*/
|
||||
Integer merchEntryInfo2StoreInfo(String mchMobile);
|
||||
}
|
||||
|
||||
@ -43,6 +43,9 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商家入驻申请表
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMapper, ShopMerchEntry> implements ShopMerchEntryService {
|
||||
@ -235,8 +238,8 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return CommonResult.failed("未找到入驻记录!");
|
||||
}
|
||||
|
||||
if (oldRecord.getSigned_status() >= 0) {
|
||||
return CommonResult.failed("已经签署合同,不能再次申请!");
|
||||
if (oldRecord.getSigned_status() > 0) {
|
||||
return CommonResult.failed("合同签署进行中(或已签署),不能再次申请!");
|
||||
}
|
||||
|
||||
ShopMerchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMerchEntry.class);
|
||||
@ -450,7 +453,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
taskService.executeTask(() -> {
|
||||
log.debug("###开始异步执行生成电子合同模版和填充模版数据,并生该商家和平台方签署的未盖章合同文件###");
|
||||
// 生成电子合同模版和填充模版数据,并生该商家和平台方签署的未盖章合同文件
|
||||
Boolean genSuccess = esignContractFillingFileService.fillDocTemplate(record.getBiz_license_number(), "");
|
||||
Boolean genSuccess = esignContractFillingFileService.fillDocTemplate(record.getLogin_mobile(), "");
|
||||
if (!genSuccess) {
|
||||
log.error("###商家入驻电子合同生成失败###");
|
||||
}
|
||||
@ -559,7 +562,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ShopMerchEntry getShopMerchEntryByLicenseNumber(String loginMobile, String bizLicenseNumber, Integer approvalStatus) {
|
||||
public ShopMerchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer approvalStatus) {
|
||||
if (StrUtil.isBlank(loginMobile) && StrUtil.isBlank(bizLicenseNumber) && ObjectUtil.isEmpty(approvalStatus)) {
|
||||
return null;
|
||||
}
|
||||
@ -578,6 +581,8 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
queryWrapper.eq("approval_status", approvalStatus);
|
||||
}
|
||||
|
||||
// todo 合同签署状态条件
|
||||
|
||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return null;
|
||||
|
||||
@ -36,6 +36,7 @@ import com.suisung.mall.common.modules.base.ShopPageModule;
|
||||
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;
|
||||
@ -70,6 +71,7 @@ import io.seata.spring.annotation.GlobalTransactional;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.util.Pair;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -167,6 +169,9 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
private ShopPageBaseService shopPageBaseService;
|
||||
@Autowired
|
||||
private ShopPageModuleService shopPageModuleService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopMerchEntryService shopMerchEntryService;
|
||||
@Autowired
|
||||
private ThreadPoolExecutor executor;
|
||||
|
||||
@ -1581,24 +1586,29 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
@Override
|
||||
public CommonResult saveOrUpdateBase(ShopStoreBase shopStoreBase, String user_account, String user_password) {
|
||||
shopStoreBase.setStore_end_time(Convert.toLong(DateUtil.offsetMonth(new Date(), 12)));
|
||||
AccountUserBase user_row = new AccountUserBase();
|
||||
if (getCurrentUser().isPlatform()) {
|
||||
AccountUserBase user_row;
|
||||
if (getCurrentUser().isPlatform()) { // 平台管理员
|
||||
if (StrUtil.isBlank(user_password)) {
|
||||
// 密码为空的情况
|
||||
CommonResult result = accountService.findUserBaseUserAccount(user_account);
|
||||
user_row = result.getFenResult(AccountUserBase.class);
|
||||
if (user_row == null) {
|
||||
throw new ApiException(I18nUtil._("用户不存在,密码必须填写,创建新用户!"));
|
||||
}
|
||||
} else {
|
||||
// 账号和密码都不为空,立即注册新店铺管理员账户
|
||||
Map userInfo = new HashMap();
|
||||
userInfo.put("user_account", user_account);
|
||||
userInfo.put("user_password", user_password);
|
||||
// 账号和密码,直接注册账号
|
||||
CommonResult result = accountService.register(userInfo);
|
||||
user_row = result.getFenResult(AccountUserBase.class);
|
||||
if (ObjectUtil.isEmpty(user_row)) {
|
||||
throw new ApiException(I18nUtil._("新建管理员账户失败!"));
|
||||
}
|
||||
}
|
||||
|
||||
// 给店铺指定管理员Id
|
||||
shopStoreBase.setUser_id(user_row.getUser_id());
|
||||
Integer subsite_id = Convert.toInt(getParameter("subsite_id"));
|
||||
if (ObjectUtil.isNotNull(subsite_id)) {
|
||||
@ -2449,8 +2459,16 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存店铺多个相关的信息
|
||||
*
|
||||
* @param base
|
||||
* @param info
|
||||
* @param userInfo
|
||||
* @param company
|
||||
* @return
|
||||
*/
|
||||
public boolean saveInfo(ShopStoreBase base, ShopStoreInfo info, AccountUserBase userInfo, ShopStoreCompany company) {
|
||||
|
||||
/*start根据需求新增编辑店铺介绍*/
|
||||
if (company != null && StrUtil.isNotBlank(company.getCompany_description())) {
|
||||
QueryWrapper<ShopStoreCompany> companyQueryWrapper = new QueryWrapper<>();
|
||||
@ -2460,18 +2478,17 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
}
|
||||
}
|
||||
|
||||
if (userInfo != null) {
|
||||
if (userInfo != null && ObjectUtil.isNotNull(userInfo.getUser_id())) {
|
||||
Integer userId = userInfo.getUser_id();
|
||||
if (userId != null) {
|
||||
AccountUserBase user_base_row = accountService.getUserBase(userId);
|
||||
if (user_base_row == null) {
|
||||
throw new ApiException(I18nUtil._("店铺管理员ID错误!"));
|
||||
}
|
||||
AccountUserBase user_base_row = accountService.getUserBase(userId);
|
||||
if (user_base_row == null) {
|
||||
throw new ApiException(I18nUtil._("店铺管理员ID错误!"));
|
||||
}
|
||||
|
||||
String store_admin_password = userInfo.getUser_password();
|
||||
if (StrUtil.isNotBlank(store_admin_password)) {
|
||||
accountService.editPassword(userId, store_admin_password.trim()).checkFenResult();
|
||||
}
|
||||
// 店铺管理员密码更新
|
||||
String store_admin_password = userInfo.getUser_password();
|
||||
if (StrUtil.isNotBlank(store_admin_password)) {
|
||||
accountService.editPassword(userId, store_admin_password.trim()).checkFenResult();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2581,6 +2598,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2933,6 +2951,34 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
return shopStoreBase;
|
||||
}
|
||||
|
||||
/**
|
||||
* (重要)入驻审批通过并且合同盖章完结之后,把商家入驻信息转换成店铺信息,正式生成店铺所需的数据
|
||||
*
|
||||
* @param mchMobile
|
||||
* @return 店铺Id
|
||||
*/
|
||||
@Override
|
||||
public Integer merchEntryInfo2StoreInfo(String mchMobile) {
|
||||
if (StrUtil.isBlank(mchMobile)) {
|
||||
logger.error("生成店铺:商家注册手机号为空");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 获取商家注册账号信息
|
||||
|
||||
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (ObjectUtil.isEmpty(shopMerchEntry)) {
|
||||
logger.error("生成店铺:商家入驻信息为空");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 新增 shop_store_base,shop_store_info,shop_store_employee 待补充
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 store_slide 字段
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user