e签宝发起签署流程,多个方法调整
This commit is contained in:
parent
d6245f8843
commit
896bdd2e26
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.global;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("global_branch_banks")
|
||||
@ApiModel(value = "GlobalBranchBanks 公共中国银行(支行)实体", description = "GlobalBranchBanks 公共中国银行(支行)实体")
|
||||
public class GlobalBranchBanks implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "编号")
|
||||
private String bank_code;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String bank_name;
|
||||
|
||||
@ApiModelProperty(value = "父编号")
|
||||
private String parent_bank_code;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer seq;
|
||||
|
||||
@ApiModelProperty(value = "创立时间")
|
||||
private String est_date;
|
||||
|
||||
@ApiModelProperty(value = "简介")
|
||||
private String intro;
|
||||
|
||||
@ApiModelProperty(value = "状态:1-有效;2-无效;")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date created_at;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updated_at;
|
||||
}
|
||||
@ -63,7 +63,7 @@ secure:
|
||||
- "/**/*.png"
|
||||
- "/**/*.ico"
|
||||
- "/webjars/springfox-swagger-ui/**"
|
||||
# - "/actuator/**"
|
||||
# - "/actuator/**"
|
||||
- "/mall-auth/oauth/token"
|
||||
- "/mall-auth/rsa/publicKey"
|
||||
- "/admin/account/account-user-base/register"
|
||||
@ -91,6 +91,7 @@ secure:
|
||||
- "/esProduct/**"
|
||||
- "/admin/oss/upload/**"
|
||||
- "/mobile/**/**/test/case"
|
||||
- "/admin/shop/esign/async/notify" #E签宝电子签章异步回调
|
||||
universal:
|
||||
urls:
|
||||
- "/admin/account/account-user-base/info"
|
||||
|
||||
@ -16,7 +16,6 @@ import com.suisung.mall.shop.esign.service.EsignContractService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -24,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@Api(tags = "E签宝电子签控制器")
|
||||
@RestController
|
||||
@ -42,15 +42,21 @@ public class EsignController extends BaseControllerImpl {
|
||||
return esignContractFillingFileService.fillDocTemplate("91450881MA5P8MWX69", "91450881MADEQ92533");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "基于文件发起签署电子合同", notes = "基于文件发起签署电子合同")
|
||||
@ApiOperation(value = "管理员发起签署电子合同流程", notes = "基于文件发起签署电子合同")
|
||||
@RequestMapping(value = "/sign-flow/create-by-file", method = RequestMethod.POST)
|
||||
public CommonResult signFlowCreateByFile(@RequestBody JSONObject paramsJSON) {
|
||||
return esignContractService.signFlowCreateByFile(paramsJSON.getStr("mchMobile"));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "基于文件发起签署电子合同", notes = "基于文件发起签署电子合同")
|
||||
@ApiOperation(value = "签署电子合同流程通知接收", notes = "签署电子合同流程通知接收")
|
||||
@RequestMapping(value = "/async/notify", method = RequestMethod.POST)
|
||||
public ResponseEntity<String> signAsyncNotify(HttpServletRequest request, ServerHttpResponse response, @RequestBody String requestBody) {
|
||||
public ResponseEntity<String> signAsyncNotify(HttpServletRequest request, HttpServletResponse response, @RequestBody String requestBody) {
|
||||
return esignContractService.signAsyncNotify(request, response, requestBody);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看已签署的电子合同文件", notes = "管理员查看已签署的电子合同文件")
|
||||
@RequestMapping(value = "/signed/contract/file", method = RequestMethod.POST)
|
||||
public CommonResult getSignedContactFile(@RequestBody JSONObject paramsJSON) {
|
||||
return esignContractService.getSignedContactFile(paramsJSON.getStr("mchMobile"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,9 +11,9 @@ package com.suisung.mall.shop.esign.service;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.esign.EsignContract;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public interface EsignContractService {
|
||||
|
||||
@ -26,11 +26,19 @@ public interface EsignContractService {
|
||||
CommonResult signFlowCreateByFile(String mchMobile);
|
||||
|
||||
/**
|
||||
* 签署流程结束通知
|
||||
* 签署流程结束异步通知(由e签宝通知)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ResponseEntity<String> signAsyncNotify(HttpServletRequest request, ServerHttpResponse response, String requestBody);
|
||||
ResponseEntity<String> signAsyncNotify(HttpServletRequest request, HttpServletResponse response, String requestBody);
|
||||
|
||||
/**
|
||||
* 管理员查看已签署的电子合同文件
|
||||
*
|
||||
* @param mchMobile
|
||||
* @return
|
||||
*/
|
||||
CommonResult getSignedContactFile(String mchMobile);
|
||||
|
||||
/**
|
||||
* 更新合同流程ID和文件地址和状态
|
||||
|
||||
@ -38,16 +38,17 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -84,9 +85,6 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
@Resource
|
||||
private EsignPlatformInfoService esignPlatformInfoService;
|
||||
|
||||
// @Resource
|
||||
// private EsignContractService esignContractService;
|
||||
|
||||
@Resource
|
||||
private OssService ossService;
|
||||
|
||||
@ -150,6 +148,14 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
*/
|
||||
@Override
|
||||
public CommonResult signFlowCreateByFile(String mchMobile) {
|
||||
String userId = "0";
|
||||
|
||||
// UserDto user = getCurrentUser();
|
||||
// if (!user.isAdmin()) {
|
||||
// return CommonResult.failed("权限不足!");
|
||||
// }
|
||||
// userId = user.getId().toString();
|
||||
|
||||
if (StrUtil.isBlank(mchMobile)) {
|
||||
return CommonResult.failed("缺少必要参数!");
|
||||
}
|
||||
@ -159,6 +165,13 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
return CommonResult.failed("未找到商家合同信息");
|
||||
}
|
||||
|
||||
// 检查商户入驻信息是否被审核通过
|
||||
// 检查店铺是否已经申请过入驻
|
||||
Integer apprStatus = shopMerchEntryService.getApprovalStatus(mchMobile);
|
||||
if (!CommonConstant.MCH_APPR_STA_PASS.equals(apprStatus)) {
|
||||
return CommonResult.failed("请先审核商家入驻信息");
|
||||
}
|
||||
|
||||
//"{\"docs\":[{\"fileId\":\"ab30d2c5600441f4a7daf512e4d69157\",\"fileName\":\"平台商户入驻合同协议.pdf\"}],\"signFlowConfig\":{\"signFlowTitle\":\"平台商户入驻合同协议\",\"signFlowExpireTime\":1746844718000,\"autoFinish\":true,\"notifyUrl\":\"https://mall.gpxscs.cn/asyn/notify\",\"redirectConfig\":{\"redirectUrl\":\"https://mall.gpxscs.cn/\"}},\"signers\":[{\"signConfig\":{\"signOrder\":1},\"noticeConfig\":{\"noticeTypes\":\"1\"},\"signerType\":0,\"psnSignerInfo\":{\"psnAccount\":\"13128997057\",\"psnInfo\":{\"psnName\":\"潘军杰\"}},\"signFields\":[{\"fileId\":\"ab30d2c5600441f4a7daf512e4d69157\",\"normalSignFieldConfig\":{\"signFieldStyle\":1,\"signFieldPosition\":{\"positionPage\":40,\"positionX\":472.3607,\"positionY\":277.19104}}},{\"fileId\":\"ab30d2c5600441f4a7daf512e4d69157\",\"normalSignFieldConfig\":{\"signFieldStyle\":1,\"signFieldPosition\":{\"positionPage\":5,\"positionX\":470.58798,\"positionY\":589.14496}}}]},{\"signConfig\":{\"signOrder\":2},\"noticeConfig\":{\"noticeTypes\":\"1\"},\"signerType\":1,\"orgSignerInfo\":{\"orgName\":\"桂平发发网络有限公司\",\"orgInfo\":{\"orgIDCardNum\":\"91450881MADEQ92533\",\"orgIDCardType\":\"CRED_ORG_USCC\"},\"transactorInfo\":{\"psnAccount\":\"17777525395\",\"psnInfo\":{\"psnName\":\"谢能坤\"}}},\"signFields\":[{\"fileId\":\"ab30d2c5600441f4a7daf512e4d69157\",\"normalSignFieldConfig\":{\"signFieldStyle\":1,\"signFieldPosition\":{\"positionPage\":2,\"positionX\":479.04996,\"positionY\":357.2327}}},{\"fileId\":\"ab30d2c5600441f4a7daf512e4d69157\",\"normalSignFieldConfig\":{\"signFieldStyle\":1,\"signFieldPosition\":{\"positionPage\":5,\"positionX\":255.96832,\"positionY\":588.4553}}}]}]}";
|
||||
// esignContractService.
|
||||
String jsonParams = esignContract.getReq_params();
|
||||
@ -173,20 +186,23 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
//发起接口请求
|
||||
EsignHttpResponse createByDocTemplate = EsignHttpHelper.doCommHttp(serverUrl, apiAddr, requestType, jsonParams, header, debug);
|
||||
if (createByDocTemplate.getStatus() != 200 || createByDocTemplate.getBody() == null) {
|
||||
throw new EsignDemoException("请求失败,返回状态码:" + createByDocTemplate.getStatus());
|
||||
log.error("e签宝请求失败,返回状态码:{}", createByDocTemplate.getStatus());
|
||||
return CommonResult.failed("签署失败,状态码:" + createByDocTemplate.getStatus());
|
||||
}
|
||||
|
||||
JSONObject jsonObject = JSONUtil.parseObj(createByDocTemplate.getBody());
|
||||
Integer code = jsonObject.getInt("code");
|
||||
String signFlowId = (String) jsonObject.getByPath("data.signFlowId");
|
||||
if (code == null || code != 0 || StrUtil.isBlank(signFlowId)) {
|
||||
throw new RuntimeException("请求失败,返回状态码:" + createByDocTemplate.getStatus());
|
||||
log.error("e签宝请求失败,返回状态码:{}", createByDocTemplate.getStatus());
|
||||
return CommonResult.failed("签署失败,状态码:" + createByDocTemplate.getStatus());
|
||||
}
|
||||
|
||||
//合作方签署状态:-1:预备数据阶段;1-等待签署;2 - 已完成(所有签署方完成签署)3 - 已撤销(发起方撤销签署任务)5 - 已过期(签署截止日到期后触发)7 - 已拒签(签署方拒绝签署)
|
||||
Boolean success = updateContractFlowIdAndFileUrl(esignContract.getId(), signFlowId, CommonConstant.CONTRACT_SIGN_STA_ING, null);
|
||||
if (!success) {
|
||||
throw new RuntimeException("更新合同流程状态失败");
|
||||
log.error("更新合同流程状态失败");
|
||||
return CommonResult.failed("更新合同流程状态失败");
|
||||
}
|
||||
|
||||
return CommonResult.success("合同流程创建成功,合同流程ID:" + signFlowId);
|
||||
@ -202,7 +218,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResponseEntity<String> signAsyncNotify(HttpServletRequest request, ServerHttpResponse response, String requestBody) {
|
||||
public ResponseEntity<String> signAsyncNotify(HttpServletRequest request, HttpServletResponse response, String requestBody) {
|
||||
log.debug("签署流程结束通知:body >>> {}", requestBody);
|
||||
log.debug("签署流程结束通知:header >>> {}", request.getParameterMap());
|
||||
|
||||
@ -218,7 +234,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
}
|
||||
|
||||
if (!reqAppId.equals(appId)) {
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "appId 校验失败").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "appId 有误").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
//按照规则进行加密
|
||||
@ -227,21 +243,22 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
log.debug("加密出来的签名值:----------->>>>>>" + mySignature);
|
||||
log.debug("header里面的签名值:---------->>>>>>" + signture);
|
||||
if (!mySignature.equals(signture)) {
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "签名校验不匹配").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "签名校验失败").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
// 处理业务逻辑
|
||||
JSONObject reqBodyJSON = JSONUtil.parseObj(requestBody);
|
||||
String action = reqBodyJSON.getStr("action");
|
||||
String signFlowId = reqBodyJSON.getStr("signFlowId");
|
||||
String signFlowStatus = reqBodyJSON.getStr("signFlowStatus");
|
||||
if (StrUtil.isBlank(action) || StrUtil.isBlank(signFlowId) || StrUtil.isBlank(signFlowStatus)) {
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "返回数据不全").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
if (StrUtil.isBlank(action) || StrUtil.isBlank(signFlowId)) {
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "返回数据有误").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
log.debug("签署流程结束通知:action >>> {}", action);
|
||||
|
||||
// 获取正式盖章合同文件,上传到 oss 服务器,更状态,保存数据
|
||||
if (action.equals("SIGN_FLOW_COMPLETE")) {// 签署流程完毕
|
||||
log.debug("签署流程完毕,开始处理业务逻辑");
|
||||
// 获取正式盖章合同文件地址
|
||||
String downloadUrl = getSignedContractFileUrl(signFlowId);
|
||||
|
||||
@ -252,7 +269,43 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
}
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "更新数据失败").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return new ResponseEntity<>(new JSONObject().put("code", 400).put("msg", "未更新数据!").toString(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查看已签署的电子合同文件
|
||||
*
|
||||
* @param mchMobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CommonResult getSignedContactFile(String mchMobile) {
|
||||
String userId = "0";
|
||||
|
||||
// UserDto user = getCurrentUser();
|
||||
// if (!user.isAdmin()) {
|
||||
// return CommonResult.failed("权限不足!");
|
||||
// }
|
||||
// userId = user.getId().toString();
|
||||
|
||||
EsignContract esignContract = getEsignContractByMchMobile(mchMobile);
|
||||
if (esignContract == null) {
|
||||
return CommonResult.success(null, "未找到商家合同信息");
|
||||
}
|
||||
|
||||
if (!CommonConstant.CONTRACT_SIGN_STA_FINISH.equals(esignContract.getSign_flow_status()) || StrUtil.isBlank(esignContract.getSigned_contract_url())) {
|
||||
return CommonResult.success(null, "合同文件未签署完成");
|
||||
}
|
||||
|
||||
Map<String, Object> ret = new HashMap<>();
|
||||
ret.put("contract_number", esignContract.getContract_number());
|
||||
ret.put("local_contract_url", esignContract.getLocal_contract_url());
|
||||
ret.put("unsigned_contract_url", esignContract.getUnsigned_contract_url());
|
||||
ret.put("sign_flow_id", esignContract.getSign_flow_id());
|
||||
ret.put("mch_company", esignContract.getMch_company());
|
||||
ret.put("sign_flow_status", esignContract.getSign_flow_status());
|
||||
|
||||
return CommonResult.success(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -567,7 +620,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
signFlowConfig.put("signFlowTitle", contractName);
|
||||
signFlowConfig.put("signFlowExpireTime", System.currentTimeMillis() + 90L * 24 * 60 * 60 * 1000); // 90天
|
||||
signFlowConfig.put("autoFinish", true);
|
||||
signFlowConfig.put("notifyUrl", main_domain + "/admin/shop/esign/async/notify");
|
||||
signFlowConfig.put("notifyUrl", main_domain + "/api/admin/shop/esign/async/notify");
|
||||
signFlowConfig.putByPath("signFlowConfig.redirectUrl", "wechat://back");
|
||||
reqParams.put("signFlowConfig", signFlowConfig);
|
||||
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.global.controller.mobile;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.global.GlobalBranchBanks;
|
||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||
import com.suisung.mall.shop.global.service.BranchBanksService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Api(tags = "国内大陆的银行(支行)表")
|
||||
@RestController
|
||||
@RequestMapping("/mobile/shop/global/branch/banks")
|
||||
public class BanksBranchController extends BaseControllerImpl {
|
||||
|
||||
@Resource
|
||||
private BranchBanksService branchBanksService;
|
||||
|
||||
@ApiOperation(value = "搜索国内银行(支行)分页列表", notes = "搜索国内银行(支行)分页列表")
|
||||
@RequestMapping(value = "/search", method = RequestMethod.POST)
|
||||
public CommonResult searchBranchBanksPageList(@RequestBody JSONObject paramsJSON) {
|
||||
Page<GlobalBranchBanks> list = branchBanksService.searchBranchBanksPageList(paramsJSON.getStr("keyword"), paramsJSON.getInt("pageNum"), paramsJSON.getInt("pageSize"));
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -21,9 +21,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "店铺基础信息表")
|
||||
@Api(tags = "国内大陆的银行表")
|
||||
@RestController
|
||||
@RequestMapping("/mobile/shop/global")
|
||||
@RequestMapping("/mobile/shop/global/banks")
|
||||
public class BanksController extends BaseControllerImpl {
|
||||
|
||||
@Resource
|
||||
@ -31,8 +31,8 @@ public class BanksController extends BaseControllerImpl {
|
||||
|
||||
|
||||
@ApiOperation(value = "国内大陆的银行列表", notes = "国内大陆的银行列表")
|
||||
@RequestMapping(value = "/banks/list", method = RequestMethod.POST)
|
||||
public CommonResult shopStoreBusinessCategoryList() {
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
||||
public CommonResult banksList() {
|
||||
List<GlobalBanks> list = banksService.selectList("CN");
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.global.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.suisung.mall.common.modules.global.GlobalBranchBanks;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public interface BanksBranchMapper extends BaseMapper<GlobalBranchBanks> {
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.global.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.modules.global.GlobalBranchBanks;
|
||||
|
||||
public interface BranchBanksService {
|
||||
|
||||
/**
|
||||
* 根据关键字查询有效记录分页列表
|
||||
*
|
||||
* @param keyword
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
Page<GlobalBranchBanks> searchBranchBanksPageList(String keyword, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.global.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.modules.global.GlobalBranchBanks;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import com.suisung.mall.shop.global.mapper.BanksBranchMapper;
|
||||
import com.suisung.mall.shop.global.service.BranchBanksService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class BranchBanksServiceImpl extends BaseServiceImpl<BanksBranchMapper, GlobalBranchBanks> implements BranchBanksService {
|
||||
|
||||
|
||||
/**
|
||||
* 根据关键字查询有效记录分页列表
|
||||
*
|
||||
* @param keyword
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<GlobalBranchBanks> searchBranchBanksPageList(String keyword, Integer pageNum, Integer pageSize) {
|
||||
if (pageNum == null || pageNum < 1) {
|
||||
pageNum = 1;
|
||||
}
|
||||
if (pageSize == null || pageSize < 1) {
|
||||
pageSize = 10;
|
||||
}
|
||||
|
||||
QueryWrapper<GlobalBranchBanks> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status", CommonConstant.Enable);
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
queryWrapper.like("bank_name", keyword);
|
||||
}
|
||||
queryWrapper.orderByAsc("seq");
|
||||
|
||||
return super.lists(queryWrapper, pageNum, pageSize);
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@ package com.suisung.mall.shop.store.service;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||
import org.springframework.data.util.Pair;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -78,7 +79,15 @@ public interface ShopMerchEntryService {
|
||||
* @param bizLicenseNumber
|
||||
* @return
|
||||
*/
|
||||
Boolean isApplied(String mobile, String bizLicenseNumber);
|
||||
Pair<Boolean, String> isApplied(String mobile, String bizLicenseNumber);
|
||||
|
||||
/**
|
||||
* 通过手机号获取商家入驻审核状态
|
||||
*
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
Integer getApprovalStatus(String mobile);
|
||||
|
||||
/**
|
||||
* 获取商家入驻审核状态
|
||||
|
||||
@ -169,8 +169,9 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
}
|
||||
|
||||
// 检查店铺是否已经申请过入驻
|
||||
if (isApplied(record.getLogin_mobile(), record.getBiz_license_number())) {
|
||||
return CommonResult.failed("您手机号或营业执照已经申请过入驻!");
|
||||
Pair<Boolean, String> isApplied = isApplied(record.getLogin_mobile(), record.getBiz_license_number());
|
||||
if (isApplied.getFirst()) {
|
||||
return CommonResult.failed(isApplied.getSecond());
|
||||
}
|
||||
|
||||
record.setCreated_by(userId);
|
||||
@ -390,18 +391,6 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
if (approvalStatus.equals(CommonConstant.Enable) && StrUtil.isBlank(approvalRemark)) {
|
||||
// 审核通过
|
||||
approvalRemark = "审核通过,后续将向您发起签署电子合同流程。";
|
||||
|
||||
// 多线程执行电子合同生成和填充
|
||||
taskService.executeTask(() -> {
|
||||
log.debug("###开始异步执行生成电子合同模版和填充模版数据,并生该商家和平台方签署的未盖章合同文件###");
|
||||
// 生成电子合同模版和填充模版数据,并生该商家和平台方签署的未盖章合同文件
|
||||
Boolean genSuccess = esignContractFillingFileService.fillDocTemplate(record.getBiz_license_number(), "");
|
||||
if (!genSuccess) {
|
||||
log.error("###商家入驻电子合同生成失败###");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else if (approvalStatus.equals(CommonConstant.Disable2) && StrUtil.isBlank(approvalRemark)) {
|
||||
approvalRemark = "审核未通过,请继续完善入驻资料信息。";
|
||||
}
|
||||
@ -421,7 +410,20 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
return CommonResult.failed("系统处理审批出错,请联系管理员!");
|
||||
}
|
||||
|
||||
// TODO 审核通过后,去拉卡拉进件,即时发送短信给商家,通知去签电子合同
|
||||
// TODO 审核通过后,去拉卡拉进件,即时发送短信给商家,通知准备去签电子合同
|
||||
if (approvalStatus.equals(CommonConstant.Enable)) {
|
||||
// 多线程执行电子合同生成和填充
|
||||
taskService.executeTask(() -> {
|
||||
log.debug("###开始异步执行生成电子合同模版和填充模版数据,并生该商家和平台方签署的未盖章合同文件###");
|
||||
// 生成电子合同模版和填充模版数据,并生该商家和平台方签署的未盖章合同文件
|
||||
Boolean genSuccess = esignContractFillingFileService.fillDocTemplate(record.getBiz_license_number(), "");
|
||||
if (!genSuccess) {
|
||||
log.error("###商家入驻电子合同生成失败###");
|
||||
}
|
||||
|
||||
// 发短信通知商家,入驻申请已通过审核
|
||||
});
|
||||
}
|
||||
|
||||
return CommonResult.success();
|
||||
}
|
||||
@ -434,21 +436,58 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean isApplied(String mobile, String bizLicenseNumber) {
|
||||
if (StrUtil.isBlank(mobile) || StrUtil.isBlank(bizLicenseNumber)) {
|
||||
return true;
|
||||
public Pair<Boolean, String> isApplied(String mobile, String bizLicenseNumber) {
|
||||
String msg = "";
|
||||
if (StrUtil.isBlank(mobile) && StrUtil.isBlank(bizLicenseNumber)) {
|
||||
msg = "缺少必要参数!";
|
||||
return Pair.of(false, msg);
|
||||
}
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(mobile)) {
|
||||
if (StrUtil.isNotBlank(mobile) && StrUtil.isBlank(bizLicenseNumber)) {
|
||||
queryWrapper.eq("login_mobile", mobile);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(mobile)) {
|
||||
boolean isApplied = count(queryWrapper) > 0;
|
||||
if (isApplied) {
|
||||
msg = "手机号已申请入驻过!";
|
||||
}
|
||||
return Pair.of(isApplied, msg);
|
||||
} else if (StrUtil.isBlank(mobile) && StrUtil.isNotBlank(bizLicenseNumber)) {
|
||||
queryWrapper.eq("biz_license_number", bizLicenseNumber);
|
||||
boolean isApplied = count(queryWrapper) > 0;
|
||||
if (isApplied) {
|
||||
msg = "营业执照已申请入驻过!";
|
||||
}
|
||||
return Pair.of(isApplied, msg);
|
||||
} else {
|
||||
queryWrapper.eq("login_mobile", mobile).eq("biz_license_number", bizLicenseNumber);
|
||||
boolean isApplied = count(queryWrapper) > 0;
|
||||
if (isApplied) {
|
||||
msg = "已申请入驻过!";
|
||||
}
|
||||
return Pair.of(isApplied, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过手机号获取商家入驻审核状态
|
||||
*
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer getApprovalStatus(String mobile) {
|
||||
if (StrUtil.isBlank(mobile)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return count(queryWrapper) > 0;
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("login_mobile", mobile).select("approval_status").orderByAsc("id");
|
||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return recordList.get(0).getApproval_status();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,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">
|
||||
<mapper namespace="com.suisung.mall.shop.global.mapper.BanksBranchMapper">
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
*
|
||||
</sql>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user