Merge remote-tracking branch 'origin/cc_20250325_select' into cc_20250325_select

# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/SyncDataServiceImpl.java
This commit is contained in:
shuo.wang
2025-04-14 16:19:56 +08:00
9 changed files with 101 additions and 41 deletions

View File

@@ -7,6 +7,7 @@ import com.cool.store.enums.OpenStatusEnum;
import com.cool.store.enums.PlatformBuildEnum;
import com.cool.store.enums.ShopAccountEnum;
import com.cool.store.mapper.ShopAccountMapper;
import com.cool.store.utils.StringUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@@ -69,6 +70,14 @@ public class ShopAccountDAO {
return shopAccountMapper.selectByShopId(shopId);
}
public ShopAccountDO selectByShopIdAndSystemName(Long shopId,String systemName){
if (Objects.isNull(shopId)|| StringUtil.isEmpty(systemName)){
return null;
}
return shopAccountMapper.selectByShopIdAndSystemName(shopId,systemName);
}
/**
* 根据shopId与system_name修改status
* @param shopId 店铺ID

View File

@@ -24,6 +24,14 @@ public interface ShopAccountMapper extends Mapper<ShopAccountDO> {
*/
List<ShopAccountDO> selectByShopId(Long shopId);
/**
* 根据shopId与系统名称查询
* @param shopId
* @param systemName
* @return
*/
ShopAccountDO selectByShopIdAndSystemName(@Param("shopId") Long shopId , @Param("systemName") String systemName);
/**
* 根据shopId与system_name修改status
* @param shopId 店铺ID

View File

@@ -71,6 +71,27 @@
order by id
</select>
<select id="selectByShopIdAndSystemName" resultMap="BaseResultMap">
SELECT
id,
shop_id,
system_name,
account,
bound_phone,
password_salt,
password,
status,
entry_status,
create_time,
last_sync_time,
remark
FROM
xfsg_shop_account
WHERE
shop_id = #{shopId}
and system_name = #{systemName}
</select>
<!-- 根据shopId与system_name修改status -->
<update id="updateStatusByShopIdAndSystemName">
UPDATE

View File

@@ -158,6 +158,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_43, null);
preparationService.licenseCompleted(request.getShopId());
preparationService.updateShopStatus(request.getShopId());
preparationService.buildStoreAndDecorationComplete(request.getShopId());
}
return Boolean.TRUE;
}

View File

@@ -4,13 +4,18 @@ import com.cool.store.dao.ShopAccountDAO;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.dto.StatusRefreshDTO;
import com.cool.store.entity.ShopAccountDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.OpenStatusEnum;
import com.cool.store.enums.PosAndOrderEnum;
import com.cool.store.enums.ShopAccountEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.PostAndOrderRequest;
import com.cool.store.service.OpenApiService;
import com.cool.store.service.PosAndOrderInfoService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -32,6 +37,8 @@ public class OpenApiServiceImpl implements OpenApiService {
ShopInfoDAO shopInfoDAO;
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Resource
PosAndOrderInfoService posAndOrderInfoService;
@Override
@@ -46,7 +53,17 @@ public class OpenApiServiceImpl implements OpenApiService {
//订货系统开通完成
if (ShopAccountEnum.YLS.getSystemName().equals(statusRefreshDTO.getSystemSource())){
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_173);
ShopAccountDO shopAccountDO = accountDAO.selectByShopIdAndSystemName(shopInfoDO.getId(), ShopAccountEnum.YLS.getSystemName());
if (Objects.isNull(shopAccountDO)){
throw new ServiceException(ErrorCodeEnum.SYSTEM_DATA_ERROR);
}
PostAndOrderRequest postAndOrderRequest = new PostAndOrderRequest();
postAndOrderRequest.setShopId(shopInfoDO.getId());
postAndOrderRequest.setType(PosAndOrderEnum.ORDER.getCode());
postAndOrderRequest.setRemark("已为您开通订货系统账号和密码密码已加密初始密码为身份证后6位可通过加盟小程序修改密码");
postAndOrderRequest.setAccount(shopAccountDO.getAccount());
postAndOrderRequest.setPassword(shopAccountDO.getPassword());
posAndOrderInfoService.submitOrUpdate(postAndOrderRequest,null);
}
return Boolean.TRUE;

View File

@@ -314,11 +314,24 @@ public class PreparationServiceImpl implements PreparationService {
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage()).getShopSubStageStatus());
Boolean flag3 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_153.getShopSubStageStatus().
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
Boolean flag4 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_43.getShopSubStageStatus().
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_4.getShopSubStage()).getShopSubStageStatus());
log.info("buildStoreAndDecorationComplete flag1->{} flag2->{} flag3->{}",flag1,flag2,flag3);
log.info("buildStoreAndDecorationComplete flag1->{} flag2->{} flag3->{}flag4->{}",flag1,flag2,flag3,flag4);
//都完成了 进件状态修改
if (flag1 && flag2 && flag3) {
shopAccountDAO.updateEntryStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode());
//饿了么不需要食安证
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.ELM.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode(),null);
//如果食安也办理完成 其他平台变为审核中
if (flag4){
List<String> list = Arrays.asList(
ShopAccountEnum.MTTG.getSystemName(),
ShopAccountEnum.KS.getSystemName(),
ShopAccountEnum.MT.getSystemName(),
ShopAccountEnum.DY.getSystemName());
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, list, OpenStatusEnum.OPENSTATUSENUM_2.getCode(),null);
}
}
}
return Boolean.TRUE;
@@ -335,7 +348,7 @@ public class PreparationServiceImpl implements PreparationService {
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
log.info("selectSiteAndBuildStoreComplete flag2->{} flag3->{}",flag2,flag3);
//都完成了 进件状态修改
//都完成了 状态修改
if (flag2 && flag3) {
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()), OpenStatusEnum.OPENSTATUSENUM_2.getCode(),null);
}
@@ -356,12 +369,7 @@ public class PreparationServiceImpl implements PreparationService {
if (flag3) {
List<String> list = Arrays.asList(
ShopAccountEnum.YLS.getSystemName(),
ShopAccountEnum.XZG.getSystemName(),
ShopAccountEnum.MT.getSystemName(),
ShopAccountEnum.MTTG.getSystemName(),
ShopAccountEnum.KS.getSystemName(),
ShopAccountEnum.ELM.getSystemName(),
ShopAccountEnum.DY.getSystemName());
ShopAccountEnum.XZG.getSystemName());
shopAccountDAO.updateStatusByShopIdAndSystemName(shopId, list, OpenStatusEnum.OPENSTATUSENUM_2.getCode(),null);
}
}
@@ -369,4 +377,7 @@ public class PreparationServiceImpl implements PreparationService {
}
}

View File

@@ -126,24 +126,20 @@ public class PushServiceImpl implements PushService {
@Override
public Boolean modifyDownstreamSystem(ModifyPasswordDTO modifyPasswordDTO) {
try {
this.modifyPosPassword(modifyPasswordDTO);
//this.modifyXGJPassword(modifyPasswordDTO);
} catch (Exception e) {
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR);
}
this.modifyPosPassword(modifyPasswordDTO);
//this.modifyXGJPassword(modifyPasswordDTO);
return Boolean.TRUE;
}
@Override
public String getYlsToken(GetAccessTokenDTO dto) {
String apiUrl = url + "XXX";
String apiUrl = ylsUrl + "XXX";
return executeApiCall(apiUrl, dto, String.class, ylsUsername, ylsSecret);
}
@Override
public String getXzgToken(GetAccessTokenDTO dto) {
String apiUrl = url + "XXX";
String apiUrl = xzgUrl + "XXX";
return executeApiCall(apiUrl, dto, String.class, xzgUsername, xzgSecret);
}
@@ -211,7 +207,6 @@ public class PushServiceImpl implements PushService {
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
"业务逻辑错误: " + apiResponse.getMsg());
}
return apiResponse.getData();
}
} catch (ServiceException e) {

View File

@@ -12,18 +12,13 @@ import com.cool.store.dto.AccountEntryStatusChangeDTO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.entity.ShopAccountDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.enums.DownSystemTypeEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.OpenStatusEnum;
import com.cool.store.enums.ShopAccountEnum;
import com.cool.store.enums.*;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.PostAndOrderRequest;
import com.cool.store.request.ZxjpApiRequest;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.service.PushService;
import com.cool.store.service.ShopAccountService;
import com.cool.store.service.ShopService;
import com.cool.store.service.SyncDataService;
import com.cool.store.service.*;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -54,6 +49,8 @@ public class ShopAccountServiceImpl implements ShopAccountService {
PushService pushService;
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Resource
PosAndOrderInfoService posAndOrderInfoService;
@Override
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
@@ -205,19 +202,20 @@ public class ShopAccountServiceImpl implements ShopAccountService {
downSystemTypeEnum = DownSystemTypeEnum.POS;
}
ZxjpApiRequest data = this.getData(accountAuditDTO.getShopId(), downSystemTypeEnum);
// TODO: 2025/4/8 suzhuhong_
try {
if (DownSystemTypeEnum.POS.equals(downSystemTypeEnum)){
Boolean successFlag = pushService.pushDataToPOS(data);
OpenStatusEnum openStatusEnum = successFlag ? OpenStatusEnum.OPENSTATUSENUM_5 : OpenStatusEnum.OPENSTATUSENUM_6;
shopAccountDAO.updateStatusByShopIdAndSystemName(accountAuditDTO.getShopId(),Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()),openStatusEnum.getCode(),new Date());
//阶段完成
shopStageInfoDAO.updateShopStageInfo(accountAuditDTO.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_163);
}else {
pushService.pushDataToXGJ(data);
}
} catch (Exception e) {
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用异常: " + e.getMessage());
if (DownSystemTypeEnum.POS.equals(downSystemTypeEnum)){
Boolean successFlag = pushService.pushDataToPOS(data);
OpenStatusEnum openStatusEnum = successFlag ? OpenStatusEnum.OPENSTATUSENUM_5 : OpenStatusEnum.OPENSTATUSENUM_6;
shopAccountDAO.updateStatusByShopIdAndSystemName(accountAuditDTO.getShopId(),Arrays.asList(ShopAccountEnum.HUOMA.getSystemName()),openStatusEnum.getCode(),new Date());
//阶段完成
PostAndOrderRequest postAndOrderRequest = new PostAndOrderRequest();
postAndOrderRequest.setShopId(accountAuditDTO.getShopId());
postAndOrderRequest.setType(PosAndOrderEnum.POS.getCode());
postAndOrderRequest.setRemark("您好,您的账号已经建立,后续由运营经理服务,请您联系您督导或者经理添加我们运营经理微信,感谢您的配合!");
postAndOrderRequest.setAccount(data.getPartnerMobile());
postAndOrderRequest.setPassword(data.getDownstreamSystemPassword());
posAndOrderInfoService.submitOrUpdate(postAndOrderRequest,null);
}else {
pushService.pushDataToXGJ(data);
}
return Boolean.TRUE;
}

View File

@@ -113,10 +113,10 @@ public class SyncDataServiceImpl implements SyncDataService {
request.setYlsAccount(shopInfo.getShopCode());
request.setWqfAccount(shopInfo.getShopCode());
request.setDownstreamSystemShopName(shopInfo.getShopName());
if (systemType.equals(DownSystemTypeEnum.XGJ)) {
if (DownSystemTypeEnum.XGJ.equals(systemType)) {
request.setDownstreamSystemShopName(getXgjShopName(lineInfoDO, shopInfo));
}
if (systemType.equals(DownSystemTypeEnum.POS)) {
if (DownSystemTypeEnum.POS.equals(systemType)) {
if (buildInformationDO != null) {
String brand = FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand());
request.setDownstreamSystemShopName(brand + "(" + buildInformationDO.getCShopName() + ")");