B端 部分接口3
This commit is contained in:
@@ -53,7 +53,8 @@ public enum ErrorCodeEnum {
|
||||
|
||||
LINE_ID_IS_NOT_EXIST(500001, "线索ID不存在!", null),
|
||||
WORK_FLOW_STAGE_PASS_ERROR(500002, "通过错误,非对应阶段!", null),
|
||||
PARTNER_USER_NOT_EXIST(500002, "加盟商用户信息不存在!", null),
|
||||
PARTNER_USER_NOT_EXIST(500003, "加盟商用户信息不存在!", null),
|
||||
ZONE_NOT_EXIST(500004, "战区不存在!", null),
|
||||
|
||||
INTERVIEW_ENTER_FAIL(1021101, "进入面试间失败", null),
|
||||
;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -27,6 +28,13 @@ public class EnterpriseUserDAO {
|
||||
return enterpriseUserMapper.getUserInfoById(userId);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> getUserInfoByUserIds(List<String> userIdList){
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoByUserIds(userIdList);
|
||||
}
|
||||
|
||||
public void batchInsertOrUpdate(List<EnterpriseUserDO> insertOrUpdateList) {
|
||||
if(CollectionUtils.isEmpty(insertOrUpdateList)){
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.ZoneCheckDTO;
|
||||
import com.cool.store.entity.HyIntendDevelopementMappingDO;
|
||||
import com.cool.store.mapper.HyIntendDevelopementMappingMapper;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 14:42
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyIntendDevMappingDAO {
|
||||
|
||||
@Resource
|
||||
HyIntendDevelopementMappingMapper hyIntendDevelopementMappingMapper;
|
||||
|
||||
|
||||
public int insertSelective(HyIntendDevelopementMappingDO record){
|
||||
return hyIntendDevelopementMappingMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKeySelective(HyIntendDevelopementMappingDO record){
|
||||
return hyIntendDevelopementMappingMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
public int deleteByOpenAreaIds(List<Long> openAreaIds,String type){
|
||||
if (CollectionUtils.isEmpty(openAreaIds)){
|
||||
return 0;
|
||||
}
|
||||
return hyIntendDevelopementMappingMapper.deleteByOpenAreaIds(openAreaIds,type);
|
||||
}
|
||||
|
||||
public int deleteByMappingIds(List<Long> mappingIds,String type){
|
||||
if (CollectionUtils.isEmpty(mappingIds)){
|
||||
return 0;
|
||||
}
|
||||
return hyIntendDevelopementMappingMapper.deleteByMappingIds(mappingIds,type);
|
||||
}
|
||||
|
||||
public List<ZoneCheckDTO> selectByMappingIdList(List<Long> idList){
|
||||
if (CollectionUtils.isEmpty(idList)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyIntendDevelopementMappingMapper.selectByMappingIdList(idList);
|
||||
}
|
||||
|
||||
|
||||
public int batchInsert(List<HyIntendDevelopementMappingDO> recordList){
|
||||
if (CollectionUtils.isEmpty(recordList)){
|
||||
return 0;
|
||||
}
|
||||
return hyIntendDevelopementMappingMapper.batchInsert(recordList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.HyIntendDevZoneInfoDO;
|
||||
import com.cool.store.mapper.HyIntendDevZoneInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 14:40
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyIntendDevZoneInfoDAO {
|
||||
|
||||
@Resource
|
||||
HyIntendDevZoneInfoMapper hyIntendDevZoneInfoMapper;
|
||||
|
||||
public int insertSelective( HyIntendDevZoneInfoDO record){
|
||||
return hyIntendDevZoneInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
|
||||
public int updateByPrimaryKeySelective(HyIntendDevZoneInfoDO record){
|
||||
return hyIntendDevZoneInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
public HyIntendDevZoneInfoDO selectById(Long id){
|
||||
if (id==null){
|
||||
return null;
|
||||
}
|
||||
return hyIntendDevZoneInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
public PageInfo<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type){
|
||||
if (StringUtils.isEmpty(type)){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
return hyIntendDevZoneInfoMapper.getHyIntendDevZoneInfoList(type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public interface EnterpriseUserMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-06-06 02:29
|
||||
*/
|
||||
int batchInsertOrUpdate(@Param("recordList") List<EnterpriseUserDO> recordList);
|
||||
@@ -32,6 +32,13 @@ public interface EnterpriseUserMapper {
|
||||
*/
|
||||
EnterpriseUserDO getUserInfoById(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 批量获取用户信息
|
||||
* @param userIdList
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseUserDO> getUserInfoByUserIds(@Param("userIdList") List<String> userIdList);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param excludeUserIds
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.HyIntendDevZoneInfoDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@@ -11,7 +12,7 @@ public interface HyIntendDevZoneInfoMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-29 03:50
|
||||
*/
|
||||
int insertSelective(@Param("record") HyIntendDevZoneInfoDO record);
|
||||
@@ -22,4 +23,18 @@ public interface HyIntendDevZoneInfoMapper {
|
||||
* dateTime:2023-05-29 03:50
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyIntendDevZoneInfoDO record);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HyIntendDevZoneInfoDO selectById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 查询战区列表
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
PageInfo<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type);
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.ZoneCheckDTO;
|
||||
import com.cool.store.entity.HyIntendDevelopementMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:50
|
||||
@@ -11,7 +14,7 @@ public interface HyIntendDevelopementMappingMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-29 03:50
|
||||
*/
|
||||
int insertSelective(@Param("record") HyIntendDevelopementMappingDO record);
|
||||
@@ -22,4 +25,33 @@ public interface HyIntendDevelopementMappingMapper {
|
||||
* dateTime:2023-05-29 03:50
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyIntendDevelopementMappingDO record);
|
||||
|
||||
/**
|
||||
* 批量删除数据
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
int deleteByOpenAreaIds(@Param("openAreaIdList") List<Long> idList, @Param("type") String type);
|
||||
|
||||
|
||||
/**
|
||||
* 删除战区对应的关联意向区域
|
||||
* @param idList
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
int deleteByMappingIds(@Param("mappingIds") List<Long> idList, @Param("type") String type);
|
||||
/**
|
||||
*
|
||||
* @param recordList
|
||||
* @return
|
||||
*/
|
||||
int batchInsert(@Param("recordList") List<HyIntendDevelopementMappingDO> recordList);
|
||||
|
||||
/**
|
||||
* 查询根据selectByMappingIdList集合
|
||||
* @param mappingIdList
|
||||
* @return
|
||||
*/
|
||||
List<ZoneCheckDTO> selectByMappingIdList(@Param("mappingIdList") List<Long> mappingIdList);
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public interface HyOpenAreaInfoMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-29 03:51
|
||||
*/
|
||||
int insertSelective(@Param("record") HyOpenAreaInfoDO record);
|
||||
@@ -39,7 +39,8 @@ public interface HyOpenAreaInfoMapper {
|
||||
* 查询所有
|
||||
* @return
|
||||
*/
|
||||
List<HyOpenAreaInfoDO> queryByKeyword(@Param("keyword") String keyword, @Param("filterData") Boolean filterData);
|
||||
List<HyOpenAreaInfoDO> queryByKeyword(@Param("keyword") String keyword,
|
||||
@Param("filterData") Boolean filterData);
|
||||
|
||||
/**
|
||||
* 查询所有一级城市 (所有省份+直辖市)
|
||||
@@ -64,7 +65,37 @@ public interface HyOpenAreaInfoMapper {
|
||||
* 查询子列表
|
||||
* @return
|
||||
*/
|
||||
List<HyOpenAreaInfoDO> getChildrenList(@Param("type") String type , @Param("parentId") Long parentId);
|
||||
List<HyOpenAreaInfoDO> getChildrenList(@Param("type") String type ,
|
||||
@Param("parentId") Long parentId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新城市昨天
|
||||
* @param backgroundBanner
|
||||
* @param detailBanner
|
||||
* @param areaStatus
|
||||
* @param updateUserId
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int batchUpdateById(@Param("backgroundBanner") String backgroundBanner,
|
||||
@Param("detailBanner") String detailBanner,
|
||||
@Param("areaStatus") String areaStatus,
|
||||
@Param("updateUserId") String updateUserId,
|
||||
@Param("ids") List<Long> ids);
|
||||
|
||||
int batchUpdateByParentId(@Param("backgroundBanner") String backgroundBanner,
|
||||
@Param("detailBanner") String detailBanner,
|
||||
@Param("areaStatus") String areaStatus,
|
||||
@Param("updateUserId") String updateUserId,
|
||||
@Param("parentIdList") List<Long> parentIdList);
|
||||
|
||||
/**
|
||||
* 根据idList查询数据
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
List<HyOpenAreaInfoDO> selectByIds(@Param("idList") List<Long> idList);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -231,12 +231,27 @@
|
||||
|
||||
<select id="getUserInfoById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
<include refid="Blob_Column_List"/>
|
||||
<include refid="Base_Column_List"/>,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from
|
||||
enterprise_user
|
||||
enterprise_user
|
||||
where
|
||||
user_id = #{userId}
|
||||
user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getUserInfoByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from
|
||||
enterprise_user
|
||||
<where>
|
||||
<if test="userIdList !=null and userIdList.size>0">
|
||||
<foreach collection="userIdList" item="userId" open="and user_id in (" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="deleteUser">
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
id, zone_name, associated_region_id, type, last_allot_user_id, deleted, create_time,
|
||||
update_time, create_user_id, update_user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_intend_dev_zone_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into hy_intend_dev_zone_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -111,4 +119,11 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="getHyIntendDevZoneInfoList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_intend_dev_zone_info
|
||||
where type = #{type}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -70,4 +70,64 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByOpenAreaIds">
|
||||
delete from hy_intend_developement_mapping
|
||||
<where>
|
||||
<if test="type!=null and type!=''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="openAreaIdList!=null and openAreaIdList.size>0">
|
||||
<foreach collection="openAreaIdList" open="and open_area_mapping_id in (" close=")" separator="," item="openAreaId">
|
||||
#{openAreaId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMappingIds">
|
||||
delete from hy_intend_developement_mapping
|
||||
<where>
|
||||
<if test="type!=null and type!=''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="deleteByMappingIds!=null and deleteByMappingIds.size>0">
|
||||
<foreach collection="deleteByMappingIds" open="and mapping_id in (" close=")" separator="," item="mappingId">
|
||||
#{mappingId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into
|
||||
hy_intend_developement_mapping
|
||||
(
|
||||
mapping_id,
|
||||
open_area_mapping_id,
|
||||
type
|
||||
)
|
||||
values
|
||||
<foreach collection="recordList" item="record" separator=",">
|
||||
(#{record.mappingId},
|
||||
#{record.openAreaMappingId},
|
||||
#{record.type}
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectByMappingIdList" resultType="com.cool.store.dto.partner.ZoneCheckDTO">
|
||||
select
|
||||
a.open_area_mapping_id as openAreaMappingId,
|
||||
b.zone_name as zoneName
|
||||
from hy_intend_developement_mapping a inner join hy_intend_dev_zone_info b on a.mapping_id = b.id
|
||||
<where>
|
||||
<if test="mappingIdList!=null and mappingIdList.size>0">
|
||||
<foreach collection="mappingIdList" open="and a.open_area_mapping_id in (" close=")" separator="," item="mappingId">
|
||||
#{mappingId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -123,6 +123,59 @@
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="batchUpdateById">
|
||||
update hy_open_area_info
|
||||
<set>
|
||||
<if test="backgroundBanner != null">
|
||||
background_banner = #{backgroundBanner},
|
||||
</if>
|
||||
<if test="detailBanner != null">
|
||||
detail_banner = #{detailBanner},
|
||||
</if>
|
||||
<if test="areaStatus != null">
|
||||
area_status = #{areaStatus},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="ids !=null and ids.size>0">
|
||||
<foreach collection="ids" item="id" open="and id in (" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="batchUpdateByParentId">
|
||||
update hy_open_area_info
|
||||
<set>
|
||||
<if test="backgroundBanner != null">
|
||||
background_banner = #{backgroundBanner},
|
||||
</if>
|
||||
<if test="detailBanner != null">
|
||||
detail_banner = #{detailBanner},
|
||||
</if>
|
||||
<if test="areaStatus != null">
|
||||
area_status = #{areaStatus},
|
||||
</if>
|
||||
<if test="updateUserId != null">
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="parentIdList !=null and parentIdList.size>0">
|
||||
<foreach collection="parentIdList" item="parentId" open="and parent_id in (" close=")" separator=",">
|
||||
#{parentId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<select id="queryKeyOpenArea" resultMap="BaseResultMap">
|
||||
select * from
|
||||
hy_open_area_info
|
||||
@@ -182,4 +235,17 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_open_area_info
|
||||
<where>
|
||||
<if test="idList !=null and idList.size>0">
|
||||
<foreach collection="idList" item="id" open="and id in (" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 16:35
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ZoneCheckDTO {
|
||||
|
||||
private Long openAreaMappingId;
|
||||
|
||||
private String areaName;
|
||||
|
||||
private String zoneName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 11:28
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class OpenAreaSingleVO {
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("parent.id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("区域名称")
|
||||
private String areaName;
|
||||
|
||||
}
|
||||
@@ -48,4 +48,6 @@ public class PartnerLineInfoAndBaseInfoVO {
|
||||
private String investmentManagerPhone;
|
||||
@ApiModelProperty("用户画像")
|
||||
private String userPortrait;
|
||||
@ApiModelProperty("线索状态")
|
||||
private Integer lineStatus;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 16:27
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ZoneCheckVO {
|
||||
|
||||
private String areaName;
|
||||
|
||||
private String zoneName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.cool.store.Service;
|
||||
|
||||
import com.cool.store.request.IntentAreaSettingRequest;
|
||||
import com.cool.store.vo.ZoneCheckVO;
|
||||
import com.cool.store.vo.ZoneVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 14:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ZoneService {
|
||||
|
||||
|
||||
/**
|
||||
* 新增战区
|
||||
* @param userId
|
||||
* @param intentAreaSettingRequest
|
||||
* @return
|
||||
*/
|
||||
Boolean addZone(String userId,IntentAreaSettingRequest intentAreaSettingRequest);
|
||||
|
||||
/**
|
||||
* 编辑战区
|
||||
* @param userId
|
||||
* @param intentAreaSettingRequest
|
||||
* @return
|
||||
*/
|
||||
Boolean updateZone(String userId,IntentAreaSettingRequest intentAreaSettingRequest);
|
||||
|
||||
/**
|
||||
* 战区列表
|
||||
* @param type
|
||||
* @param pageSize
|
||||
* @param pageNum
|
||||
* @return
|
||||
*/
|
||||
PageInfo<ZoneVO> getZoneList(String type, Integer pageSize ,Integer pageNum);
|
||||
|
||||
/**
|
||||
* 战区详情
|
||||
* @param zoneId
|
||||
* @return
|
||||
*/
|
||||
ZoneVO zoneDetail(Long zoneId);
|
||||
|
||||
/**
|
||||
* 删除战区
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean deletedZone(Long id);
|
||||
|
||||
/**
|
||||
* 校验是否绑定其他战区
|
||||
* @param intentAreaSettingRequest
|
||||
* @return
|
||||
*/
|
||||
List<ZoneCheckVO> checkZone(IntentAreaSettingRequest intentAreaSettingRequest);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.Service.OpenAreaService;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.request.OpenAreaRequest;
|
||||
import com.cool.store.vo.OpenAreaTreeVO;
|
||||
import com.cool.store.vo.OpenAreaVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -63,6 +64,16 @@ public class OpenAreaServiceImpl implements OpenAreaService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean batchUpdate(String userId, OpenAreaRequest request) {
|
||||
//修改选择的区域
|
||||
hyOpenAreaInfoDAO.batchUpdateById(request.getBackgroundBanner(),request.getDetailBanner(),request.getStatus(),userId,request.getIdList());
|
||||
//修改选择区域的子区域
|
||||
hyOpenAreaInfoDAO.batchUpdateByParentId(request.getBackgroundBanner(),request.getDetailBanner(),request.getStatus(),userId,request.getIdList());
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
private OpenAreaVO convertDoToVo(HyOpenAreaInfoDO hyOpenAreaInfoDO){
|
||||
OpenAreaVO openAreaVO = new OpenAreaVO();
|
||||
openAreaVO.setId(hyOpenAreaInfoDO.getId());
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.cool.store.Service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.Service.ZoneService;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.HyIntendDevMappingDAO;
|
||||
import com.cool.store.dao.HyIntendDevZoneInfoDAO;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dto.partner.ZoneCheckDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.HyIntendDevZoneInfoDO;
|
||||
import com.cool.store.entity.HyIntendDevelopementMappingDO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyIntendDevelopementMappingMapper;
|
||||
import com.cool.store.request.IntentAreaSettingRequest;
|
||||
import com.cool.store.vo.ZoneCheckVO;
|
||||
import com.cool.store.vo.ZoneVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 14:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class ZoneServiceImpl implements ZoneService {
|
||||
|
||||
|
||||
@Resource
|
||||
HyIntendDevZoneInfoDAO hyIntendDevZoneInfoDAO;
|
||||
|
||||
@Resource
|
||||
HyIntendDevMappingDAO hyIntendDevMappingDAO;
|
||||
|
||||
@Resource
|
||||
HyOpenAreaInfoDAO openAreaInfoDAO;
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean addZone(String userId, IntentAreaSettingRequest intentAreaSettingRequest) {
|
||||
if (CollectionUtils.isEmpty(intentAreaSettingRequest.getOpenAreaIdList())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = new HyIntendDevZoneInfoDO();
|
||||
hyIntendDevZoneInfoDO.setZoneName(intentAreaSettingRequest.getZoneName());
|
||||
if (CollectionUtils.isNotEmpty(intentAreaSettingRequest.getOrgIdList())){
|
||||
hyIntendDevZoneInfoDO.setAssociatedRegionId(JSONObject.toJSONString(intentAreaSettingRequest.getOrgIdList()));
|
||||
}
|
||||
hyIntendDevZoneInfoDO.setCreateUserId(userId);
|
||||
hyIntendDevZoneInfoDO.setType(intentAreaSettingRequest.getType());
|
||||
hyIntendDevZoneInfoDAO.insertSelective(hyIntendDevZoneInfoDO);
|
||||
//添加战区映射的意向区域
|
||||
hyIntendDevMappingDAO.deleteByOpenAreaIds(intentAreaSettingRequest.getOpenAreaIdList(),hyIntendDevZoneInfoDO.getType());
|
||||
List<Long> openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList();
|
||||
List<HyIntendDevelopementMappingDO> list = new ArrayList<>();
|
||||
openAreaIdList.stream().forEach(x->{
|
||||
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO();
|
||||
hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType());
|
||||
hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x));
|
||||
hyIntendDevelopementMappingDO.setMappingId(String.valueOf(hyIntendDevZoneInfoDO.getId()));
|
||||
list.add(hyIntendDevelopementMappingDO);
|
||||
});
|
||||
hyIntendDevMappingDAO.batchInsert(list);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateZone(String userId, IntentAreaSettingRequest intentAreaSettingRequest) {
|
||||
if (CollectionUtils.isEmpty(intentAreaSettingRequest.getOpenAreaIdList())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = new HyIntendDevZoneInfoDO();
|
||||
hyIntendDevZoneInfoDO.setId(intentAreaSettingRequest.getId());
|
||||
hyIntendDevZoneInfoDO.setZoneName(intentAreaSettingRequest.getZoneName());
|
||||
hyIntendDevZoneInfoDO.setAssociatedRegionId(CollectionUtils.isNotEmpty(intentAreaSettingRequest.getOrgIdList())?JSONObject.toJSONString(intentAreaSettingRequest.getOrgIdList()):"");
|
||||
hyIntendDevZoneInfoDAO.updateByPrimaryKeySelective(hyIntendDevZoneInfoDO);
|
||||
//添加战区映射的意向区域
|
||||
hyIntendDevMappingDAO.deleteByOpenAreaIds(intentAreaSettingRequest.getOpenAreaIdList(),intentAreaSettingRequest.getType());
|
||||
List<Long> openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList();
|
||||
List<HyIntendDevelopementMappingDO> list = new ArrayList<>();
|
||||
openAreaIdList.stream().forEach(x->{
|
||||
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO();
|
||||
hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType());
|
||||
hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x));
|
||||
hyIntendDevelopementMappingDO.setMappingId(String.valueOf(hyIntendDevZoneInfoDO.getId()));
|
||||
list.add(hyIntendDevelopementMappingDO);
|
||||
});
|
||||
hyIntendDevMappingDAO.batchInsert(list);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<ZoneVO> getZoneList(String type, Integer pageSize, Integer pageNum) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
PageInfo hyIntendDevZoneInfoList = hyIntendDevZoneInfoDAO.getHyIntendDevZoneInfoList(type);
|
||||
List<ZoneVO> result = new ArrayList<>();
|
||||
List<HyIntendDevZoneInfoDO> list = hyIntendDevZoneInfoList.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return hyIntendDevZoneInfoList;
|
||||
}
|
||||
List<String> updateUserIdList = list.stream().map(HyIntendDevZoneInfoDO::getUpdateUserId).collect(Collectors.toList());
|
||||
List<EnterpriseUserDO> updateUserList = enterpriseUserDAO.getUserInfoByUserIds(updateUserIdList);
|
||||
Map<String, String> updateUserNameMap = updateUserList.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getName));
|
||||
list.forEach(x->{
|
||||
ZoneVO zoneVO = new ZoneVO();
|
||||
zoneVO.setZoneName(x.getZoneName());
|
||||
zoneVO.setId(x.getId());
|
||||
zoneVO.setUpdateTime(x.getUpdateTime());
|
||||
|
||||
zoneVO.setUpdateUserId(x.getUpdateUserId());
|
||||
zoneVO.setUpdateUserName(updateUserNameMap.get(x.getUpdateUserId()));
|
||||
});
|
||||
hyIntendDevZoneInfoList.setList(result);
|
||||
return hyIntendDevZoneInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZoneVO zoneDetail(Long zoneId) {
|
||||
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(zoneId);
|
||||
if (hyIntendDevZoneInfoDO==null){
|
||||
throw new ServiceException(ErrorCodeEnum.ZONE_NOT_EXIST);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedZone(Long id) {
|
||||
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(id);
|
||||
if (hyIntendDevZoneInfoDO==null){
|
||||
throw new ServiceException(ErrorCodeEnum.ZONE_NOT_EXIST);
|
||||
}
|
||||
hyIntendDevZoneInfoDO.setDeleted(1);
|
||||
hyIntendDevZoneInfoDAO.updateByPrimaryKeySelective(hyIntendDevZoneInfoDO);
|
||||
hyIntendDevMappingDAO.deleteByMappingIds(Arrays.asList(id),hyIntendDevZoneInfoDO.getType());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZoneCheckVO> checkZone(IntentAreaSettingRequest intentAreaSettingRequest) {
|
||||
if (CollectionUtils.isEmpty(intentAreaSettingRequest.getOpenAreaIdList())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//查询已经绑定战区的 意向区域
|
||||
List<ZoneCheckDTO> list = hyIntendDevMappingDAO.selectByMappingIdList(intentAreaSettingRequest.getOpenAreaIdList());
|
||||
List<Long> openAreaIdList = list.stream().map(ZoneCheckDTO::getOpenAreaMappingId).collect(Collectors.toList());
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdList);
|
||||
Map<Long, String> areaNameMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName));
|
||||
List<ZoneCheckVO> reslut = new ArrayList<>();
|
||||
list.forEach(x->{
|
||||
ZoneCheckVO zoneCheckVO = new ZoneCheckVO();
|
||||
zoneCheckVO.setZoneName(x.getZoneName());
|
||||
String areaName = areaNameMap.get(x.getOpenAreaMappingId());
|
||||
zoneCheckVO.setAreaName(areaName);
|
||||
});
|
||||
return reslut;
|
||||
}
|
||||
}
|
||||
@@ -284,45 +284,11 @@ public class DeskController {
|
||||
@ApiOperation("变更开放区域状态")
|
||||
public ResponseResult<Boolean> changeOpenAreaStatus(@RequestBody OpenAreaRequest openAreaRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
String userId = "";
|
||||
return ResponseResult.success(openAreaService.batchUpdate( userId, openAreaRequest));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/addZone")
|
||||
@ApiOperation("新建意向战区/开发战区")
|
||||
public ResponseResult<Boolean> addZone(@RequestBody IntentAreaSettingRequest intentAreaSettingRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping(path = "/updateZone")
|
||||
@ApiOperation("编辑意向战区/开发战区")
|
||||
public ResponseResult<Boolean> updateZone(@RequestBody IntentAreaSettingRequest intentAreaSettingRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping(path = "/getZoneList")
|
||||
@ApiOperation("战区列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
|
||||
})
|
||||
public ResponseResult<PageInfo<ZoneVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
|
||||
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(path = "/deletedZoneList")
|
||||
@ApiOperation("删除战区")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
|
||||
})
|
||||
public ResponseResult<Boolean> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(path = "/getAdvanceSetting")
|
||||
@ApiOperation("查询企业高级设置")
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.request.IntentAreaSettingRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.vo.ZoneVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/14 11:40
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class ZoneController {
|
||||
|
||||
|
||||
@PostMapping(path = "/addZone")
|
||||
@ApiOperation("新建意向战区/开发战区")
|
||||
public ResponseResult<Boolean> addZone(@RequestBody IntentAreaSettingRequest intentAreaSettingRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping(path = "/updateZone")
|
||||
@ApiOperation("编辑意向战区/开发战区")
|
||||
public ResponseResult<Boolean> updateZone(@RequestBody IntentAreaSettingRequest intentAreaSettingRequest){
|
||||
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping(path = "/getZoneList")
|
||||
@ApiOperation("战区列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
|
||||
})
|
||||
public ResponseResult<PageInfo<ZoneVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
|
||||
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(path = "/deletedZoneList")
|
||||
@ApiOperation("删除战区")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "id", required = false),
|
||||
})
|
||||
public ResponseResult<Boolean> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user