Merge #30 into master from cc_20260106_process_change
fix:加盟合同签约及建店资料修改
* cc_20260106_process_change: (6 commits squashed)
- fix:加盟合同签约新增财务审批
- fix:建店资料阶段逻辑修改
- fix:加盟合同签约待办,财务查看待财务审批的待办
- feat:城市规划
- feat:行政区划接口;
fix:城市规划修改
- fix:加盟合同签约审批日志逻辑修改
Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Reviewed-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/30
This commit is contained in:
@@ -349,8 +349,9 @@ public class ShopStageInfoDAO {
|
||||
public List<ShopStageInfoDO> getSpecialShopStageInfo(List<Long> shopIds, Integer shopSubStage,
|
||||
List<Integer> shopSubStageStatusList,
|
||||
String investmentUserId,
|
||||
List<String> authRegionIds,Boolean ownShopFlag, DeskRequest deskRequest) {
|
||||
return shopStageInfoMapper.getSpecialShopStageInfo(shopIds, shopSubStage, shopSubStageStatusList, investmentUserId, authRegionIds,ownShopFlag, deskRequest);
|
||||
List<String> authRegionIds,Boolean ownShopFlag, DeskRequest deskRequest,
|
||||
String operationsConsultantUserId) {
|
||||
return shopStageInfoMapper.getSpecialShopStageInfo(shopIds, shopSubStage, shopSubStageStatusList, investmentUserId, authRegionIds,ownShopFlag, deskRequest, operationsConsultantUserId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,4 +47,8 @@ public class SignFranchiseDAO {
|
||||
}
|
||||
signFranchiseMapper.updateAuditByShopId(auditId,shopId,dto);
|
||||
}
|
||||
|
||||
public void updateAuditByShopId(Long auditId, Long shopId){
|
||||
signFranchiseMapper.updateAuditByShopId(auditId, shopId, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.cool.store.mapper.StoreMapper;
|
||||
import com.cool.store.response.MiniShopsResponse;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -18,6 +19,7 @@ import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
public class StoreDao {
|
||||
@@ -181,4 +183,32 @@ public class StoreDao {
|
||||
public List<StoreDO> getNoOrderStore(LocalDate latestDate, List<String> businessTypes, Boolean inBusinessType) {
|
||||
return storeMapper.getNoOrderStore(latestDate, businessTypes, inBusinessType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据行政区划查询门店数量统计
|
||||
* @param cityNames 市名称列表
|
||||
* @return <年, <季度, <省, <市, 门店数量>>>>
|
||||
*/
|
||||
public Map<Integer, Map<Integer, Map<String, Map<String, Integer>>>> storeNumStatisticsByAd(List<Integer> years, List<String> cityNames) {
|
||||
if (CollectionUtils.isEmpty(cityNames)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
List<Map<String, Object>> maps = storeMapper.storeNumStatisticsByAd(years, cityNames);
|
||||
return maps.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
v -> MapUtils.getInteger(v, "year"),
|
||||
Collectors.groupingBy(
|
||||
v -> MapUtils.getInteger(v, "quarter"),
|
||||
Collectors.groupingBy(
|
||||
v -> MapUtils.getString(v, "province"),
|
||||
Collectors.toMap(
|
||||
v -> MapUtils.getString(v, "city"),
|
||||
v -> MapUtils.getInteger(v, "store_num", 0),
|
||||
(o, n) -> o)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.dao.ad;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.cool.store.entity.ad.AdDistrictDO;
|
||||
import com.cool.store.mapper.ad.AdDistrictMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 行政区划DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/1/8
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class AdDistrictDAO {
|
||||
private final AdDistrictMapper adDistrictMapper;
|
||||
|
||||
/**
|
||||
* 根据区划编码查询名称
|
||||
*/
|
||||
public Map<String, String> getNameByCodes(List<String> codes) {
|
||||
if (CollectionUtils.isEmpty(codes)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Example example = new Example(AdDistrictDO.class);
|
||||
example.createCriteria().andIn("code", codes);
|
||||
List<AdDistrictDO> list = adDistrictMapper.selectByExample(example);
|
||||
return CollStreamUtil.toMap(list, AdDistrictDO::getCode, AdDistrictDO::getName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
* @param pid 父级id
|
||||
* @return 行政区划列表
|
||||
*/
|
||||
public List<AdDistrictDO> getList(Long pid) {
|
||||
return adDistrictMapper.select(AdDistrictDO.builder().pid(pid).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.cool.store.dao.plan;
|
||||
|
||||
import com.cool.store.entity.plan.CityPlanningDO;
|
||||
import com.cool.store.mapper.plan.CityPlanningMapper;
|
||||
import com.cool.store.request.plan.CityPlanningQueryRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 城市规划DAO
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class CityPlanningDAO {
|
||||
private final CityPlanningMapper cityPlanningMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public boolean insertSelective(CityPlanningDO cityPlanningDO) {
|
||||
return cityPlanningMapper.insertSelective(cityPlanningDO) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public boolean updateSelective(CityPlanningDO cityPlanningDO) {
|
||||
return cityPlanningMapper.updateByPrimaryKeySelective(cityPlanningDO) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
public CityPlanningDO getById(Long id) {
|
||||
return cityPlanningMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
public boolean deleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(CityPlanningDO.class);
|
||||
example.createCriteria().andIn("id", ids);
|
||||
return cityPlanningMapper.deleteByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查同年份同季度同省市是否存在规划
|
||||
* @param year 年份
|
||||
* @param quarter 季度
|
||||
* @param provinceCode 省区划代码
|
||||
* @param cityCode 市区划代码
|
||||
* @param excludeId 排除的id(用于编辑时排除自身)
|
||||
* @return 是否存在
|
||||
*/
|
||||
public boolean existsByYearAndQuarterAndRegion(Integer year, Integer quarter,
|
||||
String provinceCode, String cityCode, Long excludeId) {
|
||||
Example example = new Example(CityPlanningDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
criteria.andEqualTo("year", year)
|
||||
.andEqualTo("quarter", quarter)
|
||||
.andEqualTo("provinceCode", provinceCode)
|
||||
.andEqualTo("cityCode", cityCode);
|
||||
if (Objects.nonNull(excludeId)) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return cityPlanningMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
public List<CityPlanningDO> queryByCondition(CityPlanningQueryRequest request) {
|
||||
Example example = new Example(CityPlanningDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
|
||||
if (StringUtils.isNotBlank(request.getPlanNo())) {
|
||||
criteria.andLike("planNo", "%" + request.getPlanNo() + "%");
|
||||
}
|
||||
if (Objects.nonNull(request.getYear())) {
|
||||
criteria.andEqualTo("year", request.getYear());
|
||||
}
|
||||
if (Objects.nonNull(request.getQuarter())) {
|
||||
criteria.andEqualTo("quarter", request.getQuarter());
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getProvinceCode())) {
|
||||
criteria.andEqualTo("provinceCode", request.getProvinceCode());
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getCityCode())) {
|
||||
criteria.andEqualTo("cityCode", request.getCityCode());
|
||||
}
|
||||
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return cityPlanningMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,8 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
||||
@Param("investmentUserId") String investmentUserId,
|
||||
@Param("authRegionIds") List<String> authRegionIds,
|
||||
@Param("ownShopFlag") Boolean ownShopFlag,
|
||||
@Param("request") DeskRequest deskRequest);
|
||||
@Param("request") DeskRequest deskRequest,
|
||||
@Param("operationsConsultantUserId") String operationsConsultantUserId);
|
||||
List<ShopStageInfoDO> getSubStageList(@Param("shopIds") List<Long> shopIds,@Param("shopSubStage") Integer shopSubStage);
|
||||
List<ShopStageInfoDO> getSubStages(@Param("shopIds") List<Long> shopIds,@Param("shopSubStage") Integer shopSubStage);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface StoreMapper {
|
||||
@@ -110,4 +111,24 @@ public interface StoreMapper {
|
||||
* @return 门店列表
|
||||
*/
|
||||
List<StoreDO> getNoOrderStore(@Param("latestDate") LocalDate latestDate, @Param("businessTypes") List<String> businessTypes, @Param("inBusinessType") Boolean inBusinessType);
|
||||
|
||||
/**
|
||||
* 根据市统计门店数量
|
||||
* @param cityNames 市列表
|
||||
*/
|
||||
List<Map<String, Object>> storeNumStatisticsByAd(@Param("years") List<Integer> years,
|
||||
@Param("cityNames") List<String> cityNames);
|
||||
|
||||
/**
|
||||
* 根据省市统计开店数量
|
||||
* @param province 省
|
||||
* @param city 市
|
||||
* @param openStartTime 开店开始时间
|
||||
* @param openEndTime 开店结束时间
|
||||
* @return 数量
|
||||
*/
|
||||
Integer totalStoreNumByAd(@Param("province") String province,
|
||||
@Param("city") String city,
|
||||
@Param("openStartTime") LocalDate openStartTime,
|
||||
@Param("openEndTime") LocalDate openEndTime);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.ad;
|
||||
|
||||
import com.cool.store.entity.ad.AdDistrictDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface AdDistrictMapper extends Mapper<AdDistrictDO> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.plan;
|
||||
|
||||
import com.cool.store.entity.plan.CityPlanningDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface CityPlanningMapper extends Mapper<CityPlanningDO> {
|
||||
}
|
||||
@@ -389,6 +389,9 @@
|
||||
#{joinMode}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="operationsConsultantUserId != null and operationsConsultantUserId != ''">
|
||||
AND si.operations_consultant = #{operationsConsultantUserId}
|
||||
</if>
|
||||
order by a.update_time desc
|
||||
</where>
|
||||
|
||||
|
||||
@@ -328,4 +328,31 @@
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="storeNumStatisticsByAd" resultType="java.util.Map">
|
||||
SELECT YEAR(open_date) year, province, city, COUNT(1) store_num, QUARTER(open_date) quarter
|
||||
FROM store_${enterpriseId}
|
||||
WHERE is_delete = 'effective'
|
||||
AND city IN
|
||||
<foreach item="item" collection="cityNames" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND YEAR(open_date) IN
|
||||
<foreach item="item" collection="years" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY YEAR(open_date), QUARTER(open_date), province, city
|
||||
</select>
|
||||
|
||||
<select id="totalStoreNumByAd" resultType="java.lang.Integer">
|
||||
SELECT COUNT(1)
|
||||
FROM store_${enterpriseId}
|
||||
WHERE is_delete = 'effective' AND province = #{province} AND city = #{city}
|
||||
<if test="openStartTime != null">
|
||||
AND open_time >= #{openStartTime}
|
||||
</if>
|
||||
<if test="openEndTime != null">
|
||||
AND open_time <= #{openEndTime}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.ad.AdDistrictMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.ad.AdDistrictDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="pid" jdbcType="BIGINT" property="pid" />
|
||||
<result column="level" jdbcType="BIT" property="level" />
|
||||
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.plan.CityPlanningMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.plan.CityPlanningDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="plan_no" jdbcType="VARCHAR" property="planNo" />
|
||||
<result column="year" jdbcType="INTEGER" property="year" />
|
||||
<result column="quarter" jdbcType="INTEGER" property="quarter" />
|
||||
<result column="province_code" jdbcType="VARCHAR" property="provinceCode" />
|
||||
<result column="city_code" jdbcType="VARCHAR" property="cityCode" />
|
||||
<result column="target" jdbcType="INTEGER" property="target" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user