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

# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java
This commit is contained in:
俞扬
2023-06-21 16:12:04 +08:00
40 changed files with 516 additions and 147 deletions

View File

@@ -10,6 +10,8 @@ import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
@@ -98,4 +100,9 @@ public class EnterpriseUserDAO {
}
return enterpriseUserMapper.getUserListByRegionIds(regionIds);
}
public Map<String, String> getUserNameAndMobile(List<String> userIds){
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getMobile(), o.getName())).collect(Collectors.toMap(k -> k.getUserId(), v -> v.getName() + " " + v.getMobile()));
}
}

View File

@@ -52,13 +52,19 @@ public class HyIntendDevMappingDAO {
return hyIntendDevelopementMappingMapper.selectByMappingIdList(idList);
}
public List<ZoneCheckDTO> selectByOpenAreaMappingIdList(List<Long> idList){
public List<ZoneCheckDTO> selectByOpenAreaMappingIdList(List<Long> idList,String type){
if (CollectionUtils.isEmpty(idList)){
return new ArrayList<>();
}
return hyIntendDevelopementMappingMapper.selectByOpenAreaMappingIdList(idList);
return hyIntendDevelopementMappingMapper.selectByOpenAreaMappingIdList(idList,type);
}
public HyIntendDevelopementMappingDO selectByOpenAreaMappingId(Long id,String type){
if (id==null){
return null;
}
return hyIntendDevelopementMappingMapper.selectByOpenAreaMappingId(id,type);
}
public int batchInsert(List<HyIntendDevelopementMappingDO> recordList){
if (CollectionUtils.isEmpty(recordList)){

View File

@@ -42,6 +42,13 @@ public class HyIntendDevZoneInfoDAO {
return hyIntendDevZoneInfoMapper.selectById(id);
}
public List<HyIntendDevZoneInfoDO> selectByIds(List<Long> ids){
if (CollectionUtils.isEmpty(ids)){
return new ArrayList<>();
}
return hyIntendDevZoneInfoMapper.selectByIds(ids);
}
public List<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type){
if (StringUtils.isEmpty(type)){

View File

@@ -6,13 +6,17 @@ import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
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
@@ -85,6 +89,14 @@ public class HyOpenAreaInfoDAO {
return hyOpenAreaInfoMapper.selectByIds(ids);
}
public Map<String, String> selectNameMapByIds(List<Long> ids){
if (CollectionUtils.isEmpty(ids)){
return Maps.newHashMap();
}
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids);
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->String.valueOf(k.getId()), v->v.getAreaName()));
}
public HyOpenAreaInfoDO selectById(Long id){
if (id==null){

View File

@@ -2,10 +2,13 @@ package com.cool.store.dao;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.mapper.HyPartnerBaseInfoMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author suzhuhong
@@ -25,6 +28,13 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.insertSelective(record);
}
public int batchInsert( List<HyPartnerBaseInfoDO> records){
if (CollectionUtils.isEmpty(records)){
return 0;
}
return hyPartnerBaseInfoMapper.batchInsert(records);
}
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
@@ -34,6 +44,11 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.updateByPrimaryKeySelective(record);
}
public int updateByPrimaryKey(HyPartnerBaseInfoDO record){
return hyPartnerBaseInfoMapper.updateByPrimaryKey(record);
}
public int updateByPartnerId(String userName,String mobile,String partnerId){
return hyPartnerBaseInfoMapper.updateByPartnerId(userName,mobile,partnerId);
}
@@ -57,10 +72,17 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.getByPartnerLineId(partnerLineId);
}
public Long getLineIdByIdCard(String idCard){
public List<HyPartnerBaseInfoDO> getByPartnerLineIds(List<Long> partnerLineId){
if (CollectionUtils.isEmpty(partnerLineId)){
return new ArrayList<>();
}
return hyPartnerBaseInfoMapper.getByPartnerLineIds(partnerLineId);
}
public HyPartnerBaseInfoDO getByIdCard(String idCard){
if (StringUtils.isEmpty(idCard)){
return null;
}
return hyPartnerBaseInfoMapper.getLineIdByIdCard(idCard);
return hyPartnerBaseInfoMapper.getByIdCard(idCard);
}
}

View File

@@ -33,6 +33,9 @@ public interface HyIntendDevZoneInfoMapper {
*/
HyIntendDevZoneInfoDO selectById(@Param("id") Long id);
List<HyIntendDevZoneInfoDO> selectByIds(@Param("ids") List<Long> ids);
/**
* 查询战区列表
* @param type

View File

@@ -55,5 +55,11 @@ public interface HyIntendDevelopementMappingMapper {
*/
List<ZoneCheckDTO> selectByMappingIdList(@Param("mappingIdList") List<Long> mappingIdList);
List<ZoneCheckDTO> selectByOpenAreaMappingIdList(@Param("openAreaMappingIdList") List<Long> openAreaMappingIdList);
List<ZoneCheckDTO> selectByOpenAreaMappingIdList(@Param("openAreaMappingIdList") List<Long> openAreaMappingIdList,
@Param("type") String type);
HyIntendDevelopementMappingDO selectByOpenAreaMappingId(@Param("openAreaMappingId") Long openAreaMappingId,
@Param("type") String type);
}

View File

@@ -3,6 +3,8 @@ package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-29 03:51
@@ -16,6 +18,8 @@ public interface HyPartnerBaseInfoMapper {
*/
int insertSelective(@Param("record") HyPartnerBaseInfoDO record);
int batchInsert(@Param("records") List<HyPartnerBaseInfoDO> records);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
@@ -23,6 +27,9 @@ public interface HyPartnerBaseInfoMapper {
*/
int updateByPrimaryKeySelective(@Param("record") HyPartnerBaseInfoDO record);
int updateByPrimaryKey(@Param("record") HyPartnerBaseInfoDO record);
/**
* 根据加盟商ID修改用户名称与手机号
* @param userName
@@ -38,7 +45,11 @@ public interface HyPartnerBaseInfoMapper {
HyPartnerBaseInfoDO getByPartnerLineId(@Param("partnerLineId") Long partnerLineId);
List<HyPartnerBaseInfoDO> getByPartnerLineIds(@Param("partnerLineId") List<Long> partnerLineIds);
Long getLineIdByIdCard(@Param("idCard") String idCard);
HyPartnerBaseInfoDO getByIdCard(@Param("idCard") String idCard);
int cleanIdCardInfoByPartnerLineId(@Param("idCard") String idCard,
@Param("idCardPhotoFront") String idCardPhotoFront,

View File

@@ -305,5 +305,9 @@
enterprise_user
where
deleted = 0 and <foreach collection="regionIds" separator="or" open="(" close=")" item="regionId"> user_region_ids like concat("%", #{regionId}, "%") </foreach>
ORDER BY
CASE WHEN jobnumber='' OR jobnumber IS NULL THEN 1 ELSE 0 END,
SUBSTR(jobnumber,1,1),
CAST(SUBSTR(jobnumber,2) AS UNSIGNED) ASC
</select>
</mapper>

View File

@@ -137,4 +137,18 @@
where
deleted = 0 and <foreach collection="regionIds" separator="or" open="(" close=")" item="regionId">associated_region_id like concat("%", #{regionId}, "%")</foreach>
</select>
<select id="selectByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_intend_dev_zone_info
<where>
<if test="ids !=null and ids.size>0">
<foreach collection="ids" item="id" open="and id in (" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@@ -135,9 +135,13 @@
<select id="selectByOpenAreaMappingIdList" resultType="com.cool.store.dto.partner.ZoneCheckDTO">
select
a.open_area_mapping_id as openAreaMappingId,
b.zone_name as zoneName
b.zone_name as zoneName,
b.id as zoneId
from hy_intend_developement_mapping a inner join hy_intend_dev_zone_info b on a.mapping_id = b.id
<where>
<if test="type!=null and type !=''">
and type = #{type}
</if>
<if test="openAreaMappingIdList!=null and openAreaMappingIdList.size>0">
<foreach collection="openAreaMappingIdList" open="and a.open_area_mapping_id in (" close=")" separator="," item="mappingId">
#{mappingId}
@@ -145,4 +149,18 @@
</if>
</where>
</select>
<select id="selectByOpenAreaMappingId" resultMap="BaseResultMap">
select
*
from hy_intend_developement_mapping a
<where>
<if test="type!=null and type !=''">
and a.type = #{type}
</if>
<if test="openAreaMappingId!=null">
and a.open_area_mapping_id = #{openAreaMappingId}
</if>
</where>
</select>
</mapper>

View File

@@ -27,6 +27,21 @@
id_card_photo_front, id_card_photo_black, live_address, user_portrait, status, latest_log_message,
pass_reason, certify_file, create_time, update_time
</sql>
<insert id="batchInsert">
insert into
hy_partner_base_info
(
partner_id,
partner_line_id
)
values
<foreach collection="records" item="record" separator=",">
(#{record.partnerId},
#{record.partnerLineId}
</foreach>
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_base_info
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -142,6 +157,9 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update hy_partner_base_info
<set>
@@ -203,6 +221,18 @@
where id = #{record.id}
</update>
<update id="updateByPrimaryKey">
update hy_partner_base_info
set
nation = #{record.nation},
birthdate = #{record.birthdate},
id_card = #{record.idCard},
id_card_photo_front = #{record.idCardPhotoFront},
id_card_photo_black = #{record.idCardPhotoBlack},
live_address = #{record.liveAddress}
where id = #{record.id}
</update>
<update id="updateByPartnerId">
update hy_partner_base_info
@@ -231,9 +261,22 @@
where partner_line_id = #{partnerLineId}
</select>
<select id="getLineIdByIdCard" resultType="java.lang.Long">
<select id="getByPartnerLineIds" resultMap="BaseResultMap" >
select
partner_line_id
<include refid="Base_Column_List"></include>
from hy_partner_base_info
<where>
<if test="partnerLineIds !=null and partnerLineIds.size>0">
<foreach collection="partnerLineIds" item="lineId" open="and partner_line_id in (" close=")" separator=",">
#{lineId}
</foreach>
</if>
</where>
</select>
<select id="getByIdCard" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_partner_base_info
where id_card = #{idCard}
</select>

View File

@@ -36,7 +36,7 @@
</select>
<insert id="batchInsert">
<insert id="batchInsert" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into
hy_partner_line_info
(
@@ -323,7 +323,7 @@
<include refid="Base_Column_List"></include>
from hy_partner_line_info
<where>
<if test="userId">
<if test="userId != null">
and investment_manager = #{userId}
</if>
<if test="lastMonthTodayDate!=null">

View File

@@ -43,11 +43,13 @@
select
<include refid="Base_Column_List"></include>
from hy_partner_user_info
<if test="partnerIdList!=null and partnerIdList.size>0">
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
#{partnerId}
</foreach>
</if>
<where>
<if test="partnerIdList!=null and partnerIdList.size>0">
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
#{partnerId}
</foreach>
</if>
</where>
</select>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">