增加字段 同步数据组合

This commit is contained in:
shuo.wang
2025-04-07 19:37:12 +08:00
parent 2a58242706
commit 26d11b7d17
20 changed files with 352 additions and 24 deletions

View File

@@ -0,0 +1,20 @@
package com.cool.store.service;
import com.cool.store.enums.DownSystemTypeEnum;
import com.cool.store.request.ZxjpApiRequest;
/**
* @Author: WangShuo
* @Date: 2025/04/07/15:11
* @Version 1.0
* @注释:
*/
public interface SyncDataService {
/**
* @Auther: wangshuo
* @Date: 2025/4/7
* @description: 获取组合数据
*/
ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType);
}

View File

@@ -120,6 +120,8 @@ public class BuildInformationServiceImpl implements BuildInformationService{
response.setAccountOpeningPermit(informationDO.getAccountOpeningPermit());
response.setSettlerInHandFrontPicture(informationDO.getSettlerInHandFrontPicture());
response.setSettlerInHandBackPicture(informationDO.getSettlerInHandBackPicture());
response.setCShopName(informationDO.getCShopName());
response.setSettlerBankBackPhotoUrl(informationDO.getSettlerBankBackPhotoUrl());
}
@Override
@@ -139,12 +141,12 @@ public class BuildInformationServiceImpl implements BuildInformationService{
map.put("partnerUsername",lineInfoDO.getUsername());
map.put("partnerMobile",lineInfoDO.getMobile());
map.put("storeName",shopInfoDO.getShopName());
List<EnterpriseUserDO> itList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.IT_EMPLOYEE, shopInfoDO.getRegionId());
List<String> itUsers = new ArrayList<>();
if (Objects.nonNull(itList)){
itUsers.addAll(itList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
List<EnterpriseUserDO> logisticsList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.LOGISTICS, shopInfoDO.getRegionId());
List<String> logistics = new ArrayList<>();
if (Objects.nonNull(logisticsList)){
logistics.addAll(logisticsList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
}
commonService.sendQWMessage(itUsers,
commonService.sendQWMessage(logistics,
MessageEnum.MESSAGE_52,
map);
return buildInformationDAO.insertSelective(buildInformationDO);

View File

@@ -17,6 +17,7 @@ import com.cool.store.service.OrderSysInfoService;
import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.poi.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
@@ -48,7 +49,10 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
@Override
@Transactional(rollbackFor = Exception.class)
public Integer updateByShopId(OrderSysInfoRequest request, String userId) {
shopInfoDAO.updateShopCode(request.getShopCode(),request.getShopId());
OrderSysInfoDO orderSysInfoDO = orderSysInfoDAO.selectByShopId(request.getShopId());
if (request.getType().equals(OrderSysTypeEnum.ORDER_SYS_TYPE_1.getType())) {
orderSysInfoDO.setXgjVicePresident(request.getXgjVicePresident());

View File

@@ -209,7 +209,6 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
shopInfoDO.setRegionId(request.getRegionId());
shopInfoDO.setShopName(request.getShopName());
shopInfoDO.setDetailAddress(request.getDetailAddress());
shopInfoDO.setShopCode(request.getShopCode());
shopInfoDO.setJoinMode(request.getJoinMode());
shopInfoDO.setFranchiseBrand(request.getFranchiseBrand());
shopInfoDO.setUpdateTime(new Date());

View File

@@ -0,0 +1,194 @@
package com.cool.store.service.impl;
import com.cool.store.dao.*;
import com.cool.store.entity.*;
import com.cool.store.enums.DownSystemTypeEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.FranchiseBrandEnum;
import com.cool.store.exception.ServiceException;
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.constant.Constants;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Author: WangShuo
* @Date: 2025/04/07/15:12
* @Version 1.0
* @注释:
*/
@Service
public class SyncDataServiceImpl implements SyncDataService {
@Resource
private ShopInfoDAO shopInfoDAO;
@Resource
private LineInfoDAO lineInfoDAO;
@Resource
private SignFranchiseMapper signFranchiseMapper;
@Resource
private HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
@Resource
private OrderSysInfoDAO orderSysInfoDAO;
@Resource
private BuildInformationDAO buildInformationDAO;
@Resource
private AcceptanceInfoDAO acceptanceInfoDAO;
@Resource
private ApplyLicenseMapper applyLicenseMapper;
@Resource
private QualificationsInfoDAO qualificationsInfoDAO;
@Resource
private PointInfoDAO pointInfoDAO;
@Resource
private EnterpriseUserDAO enterpriseUserDAO;
@Override
public ZxjpApiRequest getData(Long shopId, DownSystemTypeEnum systemType) {
ZxjpApiRequest request = new ZxjpApiRequest();
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (shopInfo == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
Long lineId = shopInfo.getLineId();
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(lineId);
if (lineInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(shopInfo.getPartnerId());
if (hyPartnerUserInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.PARTNER_USER_NOT_EXIST);
}
//加盟合同
SignFranchiseDO signFranchiseDO = signFranchiseMapper.selectByShopId(shopId);
//加盟商所有门店的门店编码
List<String> shopCodeList = shopInfoDAO.getShopCodeList(lineId);
//订货信息 & 总部订货收款账户
OrderSysInfoDO orderSysInfoDO = orderSysInfoDAO.selectByShopId(shopId);
//建店资料
BuildInformationDO buildInformationDO = buildInformationDAO.selectOneByShopId(shopId);
//铺位
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
//营业执照
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId);
//验收信息
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
//资质信息
QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDAO.getByLineId(lineId);
//督导
String investmentManager = enterpriseUserDAO.getUserName(shopInfo.getInvestmentManager());
if (signFranchiseDO != null) {
List<String> partnershipSignatory = new ArrayList<>();
partnershipSignatory.add(signFranchiseDO.getPartnershipSignatoryFirst());
partnershipSignatory.add(signFranchiseDO.getPartnershipSignatorySecond());
request.setPartnershipSignatory(partnershipSignatory);
request.setBusinessModel(signFranchiseDO.getBusinessModel());
}
request.setPartnerMobile(lineInfoDO.getMobile());
if (qualificationsInfoDO != null) {
request.setPartnerIdCardNo(qualificationsInfoDO.getIdCardNo());
request.setLegalName(qualificationsInfoDO.getLegalName());
request.setLegalIdCardFront(qualificationsInfoDO.getLegalIdCardFront());
request.setLegalIdCardBack(qualificationsInfoDO.getLegalIdCardBack());
request.setLegalMobile(qualificationsInfoDO.getLegalMobile());
}
request.setShopCode(shopInfo.getShopCode());
request.setShopCodeList(shopCodeList);
request.setCrmAccount(lineInfoDO.getMobile());
request.setDownstreamSystemPassword(hyPartnerUserInfoDO.getDownstreamSystemPassword());
request.setDownstreamSystemSalt(hyPartnerUserInfoDO.getDownstreamSystemSalting());
request.setCrmAccount(lineInfoDO.getMobile());
request.setFxyAccount(lineInfoDO.getMobile());
request.setXzjAccount(shopInfo.getShopCode());
request.setYlsAccount(shopInfo.getShopCode());
request.setWqfAccount(shopInfo.getShopCode());
if (systemType.equals(DownSystemTypeEnum.XGJ)) {
//todo
}
if (systemType.equals(DownSystemTypeEnum.POS)) {
if (buildInformationDO != null) {
String brand = FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand());
request.setDownstreamSystemShopName(brand + "(" + buildInformationDO + ")");
}
}
if (orderSysInfoDO != null) {
request.setXgjRegionId(orderSysInfoDO.getXgjRegionId());
request.setXgjVicePresident(orderSysInfoDO.getXgjVicePresident());
request.setAddresseeName(orderSysInfoDO.getAddresseeName());
request.setAddresseeMobile(orderSysInfoDO.getAddresseeMobile());
request.setAddresseeProvince(orderSysInfoDO.getAddresseeProvince());
request.setAddresseeCity(orderSysInfoDO.getAddresseeCity());
request.setAddresseeDistrict(orderSysInfoDO.getAddresseeDistrict());
request.setAddresseeAddress(orderSysInfoDO.getAddresseeAddress());
request.setDeclareGoodsLogisticsWarehouse(orderSysInfoDO.getDeclareGoodsLogisticsWarehouse());
request.setDeclareGoodsDate(orderSysInfoDO.getDeclareGoodsDate());
request.setWarehouseDeliveryDate(orderSysInfoDO.getWarehouseDeliveryDate());
request.setReceivingFirmName(orderSysInfoDO.getReceivingFirmName());
request.setReceivingMSBankAccount(orderSysInfoDO.getReceivingMsBankAccount());
request.setReceivingMSBankBranch(orderSysInfoDO.getReceivingMsBankBranch());
request.setBankUnionPayAccount(orderSysInfoDO.getBankUnionPayAccount());
}
request.setShopSupervisorUserName(investmentManager);
request.setJoinMode(shopInfo.getJoinMode());
if (acceptanceInfoDO != null) {
if (acceptanceInfoDO.getShopDoorwayPhoto() != null) {
List<String> doorwayPhoto = Arrays.stream(acceptanceInfoDO.getShopDoorwayPhoto().split(","))
.collect(Collectors.toList());
request.setShopDoorwayPhoto(doorwayPhoto);
}
if (acceptanceInfoDO.getShopInteriorPhoto() != null) {
List<String> interiorPhoto = Arrays.stream(acceptanceInfoDO.getShopInteriorPhoto().split(","))
.collect(Collectors.toList());
request.setShopInteriorPhoto(interiorPhoto);
}
request.setShopLocationScreenshots(acceptanceInfoDO.getShopLocationScreenshots());
request.setVerificationMobile(acceptanceInfoDO.getVerificationMobile());
request.setKsAccount(acceptanceInfoDO.getKsAccount());
}
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());
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());
request.setSettlerIdCardNo(buildInformationDO.getSettlerIdCardNo());
}
if (licenseTransactDO != null){
request.setCreditUrl(licenseTransactDO.getCreditUrl());
//二证合一标识0否 1 是
if (Objects.equals(licenseTransactDO.getTwoCertificatesOne(), Constants.ONE_INTEGER)){
request.setFoodBusinessLicenseUrl(licenseTransactDO.getCreditUrl());
}else {
request.setFoodBusinessLicenseUrl(licenseTransactDO.getFoodBusinessLicenseUrl());
}
}
if (pointInfo!=null){
request.setShopProvinceCityDistrict(pointInfo.getProvince()+pointInfo.getCity()+pointInfo.getDistrict());
request.setShopLongitude(pointInfo.getLongitude());
request.setShopLatitude(pointInfo.getLatitude());
request.setShopAddress(pointInfo.getAddress());
request.setShopProvince(pointInfo.getProvince());
request.setShopCity(pointInfo.getCity());
}
return request;
}
}

View File

@@ -51,7 +51,7 @@ public class TallyBookServiceImpl implements TallyBookService {
tallyBookDO.setStatus(TallyBookStatusEnum.IS_SUBMIT.getCode());;
tallyBookDO.setUpdateUser(user.getPartnerId());
tallyBookDO.setTotal(request.getTotal());
tallyBookDO.setUpdateTime(new Date());tallyBookDAO.updateByPrimaryKeySelective(tallyBookDO);
tallyBookDO.setUpdateTime(new Date());
tallyBookDO.setOperatorName(request.getOperatorName());
tallyBookDAO.updateByPrimaryKeySelective(tallyBookDO);
tallyBookDetailDAO.batchDeleteByTallyBookId(request.getId());