优化入驻信息转店铺信息
This commit is contained in:
parent
18d504cbe7
commit
fd1f9aff97
@ -2994,7 +2994,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public Pair<Integer, String> merchEntryInfo2StoreInfo(String mchMobile) {
|
public Pair<Integer, String> merchEntryInfo2StoreInfo(String mchMobile) {
|
||||||
|
|
||||||
if (StrUtil.isBlank(mchMobile)) {
|
if (StrUtil.isBlank(mchMobile)) {
|
||||||
logger.error("生成店铺:商家手机号不能为空");
|
logger.error("生成店铺:商家手机号不能为空");
|
||||||
return Pair.of(0, "商家手机号不能为空");
|
return Pair.of(0, "商家手机号不能为空");
|
||||||
@ -3021,13 +3020,12 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
try {
|
try {
|
||||||
// 新增 shop_store_base,shop_store_info,shop_store_company, shop_store_employee 待补充
|
// 新增 shop_store_base,shop_store_info,shop_store_company, shop_store_employee 待补充
|
||||||
|
|
||||||
String storeFacadeImage = shopMerchEntry.getFront_facade_image();
|
|
||||||
|
|
||||||
// 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(shopMerchEntry.getStore_name());
|
||||||
shopStoreBase.setStore_category_id(shopMerchEntry.getBiz_category());
|
shopStoreBase.setStore_category_id(shopMerchEntry.getBiz_category());
|
||||||
|
String storeFacadeImage = shopMerchEntry.getFront_facade_image();
|
||||||
shopStoreBase.setStore_logo(storeFacadeImage); // 临时使用门面照片做logo
|
shopStoreBase.setStore_logo(storeFacadeImage); // 临时使用门面照片做logo
|
||||||
|
|
||||||
// 省市区记录有序列表
|
// 省市区记录有序列表
|
||||||
@ -3050,6 +3048,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
logger.error("生成店铺:新增店铺基本信息失败");
|
logger.error("生成店铺:新增店铺基本信息失败");
|
||||||
throw new ApiException(I18nUtil._("新增店铺失败"));
|
throw new ApiException(I18nUtil._("新增店铺失败"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存后店铺Id
|
// 保存后店铺Id
|
||||||
Integer storeId = shopStoreBase.getStore_id();
|
Integer storeId = shopStoreBase.getStore_id();
|
||||||
|
|
||||||
@ -3090,7 +3089,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
throw new ApiException(I18nUtil._("新增店铺失败"));
|
throw new ApiException(I18nUtil._("新增店铺失败"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果商家是企业,则保存商家公司信息, 是个人的,也需要保存相关应有信息,公司信息不能空着
|
// 初始化默认公司信息,避免商家编辑不了,申请入驻即使是个人类型的,也需要保存相关应有信息,公司信息不能空着
|
||||||
// shop_store_company
|
// shop_store_company
|
||||||
ShopStoreCompany shopStoreCompany = new ShopStoreCompany();
|
ShopStoreCompany shopStoreCompany = new ShopStoreCompany();
|
||||||
shopStoreCompany.setUser_id(userId);
|
shopStoreCompany.setUser_id(userId);
|
||||||
@ -3101,8 +3100,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
shopStoreCompany.setContacts_phone(shopMerchEntry.getLogin_mobile());
|
shopStoreCompany.setContacts_phone(shopMerchEntry.getLogin_mobile());
|
||||||
|
|
||||||
// 公司名
|
// 公司名
|
||||||
String companyName = shopMerchEntry.getBiz_license_company();
|
String companyName = StrUtil.isBlank(shopMerchEntry.getBiz_license_company()) ? shopMerchEntry.getStore_name() : shopMerchEntry.getBiz_license_company();
|
||||||
companyName = StrUtil.isBlank(companyName) ? shopMerchEntry.getStore_name() : companyName;
|
|
||||||
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(shopMerchEntry.getStore_address());
|
||||||
@ -3121,19 +3119,18 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
shopStoreCompany.setBank_account_number(shopMerchEntry.getAccount_number());
|
shopStoreCompany.setBank_account_number(shopMerchEntry.getAccount_number());
|
||||||
shopStoreCompany.setBank_name(shopMerchEntry.getBank_name());
|
shopStoreCompany.setBank_name(shopMerchEntry.getBank_name());
|
||||||
|
|
||||||
Date today = new Date();
|
Date today = new Date(); // 当前时间
|
||||||
shopStoreCompany.setOrganization_code_start(today);
|
shopStoreCompany.setOrganization_code_start(today);
|
||||||
shopStoreCompany.setOrganization_code_end(DateUtil.offsetDay(today, 365 * 5));
|
shopStoreCompany.setOrganization_code_end(DateUtil.offsetDay(today, 365 * 5));// 五年
|
||||||
shopStoreCompany.setEstablish_date(today);
|
shopStoreCompany.setEstablish_date(today);
|
||||||
shopStoreCompany.setBusiness_licence_start(today);
|
shopStoreCompany.setBusiness_licence_start(today);
|
||||||
shopStoreCompany.setBusiness_licence_end(DateUtil.offsetDay(today, 365 * 5));
|
shopStoreCompany.setBusiness_licence_end(DateUtil.offsetDay(today, 365 * 10));
|
||||||
|
|
||||||
shopStoreCompany.setCompany_description(shopMerchEntry.getStore_name());
|
shopStoreCompany.setCompany_description(shopMerchEntry.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("");
|
||||||
|
|
||||||
// 待补充
|
|
||||||
if (!shopStoreCompanyService.save(shopStoreCompany)) {
|
if (!shopStoreCompanyService.save(shopStoreCompany)) {
|
||||||
logger.error("生成店铺:新增店铺公司失败");
|
logger.error("生成店铺:新增店铺公司失败");
|
||||||
throw new ApiException(I18nUtil._("新增店铺公司失败"));
|
throw new ApiException(I18nUtil._("新增店铺公司失败"));
|
||||||
@ -3143,7 +3140,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
ShopStoreEmployee shopStoreEmployee = new ShopStoreEmployee();
|
ShopStoreEmployee shopStoreEmployee = new ShopStoreEmployee();
|
||||||
shopStoreEmployee.setStore_id(storeId);
|
shopStoreEmployee.setStore_id(storeId);
|
||||||
shopStoreEmployee.setUser_id(userId);
|
shopStoreEmployee.setUser_id(userId);
|
||||||
shopStoreEmployee.setRights_group_id("2,3,4,5,6,7,8,20,21,22,23,24"); // 店铺管理员,店铺
|
shopStoreEmployee.setRights_group_id(""); // 店铺管理员,店铺
|
||||||
shopStoreEmployee.setEmployee_is_admin(CommonConstant.Enable);
|
shopStoreEmployee.setEmployee_is_admin(CommonConstant.Enable);
|
||||||
shopStoreEmployee.setEmployee_is_kefu(CommonConstant.Enable);
|
shopStoreEmployee.setEmployee_is_kefu(CommonConstant.Enable);
|
||||||
shopStoreEmployeeService.save(shopStoreEmployee);
|
shopStoreEmployeeService.save(shopStoreEmployee);
|
||||||
@ -3152,6 +3149,54 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
throw new ApiException(I18nUtil._("新增店铺员工失败"));
|
throw new ApiException(I18nUtil._("新增店铺员工失败"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成店铺的太阳码 2025-03-31
|
||||||
|
if (StrUtil.isBlank(shopStoreBase.getWx_qrcode())) {
|
||||||
|
Pair<String, String> resp = wxQrCodeService.genUnlimitedWxQrCode("pagesub/index/store", "store_id=" + storeId);
|
||||||
|
if (StrUtil.isNotBlank(resp.getFirst())) {
|
||||||
|
updateStoreBaseQrCode(storeId, resp.getFirst());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化时添加一条店铺分析信息
|
||||||
|
ShopStoreAnalytics store_analytics_column = new ShopStoreAnalytics();
|
||||||
|
store_analytics_column.setStore_id(storeId);
|
||||||
|
if (!shopStoreAnalyticsService.saveOrUpdate(store_analytics_column)) {
|
||||||
|
throw new ApiException(ResultCode.FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化店铺商品标签
|
||||||
|
QueryWrapper<ShopBaseProductTag> tagQueryWrapper = new QueryWrapper<>();
|
||||||
|
tagQueryWrapper.orderByAsc("product_tag_id");
|
||||||
|
Page<ShopBaseProductTag> base_product_tag_row = shopBaseProductTagService.lists(tagQueryWrapper, 1, 5);
|
||||||
|
|
||||||
|
List<ShopStoreProductTag> store_product_tag_row = new ArrayList<>();
|
||||||
|
for (ShopBaseProductTag teg : base_product_tag_row.getRecords()) {
|
||||||
|
ShopStoreProductTag shopStoreProductTag = new ShopStoreProductTag();
|
||||||
|
store_product_tag_row.add(shopStoreProductTag);
|
||||||
|
shopStoreProductTag.setProduct_tag_id(teg.getProduct_tag_id());
|
||||||
|
shopStoreProductTag.setStore_id(storeId);
|
||||||
|
shopStoreProductTag.setProduct_tag_time(today);
|
||||||
|
shopStoreProductTag.setStore_product_tag_buildin(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(store_product_tag_row)) {
|
||||||
|
if (!shopStoreProductTagService.saveOrUpdate(store_product_tag_row)) {
|
||||||
|
throw new ApiException(ResultCode.FAILED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化默认店铺仓库
|
||||||
|
InvoicingWarehouseBase invoicingWarehouseBase = new InvoicingWarehouseBase();
|
||||||
|
invoicingWarehouseBase.setWarehouse_name(I18nUtil._("默认"));
|
||||||
|
invoicingWarehouseBase.setStore_id(storeId);
|
||||||
|
invoicingWarehouseBase.setWarehouse_address("");
|
||||||
|
invoicingWarehouseBase.setWarehouse_number("");
|
||||||
|
invoicingWarehouseBase.setWarehouse_contact("");
|
||||||
|
|
||||||
|
if (!invoicingWarehouseBaseService.saveOrUpdate(invoicingWarehouseBase)) {
|
||||||
|
throw new ApiException(ResultCode.FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
// 注意:关联店铺到用户,给用户增加店铺管理员权限
|
// 注意:关联店铺到用户,给用户增加店铺管理员权限
|
||||||
initShopKeeperRightsGroup(userId, storeId);
|
initShopKeeperRightsGroup(userId, storeId);
|
||||||
|
|
||||||
@ -3290,11 +3335,10 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
// 店铺配置
|
// 店铺配置
|
||||||
ShopStoreConfig shopStoreConfig = new ShopStoreConfig();
|
ShopStoreConfig shopStoreConfig = new ShopStoreConfig();
|
||||||
shopStoreConfig.setStore_id(storeId);
|
shopStoreConfig.setStore_id(storeId);
|
||||||
List<Integer> sc_order_process = Arrays.asList(StateCode.ORDER_PROCESS_PAY,
|
List<Integer> sc_order_process = Arrays.asList(
|
||||||
//支付
|
StateCode.ORDER_PROCESS_PAY,//支付
|
||||||
StateCode.ORDER_PROCESS_OUT, //出库审核
|
StateCode.ORDER_PROCESS_OUT, //出库审核
|
||||||
StateCode.ORDER_PROCESS_SHIPPED,
|
StateCode.ORDER_PROCESS_SHIPPED,//发货确认
|
||||||
//发货确认
|
|
||||||
StateCode.ORDER_PROCESS_RECEIVED);
|
StateCode.ORDER_PROCESS_RECEIVED);
|
||||||
|
|
||||||
String str_sc_order_process = CollUtil.join(sc_order_process, ",");
|
String str_sc_order_process = CollUtil.join(sc_order_process, ",");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user