This commit is contained in:
shuo.wang
2025-04-09 16:56:11 +08:00
parent f42f751cce
commit b329c10432
7 changed files with 149 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ import com.cool.store.request.*;
import com.cool.store.response.BranchShopDetailResponse;
import com.cool.store.response.BranchShopResponse;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.ShopResponse;
import com.cool.store.vo.shop.MiniShopPageVO;
import com.cool.store.vo.shop.ShopStageInfoVO;
import com.cool.store.vo.shop.StageShopCountVO;
@@ -106,4 +107,6 @@ public interface ShopService {
Boolean dataHandler(Long shopId);
List<MiniShopsResponse> getShopListSuccessOpen(Long lineId);
ShopResponse getShopNameAndCode(Long shopId,Long lineId);
}

View File

@@ -6,6 +6,7 @@ import com.cool.store.dao.*;
import com.cool.store.dto.Preparation.PreparationDTO;
import com.cool.store.dto.Preparation.ScheduleDTO;
import com.cool.store.dto.RegionNode;
import com.cool.store.dto.ShopNameAndCodeDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
@@ -17,6 +18,7 @@ import com.cool.store.request.*;
import com.cool.store.response.BranchShopDetailResponse;
import com.cool.store.response.BranchShopResponse;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.ShopResponse;
import com.cool.store.service.*;
import com.cool.store.utils.NumberConverter;
import com.cool.store.utils.RandomEightCharCodeUtils;
@@ -128,7 +130,7 @@ public class ShopServiceImpl implements ShopService {
Integer result = shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, true);
//初始化平台账号
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(lineInfo.getPartnerId());
shopAccountDAO.initShopAccount(hyPartnerUserInfoDO,shopIds);
shopAccountDAO.initShopAccount(hyPartnerUserInfoDO, shopIds);
Set<String> publishFranchiseFeeUsers = new HashSet<>();
List<EnterpriseUserDO> joinUser = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.JOIN_OFFICE, lineInfo.getRegionId());
if (Objects.nonNull(joinUser)) {
@@ -352,7 +354,7 @@ public class ShopServiceImpl implements ShopService {
}
//初始化平台账号
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(lineInfo.getPartnerId());
shopAccountDAO.initShopAccount(hyPartnerUserInfoDO,Collections.singletonList(shopId));
shopAccountDAO.initShopAccount(hyPartnerUserInfoDO, Collections.singletonList(shopId));
return shopId;
}
@@ -570,7 +572,39 @@ public class ShopServiceImpl implements ShopService {
@Override
public List<MiniShopsResponse> getShopListSuccessOpen(Long lineId) {
return shopInfoDAO.getShopListSuccessOpen(eid,lineId);
return shopInfoDAO.getShopListSuccessOpen(eid, lineId);
}
@Override
public ShopResponse getShopNameAndCode(Long shopId, Long lineId) {
boolean flag = false;
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
ShopResponse response = new ShopResponse();
if (Objects.nonNull(shopInfo)) {
ShopNameAndCodeDTO currentShop = new ShopNameAndCodeDTO();
currentShop.setShopName(shopInfo.getShopName());
currentShop.setShopCode(shopInfo.getShopCode());
response.setCurrentShop(currentShop);
flag = true;
}
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByRegion(lineId, null, null);
List<ShopNameAndCodeDTO> list = new ArrayList<>();
if (CollectionUtils.isNotEmpty(shopList)) {
for (ShopInfoDO shopInfoDO : shopList) {
ShopNameAndCodeDTO dto = new ShopNameAndCodeDTO();
dto.setShopName(shopInfoDO.getShopName());
dto.setShopCode(shopInfoDO.getShopCode());
list.add(dto);
}
response.setShopList(list);
flag = true;
}
if (flag) {
return response;
} else {
return null;
}
}

View File

@@ -1,5 +1,8 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.*;
import com.cool.store.entity.*;
import com.cool.store.enums.DownSystemTypeEnum;
@@ -10,7 +13,9 @@ import com.cool.store.mapper.ApplyLicenseMapper;
import com.cool.store.mapper.SignFranchiseMapper;
import com.cool.store.request.ZxjpApiRequest;
import com.cool.store.service.SyncDataService;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -26,6 +31,7 @@ import java.util.stream.Collectors;
* @Version 1.0
* @注释:
*/
@Slf4j
@Service
public class SyncDataServiceImpl implements SyncDataService {
@@ -106,7 +112,10 @@ public class SyncDataServiceImpl implements SyncDataService {
request.setCrmAccount(lineInfoDO.getMobile());
request.setDownstreamSystemPassword(hyPartnerUserInfoDO.getDownstreamSystemPassword());
request.setDownstreamSystemSalt(hyPartnerUserInfoDO.getDownstreamSystemSalting());
request.setCrmAccount(lineInfoDO.getMobile());
if (StringUtils.isNotBlank(shopInfo.getFranchiseBrand())) {
String[] split = shopInfo.getFranchiseBrand().split(Constants.COMMA);
request.setFranchiseBrand(split[0]);
}
request.setFxyAccount(lineInfoDO.getMobile());
request.setXzjAccount(shopInfo.getShopCode());
request.setYlsAccount(shopInfo.getShopCode());
@@ -117,7 +126,7 @@ public class SyncDataServiceImpl implements SyncDataService {
if (systemType.equals(DownSystemTypeEnum.POS)) {
if (buildInformationDO != null) {
String brand = FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand());
request.setDownstreamSystemShopName(brand + "(" + buildInformationDO + ")");
request.setDownstreamSystemShopName(brand + "(" + buildInformationDO.getCShopName() + ")");
}
}
if (orderSysInfoDO != null) {
@@ -154,34 +163,46 @@ public class SyncDataServiceImpl implements SyncDataService {
request.setVerificationMobile(acceptanceInfoDO.getVerificationMobile());
request.setKsAccount(acceptanceInfoDO.getKsAccount());
}
if (buildInformationDO!=null){
if (buildInformationDO != null) {
request.setBusinessHours(buildInformationDO.getBusinessHours());
request.setShopContactName(buildInformationDO.getShopContactName());
request.setBusinessMobile(buildInformationDO.getBusinessMobile());
request.setSettlerName(buildInformationDO.getSettlerName());
request.setSettlerBankPhotoUrl(buildInformationDO.getSettlerBankPhotoUrl());
request.setSettlerBankBackPhotoUrl(buildInformationDO.getSettlerBankBackPhotoUrl());
if (StringUtils.isNotBlank(buildInformationDO.getSettlerBankPhotoUrl())) {
request.setSettlerBankPhotoUrl(getUrl(buildInformationDO.getSettlerBankPhotoUrl()));
}
if (StringUtils.isNotBlank(buildInformationDO.getSettlerBankBackPhotoUrl())) {
request.setSettlerBankBackPhotoUrl(getUrl(buildInformationDO.getSettlerBankBackPhotoUrl()));
}
request.setSettlerBankBranchName(buildInformationDO.getSettlerBankName());
request.setSettlerBankNumber(buildInformationDO.getSettlerBankNumber());
request.setSettlerBankMobile(buildInformationDO.getSettlerBankMobile());
request.setSettlerIdCardFront(buildInformationDO.getSettlerIdCardFront());
request.setSettlerIdCardReverse(buildInformationDO.getSettlerIdCardReverse());
request.setSettlerInHandBackPicture(buildInformationDO.getSettlerInHandBackPicture());
request.setSettlerInHandFrontPicture(buildInformationDO.getSettlerInHandFrontPicture());
if (StringUtils.isNotBlank(buildInformationDO.getSettlerIdCardFront())) {
request.setSettlerIdCardFront(getUrl(buildInformationDO.getSettlerIdCardFront()));
}
if (StringUtils.isNotBlank(buildInformationDO.getSettlerIdCardReverse())) {
request.setSettlerIdCardReverse(getUrl(buildInformationDO.getSettlerIdCardReverse()));
}
if (StringUtils.isNotBlank(buildInformationDO.getSettlerInHandBackPicture())) {
request.setSettlerInHandBackPicture(getUrl(buildInformationDO.getSettlerInHandBackPicture()));
}
if (StringUtils.isNotBlank(buildInformationDO.getSettlerInHandFrontPicture())) {
request.setSettlerInHandFrontPicture(getUrl(buildInformationDO.getSettlerInHandFrontPicture()));
}
request.setSettlerIdCardNo(buildInformationDO.getSettlerIdCardNo());
}
if (licenseTransactDO != null){
if (licenseTransactDO != null) {
request.setCreditUrl(licenseTransactDO.getCreditUrl());
//二证合一标识0否 1 是
if (Objects.equals(licenseTransactDO.getTwoCertificatesOne(), Constants.ONE_INTEGER)){
if (Objects.equals(licenseTransactDO.getTwoCertificatesOne(), Constants.ONE_INTEGER)) {
request.setFoodBusinessLicenseUrl(licenseTransactDO.getCreditUrl());
}else {
} else {
request.setFoodBusinessLicenseUrl(licenseTransactDO.getFoodBusinessLicenseUrl());
}
}
if (pointInfo!=null){
request.setShopProvinceCityDistrict(pointInfo.getProvince()+pointInfo.getCity()+pointInfo.getDistrict());
if (pointInfo != null) {
request.setShopProvinceCityDistrict(pointInfo.getProvince() + pointInfo.getCity() + pointInfo.getDistrict());
request.setShopLongitude(pointInfo.getLongitude());
request.setShopLatitude(pointInfo.getLatitude());
request.setShopAddress(pointInfo.getAddress());
@@ -191,4 +212,23 @@ public class SyncDataServiceImpl implements SyncDataService {
return request;
}
private static String getUrl(String json) {
if (StringUtils.isBlank(json)) {
return null;
}
try {
// 将 JSON 字符串解析为 JSONArray
JSONArray jsonArray = JSONArray.parseArray(json);
// 获取第一个对象
JSONObject jsonObject = jsonArray.getJSONObject(0);
// 提取 "url" 的值
return jsonObject.getString("url");
} catch (Exception e) {
log.info("getUrl error:{},JSON:{}", e.getMessage(), json);
}
return null;
}
}