Merge branch 'refs/heads/master' into cc_20251112_wallet
# Conflicts: # coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.dao.decoration;
|
||||
|
||||
import com.cool.store.dto.decoration.DecorationTeamDTO;
|
||||
import com.cool.store.entity.decoration.DecorationTeamConfigDO;
|
||||
import com.cool.store.mapper.decoration.DecorationTeamConfigMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/10/29 15:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class DecorationTeamConfigDAO {
|
||||
|
||||
@Resource
|
||||
private DecorationTeamConfigMapper decorationTeamConfigMapper;
|
||||
|
||||
public void addTeam(DecorationTeamConfigDO decorationTeamConfigDO){
|
||||
decorationTeamConfigMapper.insertSelective(decorationTeamConfigDO);
|
||||
}
|
||||
|
||||
public void updateTeam(DecorationTeamConfigDO decorationTeamConfigDO){
|
||||
decorationTeamConfigMapper.updateByPrimaryKeySelective(decorationTeamConfigDO);
|
||||
}
|
||||
|
||||
public DecorationTeamConfigDO getById(Long id){
|
||||
if (id == null){
|
||||
return null;
|
||||
}
|
||||
return decorationTeamConfigMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<DecorationTeamDTO> listByCondition(){
|
||||
return decorationTeamConfigMapper.listByCondition();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.cool.store.dao.decoration;
|
||||
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dto.decoration.DecorationListDTO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.entity.decoration.ShopDecorationAssignDO;
|
||||
import com.cool.store.mapper.decoration.ShopDecorationAssignMapper;
|
||||
import com.cool.store.request.decoration.DecorationListRequest;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/10/29 15:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class ShopDecorationAssignDAO {
|
||||
|
||||
@Resource
|
||||
private ShopDecorationAssignMapper shopDecorationAssignMapper;
|
||||
@Resource
|
||||
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
|
||||
|
||||
public Integer insert(ShopDecorationAssignDO shopDecorationAssignDO) {
|
||||
if (shopDecorationAssignDO == null){
|
||||
return 0;
|
||||
}
|
||||
return shopDecorationAssignMapper.insert(shopDecorationAssignDO);
|
||||
}
|
||||
|
||||
public ShopDecorationAssignDO getById(Long id) {
|
||||
if (id == null){
|
||||
return null;
|
||||
}
|
||||
return shopDecorationAssignMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public Integer update(ShopDecorationAssignDO shopDecorationAssignDO) {
|
||||
if (shopDecorationAssignDO == null){
|
||||
return 0;
|
||||
}
|
||||
return shopDecorationAssignMapper.updateByPrimaryKey(shopDecorationAssignDO);
|
||||
}
|
||||
|
||||
public Integer countByTeamId(Long teamId) {
|
||||
if (teamId == null){
|
||||
return 0;
|
||||
}
|
||||
return shopDecorationAssignMapper.countByTeamId(teamId);
|
||||
}
|
||||
|
||||
public List<DecorationListDTO> listByCondition(DecorationListRequest request) {
|
||||
if (request == null){
|
||||
return null;
|
||||
}
|
||||
if (request.getWantShopAreaId()!=null){
|
||||
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(request.getWantShopAreaId());
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = hyOpenAreaInfoDAO.queryByKeyword(hyOpenAreaInfoDO.getAreaPath(), null, null, false);
|
||||
List<Long> wantShopAreaIds = hyOpenAreaInfoDOList.stream().map(HyOpenAreaInfoDO::getId).collect(Collectors.toList());
|
||||
request.setWantShopAreaIds(wantShopAreaIds);
|
||||
}
|
||||
return shopDecorationAssignMapper.listByCondition(request);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.cool.store.dao.decoration;
|
||||
|
||||
import com.aliyun.openservices.shade.com.google.common.collect.Maps;
|
||||
import com.cool.store.dto.decoration.TeamAreaMappingDTO;
|
||||
import com.cool.store.entity.decoration.TeamAreaMappingDO;
|
||||
import com.cool.store.mapper.decoration.TeamAreaMappingMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/10/29 15:08
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class TeamAreaMappingDAO {
|
||||
|
||||
@Resource
|
||||
private TeamAreaMappingMapper teamAreaMappingMapper;
|
||||
|
||||
public void batchInsert(Long teamId,List<Long> cityId){
|
||||
if (teamId == null || CollectionUtils.isEmpty(cityId)){
|
||||
return;
|
||||
}
|
||||
List<TeamAreaMappingDO> list = new ArrayList<>();
|
||||
cityId.forEach(x->{
|
||||
TeamAreaMappingDO teamAreaMappingDO = new TeamAreaMappingDO();
|
||||
teamAreaMappingDO.setTeamId(teamId);
|
||||
teamAreaMappingDO.setOpenCityId(x);
|
||||
list.add(teamAreaMappingDO);
|
||||
});
|
||||
teamAreaMappingMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
public int deletedByTeamId(Long teamId){
|
||||
if (teamId == null){
|
||||
return 0;
|
||||
}
|
||||
return teamAreaMappingMapper.deletedByTeamId(teamId);
|
||||
}
|
||||
|
||||
public int deletedIds(List<Long> ids){
|
||||
if (CollectionUtils.isEmpty(ids)){
|
||||
return 0;
|
||||
}
|
||||
return teamAreaMappingMapper.deletedIds(ids);
|
||||
}
|
||||
|
||||
public TeamAreaMappingDO getByCityId(Long cityId){
|
||||
return teamAreaMappingMapper.getByCityId(cityId);
|
||||
}
|
||||
|
||||
|
||||
public Map<Long, List<TeamAreaMappingDTO>> listByTeamIdList(List<Long> teamIdList){
|
||||
if (CollectionUtils.isEmpty(teamIdList)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<TeamAreaMappingDTO> teamAreaMappingDTOS = teamAreaMappingMapper.listByTeamIdList(teamIdList);
|
||||
Map<Long, List<TeamAreaMappingDTO>> map = teamAreaMappingDTOS.stream().collect(Collectors.groupingBy(TeamAreaMappingDTO::getTeamId));
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.mapper.decoration;
|
||||
|
||||
import com.cool.store.dto.decoration.DecorationTeamDTO;
|
||||
import com.cool.store.entity.decoration.DecorationTeamConfigDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DecorationTeamConfigMapper extends Mapper<DecorationTeamConfigDO> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询团队
|
||||
* @return
|
||||
*/
|
||||
List<DecorationTeamDTO> listByCondition();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.cool.store.mapper.decoration;
|
||||
|
||||
import com.cool.store.dto.decoration.DecorationListDTO;
|
||||
import com.cool.store.entity.decoration.ShopDecorationAssignDO;
|
||||
import com.cool.store.request.decoration.DecorationListRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopDecorationAssignMapper extends Mapper<ShopDecorationAssignDO> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询团队被门店使用次数
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
Integer countByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 查询分配装修团队列表
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
List<DecorationListDTO> listByCondition(DecorationListRequest request);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.cool.store.mapper.decoration;
|
||||
|
||||
import com.cool.store.dto.decoration.TeamAreaMappingDTO;
|
||||
import com.cool.store.entity.decoration.TeamAreaMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TeamAreaMappingMapper extends Mapper<TeamAreaMappingDO> {
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
Integer batchInsert(@Param("list") List<TeamAreaMappingDO> list);
|
||||
/**
|
||||
* 根据团队id删除 更新团队id时候删除
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
Integer deletedByTeamId(@Param("teamId") Long teamId);
|
||||
|
||||
/**
|
||||
* 根据ids删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Integer deletedIds(@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据城市id查询
|
||||
* @param cityId
|
||||
* @return
|
||||
*/
|
||||
TeamAreaMappingDO getByCityId(@Param("cityId") Long cityId);
|
||||
|
||||
/**
|
||||
* 根据团队id批量查询
|
||||
* @param teamIdList
|
||||
* @return
|
||||
*/
|
||||
List<TeamAreaMappingDTO> listByTeamIdList(@Param("teamIdList") List<Long> teamIdList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.decoration.DecorationTeamConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.decoration.DecorationTeamConfigDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="team_name" jdbcType="VARCHAR" property="teamName" />
|
||||
<result column="team_code" jdbcType="VARCHAR" property="teamCode" />
|
||||
<result column="use_system" jdbcType="TINYINT" property="useSystem" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="TINYINT" property="deleted" />
|
||||
</resultMap>
|
||||
|
||||
<select id="listByCondition" resultType="com.cool.store.dto.decoration.DecorationTeamDTO">
|
||||
select
|
||||
t.id,
|
||||
t.team_name,
|
||||
t.team_code,
|
||||
t.use_system
|
||||
from
|
||||
zxjp_decoration_team_config t
|
||||
where t.deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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.decoration.ShopDecorationAssignMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.decoration.ShopDecorationAssignDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="decoration_desc_status" jdbcType="TINYINT" property="decorationDescStatus" />
|
||||
<result column="decoration_team_id" jdbcType="BIGINT" property="decorationTeamId" />
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
|
||||
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
|
||||
</resultMap>
|
||||
|
||||
<select id="countByTeamId" resultType="java.lang.Integer">
|
||||
select count(1) from zxjp_shop_decoration_assign where decoration_team_id = #{teamId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listByCondition" resultType="com.cool.store.dto.decoration.DecorationListDTO">
|
||||
SELECT
|
||||
zsda.id as id ,
|
||||
zsda.shop_id AS shopId,
|
||||
zsda.decoration_desc_status as decorationDescStatus,
|
||||
zsda.decoration_team_id as teamId,
|
||||
xsi.shop_name AS shopName,
|
||||
xsi.shop_code AS shopCode,
|
||||
xsi.region_id AS regionId,
|
||||
xsi.province AS province,
|
||||
xsi.city AS city,
|
||||
xsi.district AS district,
|
||||
xsi.detail_address AS detailAddress,
|
||||
xsi.store_type AS storeType,
|
||||
xsf.sign_type AS signType
|
||||
FROM zxjp_shop_decoration_assign zsda
|
||||
LEFT JOIN xfsg_shop_info xsi ON zsda.shop_id = xsi.id
|
||||
LEFT JOIN xfsg_sign_franchise xsf ON zsda.shop_id = xsf.shop_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (xsi.shop_name LIKE CONCAT('%', #{keyword}, '%') OR xsi.shop_code LIKE CONCAT('%', #{keyword}, '%'))
|
||||
</if>
|
||||
<if test="storeType != null">
|
||||
AND xsi.store_type = #{storeType}
|
||||
</if>
|
||||
<if test="signType != null">
|
||||
AND xsf.sign_type = #{signType}
|
||||
</if>
|
||||
<if test="regionId != null">
|
||||
AND xsi.region_id = #{regionId}
|
||||
</if>
|
||||
<if test="decorationDescStatus != null">
|
||||
AND zsda.decoration_desc_status = #{decorationDescStatus}
|
||||
</if>
|
||||
<if test="wantShopAreaIds != null and wantShopAreaIds.size() > 0">
|
||||
and b.want_shop_area_id in
|
||||
<foreach collection="wantShopAreaIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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.decoration.TeamAreaMappingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.decoration.TeamAreaMappingDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="team_id" jdbcType="BIGINT" property="teamId" />
|
||||
<result column="open_city_id" jdbcType="BIGINT" property="openCityId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_team_area_mapping (
|
||||
team_id,
|
||||
open_city_id
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.teamId},
|
||||
#{item.openCityId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 根据团队id删除 更新团队id时候删除 -->
|
||||
<delete id="deletedByTeamId" parameterType="java.lang.Long">
|
||||
DELETE FROM zxjp_team_area_mapping
|
||||
WHERE team_id = #{teamId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ids删除 -->
|
||||
<delete id="deletedIds" parameterType="java.util.List">
|
||||
DELETE FROM zxjp_team_area_mapping
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getByCityId" parameterType="java.lang.Long" resultType="com.cool.store.entity.decoration.TeamAreaMappingDO">
|
||||
SELECT
|
||||
*
|
||||
FROM zxjp_team_area_mapping
|
||||
WHERE open_city_id = #{cityId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="listByTeamIdList" parameterType="java.util.List" resultType="com.cool.store.dto.decoration.TeamAreaMappingDTO">
|
||||
SELECT
|
||||
a.team_id as teamId,
|
||||
a.open_city_id as openCityId,
|
||||
b.area_name as openCityName
|
||||
FROM zxjp_team_area_mapping a
|
||||
left join xfsg_open_area_info b on a.open_city_id = b.id
|
||||
WHERE a.team_id IN
|
||||
<foreach collection="teamIdList" item="teamId" open="(" separator="," close=")">
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user