修正合同签名bug
This commit is contained in:
parent
fd932d61f5
commit
0bddd33531
@ -39,7 +39,8 @@ public class EsignController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "测试填充模版控件", notes = "测试填充模版控件")
|
||||
@RequestMapping(value = "/testcase", method = RequestMethod.POST)
|
||||
public Object testCase() {
|
||||
return esignContractFillingFileService.fillDocTemplate("13128997057", "91450881MADEQ92533");
|
||||
//return esignContractFillingFileService.fillDocTemplate("13128997057", "91450881MADEQ92533");
|
||||
return esignContractService.getSignedContractFileUrl("27e8dad5491d4d9ab4bc6f8154ae8ff5");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "管理员发起签署电子合同流程", notes = "基于文件发起签署电子合同")
|
||||
|
||||
@ -126,10 +126,16 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
}
|
||||
|
||||
String today = DateUtil.format(new Date(), "yyyy年MM月dd日");
|
||||
String mchCompany = shopMerchEntry.getBiz_license_company();
|
||||
// 甲方公司名称,甲方是个人的时候,没有公司名,直接用店铺名(个人实名)
|
||||
String mchCompany = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getBiz_license_company() : shopMerchEntry.getStore_name() + "(" + shopMerchEntry.getContact_name() + ")";
|
||||
String platCompany = esignPlatformInfo.getLicense_company();
|
||||
String legalPersonName = shopMerchEntry.getLegal_person_name();
|
||||
// String mchMobile = shopMerchEntry.getLogin_mobile();
|
||||
// 甲方法人姓名,甲方是个人的时候,没有法人,直接用个人实名
|
||||
String legalPersonName = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_name() : shopMerchEntry.getContact_name();
|
||||
String LegalPersonMobile = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_mobile() : shopMerchEntry.getLogin_mobile();
|
||||
|
||||
// 甲方法人身份证号,甲方是个人的时候,没有法人,直接用个人身份证
|
||||
String legalPersonIdNumber = CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type()) ? shopMerchEntry.getLegal_person_id_number() : shopMerchEntry.getIndividual_id_number();
|
||||
|
||||
|
||||
String contractNumber = StringUtils.genLklOrderNo(4);
|
||||
|
||||
@ -173,16 +179,35 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
}});
|
||||
}
|
||||
|
||||
if (CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type())) {
|
||||
// 甲方公司名称,甲方是个人的时候,没有公司名,直接用店铺名
|
||||
for (int i = 1; i <= 17; i++) {
|
||||
int finalI = i;
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_company" + finalI);
|
||||
put("componentValue", mchCompany);
|
||||
}});
|
||||
}
|
||||
} else {
|
||||
// 甲方公司名称,甲方是个人的时候,没有公司名,直接用店铺名
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
int finalI = i;
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_company" + finalI);
|
||||
put("componentValue", mchCompany);
|
||||
}});
|
||||
}
|
||||
|
||||
// 甲方公司名称
|
||||
for (int i = 1; i <= 17; i++) {
|
||||
int finalI = i;
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_company" + finalI);
|
||||
put("componentValue", mchCompany);
|
||||
}});
|
||||
//特殊:甲方收款账方,企业是公司名,个人是个人实名
|
||||
if (!CommonConstant.MCH_ENTITY_TYPE_QY.equals(shopMerchEntry.getEntity_type())) {
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_company17");
|
||||
put("componentValue", shopMerchEntry.getContact_name());
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
||||
// 甲方法人姓名,甲方是个人的时候,没有法人,直接用个人实名
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
int finalI = i;
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
@ -191,17 +216,19 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
}});
|
||||
}
|
||||
|
||||
// 甲方法人手机号
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
int finalI = i;
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_legal_person_mobile" + finalI);
|
||||
put("componentValue", shopMerchEntry.getLegal_person_mobile());
|
||||
put("componentValue", LegalPersonMobile);
|
||||
}});
|
||||
}
|
||||
|
||||
// 甲方身份证号码
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "mch_legal_person_id_number1");
|
||||
put("componentValue", shopMerchEntry.getLegal_person_id_number());
|
||||
put("componentValue", legalPersonIdNumber);
|
||||
}});
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
@ -302,7 +329,6 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
put("componentValue", finalEsignPlatformInfo.getRec_acc_card_no());
|
||||
}});
|
||||
|
||||
|
||||
// 代理商相关
|
||||
if (distributor != null) {
|
||||
// 有代理商的时候,才填充代理商的信息
|
||||
@ -332,6 +358,30 @@ public class EsignContractFillingFileServiceImpl extends BaseServiceImpl<EsignCo
|
||||
put("componentKey", "distr_sign_date1");
|
||||
put("componentValue", today);
|
||||
}});
|
||||
} else {
|
||||
// 有代理商的时候,才填充代理商的信息
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "distr_company1");
|
||||
put("componentValue", "无");
|
||||
}});
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "distr_mobile1");
|
||||
put("componentValue", "无");
|
||||
}});
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "distr_company2");
|
||||
put("componentValue", "无");
|
||||
}});
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "distr_bank1");
|
||||
put("componentValue", "无");
|
||||
}});
|
||||
|
||||
list.add(new HashMap<String, Object>() {{
|
||||
put("componentKey", "distr_account_number1");
|
||||
put("componentValue", "无");
|
||||
}});
|
||||
|
||||
}
|
||||
|
||||
fillJson.put("components", list);
|
||||
|
||||
@ -578,7 +578,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据合同流程ID,获取完成签署生效的合同文件地址
|
||||
* 到 e签宝官网,根据合同流程ID,获取完成签署生效的合同文件地址
|
||||
* <p>
|
||||
* 收到异步通知,签署完成之后,获取合同文件地址,保存并上传到 oss
|
||||
*
|
||||
@ -608,12 +608,12 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONArray files = jsonObject.getJSONArray("data.files");
|
||||
JSONArray files = (JSONArray) jsonObject.getByPath("data.files");
|
||||
if (CollectionUtil.isEmpty(files)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return files.getJSONObject(0).getStr("downloadUrl");
|
||||
return ((JSONObject) files.get(0)).getStr("downloadUrl");
|
||||
} catch (EsignDemoException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return null;
|
||||
@ -623,7 +623,7 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
/**
|
||||
* 检查合同签署流程状态,更新合同状态和下载地址
|
||||
*
|
||||
* @param mchMobile
|
||||
* @param mchMobile 商家注册手机号
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@ -639,12 +639,14 @@ public class EsignContractServiceImpl extends BaseServiceImpl<EsignContractMappe
|
||||
updateContractFlowIdAndFileUrl(esignContract.getMch_mobile(), esignContract.getSign_flow_id(), CommonConstant.CONTRACT_SIGN_STA_FINISH, downloadUrl);
|
||||
return Pair.of(CommonConstant.CONTRACT_SIGN_STA_FINISH, downloadUrl);
|
||||
} else {
|
||||
// 没有盖章签署合同文件下载地址
|
||||
return Pair.of(CommonConstant.CONTRACT_SIGN_STA_FINISH, "");
|
||||
}
|
||||
} else {
|
||||
return Pair.of(CommonConstant.CONTRACT_SIGN_STA_FINISH, esignContract.getLocal_contract_url());
|
||||
}
|
||||
} else {
|
||||
// 状态未完成签署的,再次获取合同文件地址
|
||||
String downloadUrl = getSignedContractFileUrl(esignContract.getSign_flow_id());
|
||||
if (StrUtil.isNotBlank(downloadUrl)) {
|
||||
// 更新合同流程文件地址
|
||||
|
||||
@ -609,7 +609,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
updateWrapper.eq("login_mobile", loginMobile);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(signedStatus)) {
|
||||
updateWrapper.eq("signed_status", signedStatus);
|
||||
updateWrapper.set("signed_status", signedStatus);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(contractDownloadUrl)) {
|
||||
|
||||
@ -2957,26 +2957,71 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
* @param mchMobile
|
||||
* @return 店铺Id
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public Integer merchEntryInfo2StoreInfo(String mchMobile) {
|
||||
Integer storeId = 0;
|
||||
if (StrUtil.isBlank(mchMobile)) {
|
||||
logger.error("生成店铺:商家注册手机号为空");
|
||||
return 0;
|
||||
return storeId;
|
||||
}
|
||||
|
||||
// 获取商家注册账号信息
|
||||
|
||||
Integer userId = 0;
|
||||
|
||||
ShopMerchEntry shopMerchEntry = shopMerchEntryService.getShopMerchEntryByCondition(mchMobile, "", CommonConstant.MCH_APPR_STA_PASS);
|
||||
if (ObjectUtil.isEmpty(shopMerchEntry)) {
|
||||
logger.error("生成店铺:商家入驻信息为空");
|
||||
return 0;
|
||||
return storeId;
|
||||
}
|
||||
|
||||
// 新增 shop_store_base,shop_store_info,shop_store_employee 待补充
|
||||
// 新增 shop_store_base,shop_store_info,shop_store_company, shop_store_employee 待补充
|
||||
ShopStoreBase shopStoreBase = new ShopStoreBase();
|
||||
shopStoreBase.setUser_id(userId); // 店铺管理员用户Id
|
||||
shopStoreBase.setStore_name(shopMerchEntry.getStore_name());
|
||||
shopStoreBase.setStore_address(shopMerchEntry.getStore_address());
|
||||
shopStoreBase.setStore_longitude(shopMerchEntry.getStore_longitude());
|
||||
shopStoreBase.setStore_latitude(shopMerchEntry.getStore_latitude());
|
||||
shopStoreBase.setStore_grade_id(1001); // 店铺等级,默认为普通店铺
|
||||
shopStoreBase.setStore_category_id(shopMerchEntry.getBiz_category());
|
||||
shopStoreBase.setStore_type(1);//店铺类型(ENUM): 1-卖家店铺; 2-供应商店铺
|
||||
shopStoreBase.setStore_district_id("");
|
||||
shopStoreBase.setStore_area("");
|
||||
shopStoreBase.setStore_is_open(1);
|
||||
shopStoreBase.setStore_is_selfsupport(0);
|
||||
shopStoreBase.setStore_o2o_flag(0);
|
||||
shopStoreBase.setSubsite_id(0);
|
||||
shopStoreBase.setStore_state_id(3240);//店铺资料信息状态(ENUM):3210-待完善资料; 3220-等待审核 ; 3230-资料审核没有通过;3240-资料审核通过,待付款
|
||||
shopStoreBase.setStore_time(DateUtil.date());
|
||||
shopStoreBase.setStore_end_time(0L);
|
||||
|
||||
if (!save(shopStoreBase)) {
|
||||
logger.error("生成店铺:新增店铺基本信息失败");
|
||||
return storeId;
|
||||
}
|
||||
// 保存后店铺Id
|
||||
storeId = shopStoreBase.getStore_id();
|
||||
|
||||
|
||||
return 0;
|
||||
ShopStoreInfo shopStoreInfo = new ShopStoreInfo();
|
||||
shopStoreInfo.setStore_id(storeId);
|
||||
shopStoreInfo.setStore_start_time(DateUtil.date());
|
||||
shopStoreInfo.setStore_end_time(DateUtil.offsetDay(DateUtil.date(), 365));
|
||||
shopStoreInfo.setStore_opening_hours("08:00");
|
||||
shopStoreInfo.setStore_close_hours("22:00");
|
||||
shopStoreInfo.setStore_tel(shopMerchEntry.getLogin_mobile());
|
||||
shopStoreInfo.setStore_address(shopMerchEntry.getStore_address());
|
||||
shopStoreInfoService.save(shopStoreInfo);
|
||||
|
||||
ShopStoreCompany shopStoreCompany = new ShopStoreCompany();
|
||||
shopStoreCompany.setStore_id(storeId);
|
||||
shopStoreCompany.setCompany_name(shopMerchEntry.getBiz_license_company());
|
||||
shopStoreCompany.setCompany_address(shopMerchEntry.getStore_address());
|
||||
// 待补充
|
||||
shopStoreCompanyService.save(shopStoreCompany);
|
||||
|
||||
|
||||
return storeId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user