Merge branch 'cc_20250513_franchise_report' into cc_2250513_api

This commit is contained in:
shuo.wang
2025-05-14 10:03:04 +08:00
13 changed files with 339 additions and 12 deletions

View File

@@ -5,10 +5,13 @@ import com.cool.store.entity.BigRegionDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.BigRegionMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -32,4 +35,25 @@ public class BigRegionDAO {
return bigRegionMapper.queryOrgInfoByBigRegionAndJoinMode(regionId,joinMode);
}
public List<Long> getRegionIdByGroupName(List<String> groupNameList){
if (CollectionUtils.isEmpty(groupNameList)){
return null;
}
Example example = new Example(BigRegionDO.class);
example.createCriteria().andIn("groupName", groupNameList);
List<BigRegionDO> bigRegionDOS = bigRegionMapper.selectByExample(example);
if (CollectionUtils.isEmpty(bigRegionDOS)){
return null;
}
return bigRegionDOS.stream().map(BigRegionDO::getRegionId).collect(Collectors.toList());
}
public List<BigRegionDO> getByRegionIdList(List<Long> regionIdList){
if (CollectionUtils.isEmpty(regionIdList)){
return null;
}
Example example = new Example(BigRegionDO.class);
example.createCriteria().andIn("regionId", regionIdList);
return bigRegionMapper.selectByExample(example);
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.FranchiseReportDTO;
import com.cool.store.dto.LicenseSyncDTO;
import com.cool.store.dto.Preparation.PreparationDTO;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
@@ -12,11 +13,7 @@ import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.point.ShopStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.request.BranchShopRequest;
import com.cool.store.request.PlanListRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PreparationRequest;
import com.cool.store.request.platformBuildListRequest;
import com.cool.store.request.*;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.PlatformBuildListResponse;
import com.cool.store.vo.shop.StageShopCountVO;
@@ -290,4 +287,8 @@ public class ShopInfoDAO {
example.createCriteria().andIn("shopCode", shopCodeList).andEqualTo("deleted", false);
return shopInfoMapper.selectByExample(example);
}
public List<FranchiseReportDTO> getShopFranchiseReportList(FranchiseReportRequest request){
return shopInfoMapper.getShopFranchiseReportList(request);
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.mapper;
import com.cool.store.dto.FranchiseReportDTO;
import com.cool.store.dto.LicenseSyncDTO;
import com.cool.store.dto.Preparation.PreparationDTO;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
@@ -7,11 +8,7 @@ import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.dto.point.ShopPointDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.request.BranchShopRequest;
import com.cool.store.request.PlanListRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PreparationRequest;
import com.cool.store.request.platformBuildListRequest;
import com.cool.store.request.*;
import com.cool.store.response.MiniShopsResponse;
import com.cool.store.response.PlatformBuildListResponse;
import com.cool.store.vo.shop.StageShopCountVO;
@@ -114,7 +111,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
/**
* selectAllDataOrByShopId
* @param shopId
* @param
* @return
*/
List<ShopInfoDO> selectAllDataOrByLineId(@Param("lineId") Long lineId);
@@ -141,4 +138,5 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
Integer updateShopCity(@Param("list") List<ShopInfoDO> list);
List<FranchiseReportDTO> getShopFranchiseReportList(@Param("request") FranchiseReportRequest request);
}

View File

@@ -14,6 +14,7 @@
<result column="join_mode" jdbcType="TINYINT" property="joinMode" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
</resultMap>

View File

@@ -482,6 +482,30 @@
a.create_time >= '2025-04-19 00:00:00'
and b.downstream_system_salting is null;
</select>
<select id="getShopFranchiseReportList" resultType="com.cool.store.dto.FranchiseReportDTO">
select
a.id as shopId,
a.region_id as regionId,
a.store_type as storeType
from xfsg_shop_info a
left join xfsg_shop_stage_info b on a.id = b.shop_id
where
a.deleted = 0 and a.shop_status != 2 and a.franchise_brand = 1
and b.shop_sub_stage = 150 and b.is_terminated = 1
<if test = "request.regionIds !=null and request.regionIds.size >0">
and a.region_id in
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
<if test = "request.storeTypes !=null and request.storeTypes.size >0">
and a.store_type in
<foreach collection="request.storeTypes" item="storeType" index="index" open="(" separator="," close=")">
#{storeType}
</foreach>
</if>
and b.actual_completion_time >= #{request.buildStartTime} and b.actual_completion_time &lt;= #{request.buildEndTime}
</select>
<update id="batchUpdate" parameterType="list">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">