Merge branch 'cc_20240228_fix' into 'master'

Cc 20240228 fix

See merge request hangzhou/java/custom_zxjp!51
This commit is contained in:
苏竹红
2025-03-04 09:33:44 +00:00
14 changed files with 122 additions and 69 deletions

View File

@@ -23,12 +23,10 @@ import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -221,5 +219,4 @@ public class LineInfoDAO {
List<LineInfoDO> lineMobile = lineInfoMapper.getByLineIds(lineIds);
return lineMobile.stream().filter(o->StringUtils.isNotBlank(o.getMobile())).collect(Collectors.toMap(LineInfoDO::getId, LineInfoDO::getUsername, (k1, k2)-> k1));
}
}

View File

@@ -213,10 +213,10 @@ public class ShopInfoDAO {
return shopInfoMapper.batchUpdate(list);
}
public List<ShopInfoDO> selectInvestmentByLines(List<Long> lineIds) {
public List<ShopInfoDO> selectByLines(List<Long> lineIds,List<Long> regionIds) {
if (CollectionUtils.isEmpty(lineIds)) {
return new ArrayList<>();
}
return shopInfoMapper.selectInvestmentByList(lineIds);
return shopInfoMapper.selectByLines(lineIds,regionIds);
}
}

View File

@@ -118,5 +118,5 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
Boolean batchUpdate(List<ShopInfoDO> list);
List<ShopInfoDO> selectInvestmentByList (@Param("list") List<Long> list);
List<ShopInfoDO> selectByLines (@Param("list") List<Long> list,@Param("regionIds") List<Long> regionIds);
}

View File

@@ -462,13 +462,27 @@
<select id="partnerList" resultMap="BaseResultMap">
select * from xfsg_line_info a
select distinct a.id,
a.username,a.mobile,
a.want_shop_area_id,
a.development_manager,
a.investment_manager,
a.region_id,
a.line_source,
a.user_portrait,
a.update_time,
a.update_user_id,
a.join_mode,
a.partner_num,
a.want_shop_num
from xfsg_line_info a
join xfsg_shop_info c on a.id = c.line_id
<if test="wantShopAreaName != null">
left join xfsg_open_area_info b on a.want_shop_area_id = b.id
</if>
where a.deleted = 0 and a.line_status = 1 and a.join_status in (1,2)
<if test="userId != null and userId != ''">
and a.investment_manager = #{userId}
and (a.investment_manager = #{userId} or c.investment_manager = #{userId} )
</if>
<if test="request.joinStatus != null">
and a.join_status = #{request.joinStatus}
@@ -481,21 +495,33 @@
</if>
<if test="request.queryUserId!=null and request.queryUserId!=''">
<if test="request.queryType != null and request.queryType == 1 ">
and a.investment_manager = #{request.queryUserId}
and( a.investment_manager = #{request.queryUserId} or c.investment_manager = #{request.queryUserId})
</if>
<if test="request.queryType != null and request.queryType == 2 ">
and a.development_manager = #{request.queryUserId}
and( a.development_manager = #{request.queryUserId} or c.development_manager = #{request.queryUserId})
</if>
</if>
<if test="request.regionIds !=null and request.regionIds.size>0">
<foreach collection="request.regionIds" item="regionId" open="and a.region_id in (" close=")" separator=",">
and (
<foreach collection="request.regionIds" item="regionId" open=" a.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
or
<foreach collection="request.regionIds" item="regionId" open=" c.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
)
</if>
<if test="regionIds !=null and regionIds.size>0">
<foreach collection="regionIds" item="regionId" open="and a.region_id in (" close=")" separator=",">
and (
<foreach collection="regionIds" item="regionId" open=" a.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
or
<foreach collection="regionIds" item="regionId" open=" c.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
)
</if>
order by a.id desc
</select>

View File

@@ -346,17 +346,20 @@
select
<include refid="allColumn"/>
from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
and ( 1=1
<if test="userId!=null and userId!=''">
or investment_manager = #{userId}
and( investment_manager = #{userId}
<if test="list!=null and list.size>0">
or region_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test=" list.size==0">
or 1=1
</if>
)
</if>
<if test="list!=null and list.size>0">
or region_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
</select>
@@ -389,15 +392,16 @@
</if>
</where>
</select>
<select id="selectInvestmentByList" resultType="com.cool.store.entity.ShopInfoDO">
select line_id as LineId,
investment_manager as investmentManager,
development_manager as developmentManager
<select id="selectByLines" resultType="com.cool.store.entity.ShopInfoDO">
select *
from xfsg_shop_info
where line_id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
<foreach collection="regionIds" item="item" index="index" open="and region_id in (" separator="," close=")">
#{item}
</foreach>
</select>
<update id="batchUpdate" parameterType="list">

View File

@@ -14,7 +14,7 @@
limit 1
</select>
<select id="selectByShopIds" resultType="com.cool.store.entity.SignFranchiseDO">
select contract_code,shop_id,contract_start_time,contract_end_time,contract_amount
select contract_code,shop_id,contract_start_time,contract_end_time,contract_amount,create_time
from xfsg_sign_franchise
where 1=1
<if test="list !=null and list.size >0">

View File

@@ -74,102 +74,107 @@ public class ExportBranchShopDTO {
@ColumnWidth(30)
private String currency;
@ExcelProperty(value = "合计缴费金额(取自账单)",order = 15)
@ExcelProperty(value = "缴纳加盟费/保证金",order =15)
@ColumnWidth(30)
private String franchiseFeeStageStatus;
@ExcelProperty(value = "加盟合同签约",order =16)
@ColumnWidth(30)
private String signFranchiseStageStatus ;
@ExcelProperty(value = "签约时间",order =17)
@ColumnWidth(30)
private String signTime ;
@ExcelProperty(value = "合同金额",order =18)
@ColumnWidth(30)
private String contractAmount;
@ExcelProperty(value = "合计缴费金额(取自账单)",order = 19)
@ColumnWidth(30)
private String totalAmountContributions;
@ExcelProperty(value = "加盟费(取自账单)",order = 16)
@ExcelProperty(value = "加盟费(取自账单)",order = 20)
@ColumnWidth(30)
private String franchiseFeeBill;
@ExcelProperty(value = "加盟费(含税金额)",order = 18)
@ExcelProperty(value = "加盟费(含税金额)",order = 21)
@ColumnWidth(30)
private String franchiseFeeTax;
@ExcelProperty(value = "加盟费(不含税金额)",order = 19)
@ExcelProperty(value = "加盟费(不含税金额)",order = 22)
@ColumnWidth(30)
private String franchiseFee;
@ExcelProperty(value = "保证金(取自账单)",order = 20)
@ExcelProperty(value = "保证金(取自账单)",order = 23)
@ColumnWidth(30)
private String loanMargin;
@ExcelProperty(value = "第一年度管理费(取自账单)",order = 21)
@ExcelProperty(value = "第一年度管理费(取自账单)",order = 24)
@ColumnWidth(30)
private String firstYearManagementFeeBill;
@ExcelProperty(value = "第一年度管理费(含税金额)",order = 22)
@ExcelProperty(value = "第一年度管理费(含税金额)",order = 25)
@ColumnWidth(30)
private String firstYearManagementFeeTax;
@ExcelProperty(value = "第一年度管理费(不含税金额)",order = 23)
@ExcelProperty(value = "第一年度管理费(不含税金额)",order = 26)
@ColumnWidth(30)
private String firstYearManagementFee;
@ExcelProperty(value = "第一年度品牌费(取自账单)",order = 24)
@ExcelProperty(value = "第一年度品牌费(取自账单)",order = 27)
@ColumnWidth(30)
private String firstYearBrandingFeeBill;
@ExcelProperty(value = "第一年度品牌费(含税金额)",order = 25)
@ExcelProperty(value = "第一年度品牌费(含税金额)",order = 28)
@ColumnWidth(30)
private String firstYearBrandingFeeTax;
@ExcelProperty(value = "第一年度品牌费(不含税金额)",order = 26)
@ExcelProperty(value = "第一年度品牌费(不含税金额)",order = 29)
@ColumnWidth(30)
private String firstYearBrandingFee;
@ExcelProperty(value = "设计费(取自账单)",order = 27)
@ExcelProperty(value = "设计费(取自账单)",order = 30)
@ColumnWidth(30)
private String performanceBondBill;
@ExcelProperty(value = "设计费(含税金额)",order = 28)
@ExcelProperty(value = "设计费(含税金额)",order = 31)
@ColumnWidth(30)
private String designFeeTax;
@ExcelProperty(value = "设计费(不含税金额)",order = 29)
@ExcelProperty(value = "设计费(不含税金额)",order = 32)
@ColumnWidth(30)
private String designFee;
@ExcelProperty(value = "第1次缴纳时间",order = 30)
@ExcelProperty(value = "第1次缴纳时间",order = 33)
@ColumnWidth(30)
private String firstPayTime;
@ExcelProperty(value = "第2次缴纳时间",order = 31)
@ExcelProperty(value = "第2次缴纳时间",order = 34)
@ColumnWidth(30)
private String secondPayTime;
@ExcelProperty(value = "第3次缴纳时间",order = 32)
@ExcelProperty(value = "第3次缴纳时间",order = 35)
@ColumnWidth(30)
private String thirdPayTime;
@ExcelProperty(value = "第4次缴纳时间",order = 33)
@ExcelProperty(value = "第4次缴纳时间",order = 36)
@ColumnWidth(30)
private String fourthPayTime;
@ExcelProperty(value = "当前进度",order = 34)
@ExcelProperty(value = "当前进度",order = 37)
@ColumnWidth(30)
private String currentProgress;
@ExcelProperty(value = "状态",order = 35)
@ExcelProperty(value = "状态",order = 38)
@ColumnWidth(30)
private String shopStatus;
@ExcelProperty(value = "计划开店时间",order = 36)
@ExcelProperty(value = "计划开店时间",order = 39)
@ColumnWidth(30)
private String planOpenTime;
@ExcelProperty(value = "开店时长(天)",order =37)
@ExcelProperty(value = "开店时长(天)",order =40)
@ColumnWidth(30)
private String openDuration;
@ExcelProperty(value = "缴纳加盟费/保证金",order =38)
@ColumnWidth(30)
private String franchiseFeeStageStatus;
@ExcelProperty(value = "加盟合同签约",order =39)
@ColumnWidth(30)
private String signFranchiseStageStatus ;
@ExcelProperty(value = "合同金额",order =40)
@ColumnWidth(30)
private String contractAmount;

View File

@@ -165,4 +165,5 @@ public class AddSignFranchiseResponse {
@ApiModelProperty("合同金额")
private String contractAmount;
}

View File

@@ -20,7 +20,7 @@ public interface LineService {
* @param lineId
* @return
*/
LineInfoVO getLineInfo(Long lineId);
LineInfoVO getLineInfo(Long lineId,String userId);
/**

View File

@@ -168,6 +168,7 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
dto.setContractCode(signFranchiseDO.getContractCode());
dto.setContractStartTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getContractStartTime()));
dto.setContractEndTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getContractEndTime()));
dto.setSignTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getCreateTime()));
}
List<Date> payTime = payTimeMap.getOrDefault(response.getShopId(), new ArrayList<>());
for (int i = 0; i < payTime.size() && i <= 3; i++) {
@@ -200,6 +201,9 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
}
Integer franchiseFeeStageStatus = franchiseFeeStageMap.getOrDefault(response.getShopId(), 0);
switch (franchiseFeeStageStatus) {
case -100:
dto.setFranchiseFeeStageStatus("未开始");
break;
case 700:
dto.setFranchiseFeeStageStatus("待提交账单");
break;
@@ -219,6 +223,9 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
}
Integer signFranchisesStageStatus = signFranchisesStageMap.getOrDefault(response.getShopId(), 0);
switch (signFranchisesStageStatus) {
case -100:
dto.setFranchiseFeeStageStatus("未开始");
break;
case 800:
dto.setSignFranchiseStageStatus("待提交");
break;

View File

@@ -1,7 +1,6 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.LoginUserInfo;
@@ -12,10 +11,8 @@ import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.mapper.RegionMapper;
import com.cool.store.request.*;
import com.cool.store.service.*;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.UUIDUtils;
import com.cool.store.utils.poi.DateUtils;
@@ -30,7 +27,6 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Author suzhuhong
@@ -86,7 +82,7 @@ public class LineServiceImpl implements LineService {
@Override
public LineInfoVO getLineInfo(Long lineId) {
public LineInfoVO getLineInfo(Long lineId,String currentUserId) {
LineInfoVO result = new LineInfoVO();
// 查询线索信息
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
@@ -100,8 +96,16 @@ public class LineServiceImpl implements LineService {
Map<Integer, String> channelMapByIds = hyPartnerUserChannelDAO.getChannelMapByIds(Arrays.asList(lineInfo.getLineSource()));
result.setLineSourceName(channelMapByIds.get(lineInfo.getLineSource()));
}
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectInvestmentByLines(Collections.singletonList(lineInfo.getId()));
List<Long> regionId = new ArrayList<>();
if (StringUtils.isNotBlank(currentUserId) && !sysRoleService.checkIsAdmin(currentUserId)) {
List<String> list = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(currentUserId);
if (CollectionUtils.isNotEmpty(list)) {
for (String s : list) {
regionId.add(Long.valueOf(s));
}
}
}
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectByLines(Collections.singletonList(lineInfo.getId()),regionId);
Set<String> userIds = new HashSet<>();
//门店的招生和选址人远
Set<String> shopInvestmentMserIds = shopInfoDOS.stream().map(ShopInfoDO::getInvestmentManager).filter(StringUtils::isNotBlank).collect(Collectors.toSet());
@@ -287,7 +291,7 @@ public class LineServiceImpl implements LineService {
List<LineInfoDO> lineInfoDOS = lineInfoDAO.partnerList(partnerRequest, areaName, userId, regionId);
PageInfo page = new PageInfo(lineInfoDOS);
List<Long> lineIds = lineInfoDOS.stream().map(LineInfoDO::getId).collect(Collectors.toList());
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectInvestmentByLines(lineIds);
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectByLines(lineIds,regionId);
Map<Long, Set<String>> investmentManagerIdMapByLineId = shopInfoDOS.stream().collect(Collectors.groupingBy(ShopInfoDO::getLineId, Collectors.mapping(ShopInfoDO::getInvestmentManager, Collectors.toSet())));
Map<Long, Set<String>> developmentManagerMap = shopInfoDOS.stream().collect(Collectors.groupingBy(ShopInfoDO::getLineId, Collectors.mapping(ShopInfoDO::getDevelopmentManager, Collectors.toSet())));

View File

@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -287,7 +288,14 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
addSignFranchiseResponse.setMobile(signFranchiseDO.getMobile());
addSignFranchiseResponse.setContractCode(signFranchiseDO.getContractCode());
addSignFranchiseResponse.setContractAmount(signFranchiseDO.getContractAmount());
} else {
BigDecimal total = new BigDecimal(franchiseFeeDO.getYearFranchiseFee())
.add(new BigDecimal(franchiseFeeDO.getLoanMargin()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearFee()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()))
.add(new BigDecimal(franchiseFeeDO.getPerformanceBond()));
addSignFranchiseResponse.setContractAmount(total.toString());
addSignFranchiseResponse.setMobile(lineInfoDO.getMobile());
}
addSignFranchiseResponse.setStoreName(shopInfoDO.getShopName());
@@ -382,8 +390,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
}
}
private List<Date> JsonToDate(String json) {
if (StringUtils.isBlank(json)){
if (StringUtils.isBlank(json)) {
return new ArrayList<>();
}
ObjectMapper mapper = new ObjectMapper();

View File

@@ -48,7 +48,7 @@ public class LineInfoController {
@ApiImplicitParam(name = "lineId", value = "线索id", required = true)
})
public ResponseResult<LineInfoVO> getLineInfo(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(lineService.getLineInfo(lineId));
return ResponseResult.success(lineService.getLineInfo(lineId,CurrentUserHolder.getUserId()));
}
@ApiOperation("我的线索")

View File

@@ -46,7 +46,7 @@ public class LineController {
@ApiImplicitParam(name = "lineId", value = "线索id", required = true)
})
public ResponseResult<LineInfoVO> getLineInfo(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(lineService.getLineInfo(lineId));
return ResponseResult.success(lineService.getLineInfo(lineId, null));
}
@ApiOperation("根据线索id查询大区的支付二维码图片")