Merge branch 'cc_20250605_shopReport' into 'master'
Cc 20250605 shop report See merge request hangzhou/java/custom_zxjp!110
This commit is contained in:
@@ -34,6 +34,8 @@ public class CommonConstants {
|
||||
public static final int FIVE_SECONDS = 5000;
|
||||
|
||||
public static final int MAX_EXPORT_SIZE = 10000;
|
||||
|
||||
public static final int INT_MAX_VALUE = 2147483647;
|
||||
/**
|
||||
* 跟进任务通知缓存时间 1小时
|
||||
*/
|
||||
|
||||
@@ -25,6 +25,7 @@ public enum FileTypeEnum {
|
||||
IMPORT_OA_OLD_SHOP_STAGE_DATA_ERROR("OaOldShopStageDataError", "导入OA旧数据阶段错误列表"),
|
||||
IMPORT_FITMENT_SHOP_STAGE("importFitmentShopStage", "导入装修阶段完成数据"),
|
||||
IMPORT_FITMENT_SHOP_STAGE_DATA_ERROR_LIST("OaOldShopStageDataErrorList", "导入装修阶段完成数据错误列表 "),
|
||||
SELLING_DETAILS_REPORT("sellingDetailsReport", "开店明细报表"),
|
||||
;
|
||||
private String fileType;
|
||||
private String desc;
|
||||
|
||||
@@ -11,7 +11,7 @@ public enum JoinModeEnum {
|
||||
FRANCHISE_COMPANIES(2,"加盟公司加盟店"),
|
||||
OWN_STORE(3,"加盟公司自有店"),
|
||||
STRONG_FRANCHISE(4,"强加盟"),
|
||||
DIRECT_SALES_TO_JOINING(5,"直营转加盟")
|
||||
DIRECT_SALES_TO_JOINING(5,"老店转加盟")
|
||||
;
|
||||
private int code;
|
||||
private String desc;
|
||||
|
||||
@@ -486,9 +486,16 @@
|
||||
</select>
|
||||
<select id="getShopFranchiseReportList" resultType="com.cool.store.dto.FranchiseReportDTO">
|
||||
select
|
||||
|
||||
a.id as shopId,
|
||||
a.region_id as regionId,
|
||||
a.store_type as storeType
|
||||
a.store_type as storeType,
|
||||
a.shop_code as shopCode,
|
||||
a.investment_manager as investmentManager,
|
||||
a.shop_name as shopName,
|
||||
a.join_mode as joinMode,
|
||||
a.franchise_brand as franchiseBrand,
|
||||
b.actual_complete_time as actualCompleteTime
|
||||
from xfsg_shop_info a
|
||||
left join xfsg_shop_stage_info b on a.id = b.shop_id
|
||||
where
|
||||
@@ -507,6 +514,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
and b.actual_complete_time >= #{request.buildStartTime} and b.actual_complete_time <= #{request.buildEndTime}
|
||||
order by b.actual_complete_time desc
|
||||
</select>
|
||||
<select id="selectShopListByUser" resultType="com.cool.store.entity.ShopInfoDO">
|
||||
select
|
||||
|
||||
@@ -16,4 +16,11 @@ public class FranchiseReportDTO {
|
||||
private Long regionId;
|
||||
|
||||
private Integer storeType;
|
||||
|
||||
private String actualCompleteTime;
|
||||
private String franchiseBrand;
|
||||
private String investmentManager;
|
||||
private Integer joinMode;
|
||||
private String shopCode;
|
||||
private String shopName;
|
||||
}
|
||||
|
||||
@@ -30,4 +30,7 @@ public class FranchiseReportRequest {
|
||||
|
||||
@ApiModelProperty(value = "建店完成结束时间 时间格式 2025-05-01 23:59:59")
|
||||
private String buildEndTime;
|
||||
|
||||
private Integer pageNum=1;
|
||||
private Integer pageSize=10;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/06/05/11:03
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class ShopReportResponse {
|
||||
|
||||
@ApiModelProperty(value = "建店完成日期")
|
||||
@ExcelProperty(value = "日期",order = 1)
|
||||
@ColumnWidth(25)
|
||||
private String buildTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "加盟品牌")
|
||||
@ExcelProperty(value = "加盟品牌",order = 2)
|
||||
@ColumnWidth(25)
|
||||
private String franchiseBrand;
|
||||
|
||||
@ApiModelProperty(value = "所属加盟集团")
|
||||
@ExcelProperty(value = "所属加盟集团",order = 3)
|
||||
@ColumnWidth(25)
|
||||
private String joinGroupName;
|
||||
|
||||
@ApiModelProperty(value = "所属大区")
|
||||
@ExcelProperty(value = "所属大区",order = 4)
|
||||
@ColumnWidth(20)
|
||||
private String regionName;
|
||||
|
||||
@ApiModelProperty(value = "督导")
|
||||
@ExcelProperty(value = "督导",order = 5)
|
||||
@ColumnWidth(15)
|
||||
private String investmentManagerName ;
|
||||
|
||||
@ApiModelProperty(value = "加盟模式")
|
||||
@ExcelProperty(value = "加盟模式",order = 6)
|
||||
@ColumnWidth(15)
|
||||
private String joinMode ;
|
||||
|
||||
@ApiModelProperty(value = "门店编码")
|
||||
@ExcelProperty(value = "门店编码",order = 7)
|
||||
@ColumnWidth(15)
|
||||
private String shopCode ;
|
||||
|
||||
@ApiModelProperty(value = "门店名称")
|
||||
@ExcelProperty(value = "门店名称",order = 8)
|
||||
@ColumnWidth(15)
|
||||
private String shopName ;
|
||||
|
||||
@ApiModelProperty(value = "门店类型")
|
||||
@ExcelProperty(value = "门店类型",order = 9)
|
||||
@ColumnWidth(15)
|
||||
private String storeType ;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "加盟费")
|
||||
@ExcelProperty(value = "加盟费",order = 10)
|
||||
@ColumnWidth(20)
|
||||
private BigDecimal franchiseFee = BigDecimal.ZERO;
|
||||
|
||||
@ApiModelProperty(value = "品牌费")
|
||||
@ExcelProperty(value = "品牌费",order = 11)
|
||||
@ColumnWidth(20)
|
||||
private BigDecimal firstYearBrandingFee = BigDecimal.ZERO;
|
||||
|
||||
@ApiModelProperty(value = "管理费")
|
||||
@ExcelProperty(value = "管理费",order = 12)
|
||||
@ColumnWidth(20)
|
||||
private BigDecimal firstYearManagementFee = BigDecimal.ZERO;
|
||||
|
||||
@ApiModelProperty(value = "设计费")
|
||||
@ExcelProperty(value = "设计费",order = 13)
|
||||
@ColumnWidth(20)
|
||||
private BigDecimal performanceBond = BigDecimal.ZERO;
|
||||
|
||||
@ApiModelProperty(value = "管理/品牌/设计费")
|
||||
@ExcelProperty(value = "管理/品牌/设计费",order = 14)
|
||||
@ColumnWidth(25)
|
||||
private BigDecimal managementBrandingDesignFeeTotal = BigDecimal.ZERO;
|
||||
|
||||
@ApiModelProperty(value = "保证金")
|
||||
@ExcelProperty(value = "保证金",order = 15)
|
||||
@ColumnWidth(20)
|
||||
private BigDecimal loanMargin = BigDecimal.ZERO;
|
||||
|
||||
@ApiModelProperty(value = "收款金额总计")
|
||||
@ExcelProperty(value = "收款金额总计=加盟费+管理/品牌/设计费+保证金",order = 16)
|
||||
@ColumnWidth(25)
|
||||
private BigDecimal total = BigDecimal.ZERO;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long regionId;
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.request.FranchiseReportRequest;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.response.FranchiseReportResponse;
|
||||
import com.cool.store.response.ShopReportResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -28,4 +29,6 @@ public interface ExportRealizeService {
|
||||
void exportProgress(List<BranchShopResponse> list,ImportTaskDO importTaskDO);
|
||||
|
||||
void exportZxjpOpenShopReport(List<FranchiseReportResponse> list, ImportTaskDO importTaskDO, FranchiseReportRequest request);
|
||||
|
||||
void exportZxjpOpenShopReportPage(List<ShopReportResponse> list, ImportTaskDO importTaskDO, FranchiseReportRequest request);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.enums.FileTypeEnum;
|
||||
import com.cool.store.request.*;
|
||||
@@ -18,8 +19,10 @@ public interface ExportService {
|
||||
//财务导出 //加盟开店申请 //进度确认
|
||||
Long exportProgressBase(BranchShopRequest request, LoginUserInfo user, FileTypeEnum fileTypeEnum);
|
||||
|
||||
//正新加盟报表导出
|
||||
//正新鸡排加盟报表导出
|
||||
Long exportZxjpOpenShopReport(FranchiseReportRequest request, LoginUserInfo user);
|
||||
|
||||
//正新鸡排门店维度加盟导出
|
||||
Long exportZxjpOpenShopReportPage(FranchiseReportRequest request, LoginUserInfo user);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.FranchiseReportRequest;
|
||||
import com.cool.store.response.FranchiseReportResponse;
|
||||
import com.cool.store.response.ShopReportResponse;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -15,4 +16,6 @@ import java.util.List;
|
||||
public interface FranchiseReportService {
|
||||
|
||||
List<FranchiseReportResponse> zxjpOpenShopReport(FranchiseReportRequest request);
|
||||
//门店维度
|
||||
PageInfo<ShopReportResponse> zxjpOpenShopReportPage(FranchiseReportRequest request);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.cool.store.request.FranchiseReportRequest;
|
||||
import com.cool.store.request.InitiatingRequest;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.response.FranchiseReportResponse;
|
||||
import com.cool.store.response.ShopReportResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.JSONUtils;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
@@ -667,6 +668,37 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void exportZxjpOpenShopReportPage(List<ShopReportResponse> list, ImportTaskDO importTaskDO, FranchiseReportRequest request) {
|
||||
String url = "";
|
||||
try {
|
||||
ShopReportResponse total = new ShopReportResponse();
|
||||
total.setBuildTime("总计");
|
||||
for (ShopReportResponse response : list){
|
||||
total.setTotal(total.getTotal().add(response.getTotal()));
|
||||
total.setFranchiseFee(total.getFranchiseFee().add(response.getFranchiseFee()));
|
||||
total.setFirstYearBrandingFee(total.getFirstYearBrandingFee().add(response.getFirstYearBrandingFee()));
|
||||
total.setFirstYearManagementFee(total.getFirstYearManagementFee().add(response.getFirstYearManagementFee()));
|
||||
total.setPerformanceBond(total.getPerformanceBond().add(response.getPerformanceBond()));
|
||||
total.setManagementBrandingDesignFeeTotal(total.getManagementBrandingDesignFeeTotal().add(response.getManagementBrandingDesignFeeTotal()));
|
||||
total.setLoanMargin(total.getLoanMargin().add(response.getLoanMargin()));
|
||||
}
|
||||
list.add(total);
|
||||
url = easyExcelUtil.exportExcelSpecial(ShopReportResponse.class, list, null,
|
||||
FileTypeEnum.SELLING_DETAILS_REPORT.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()),
|
||||
FileTypeEnum.SELLING_DETAILS_REPORT.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()),
|
||||
"建店资料完成日期:",request.getBuildStartTime(),request.getBuildEndTime());
|
||||
} catch (Throwable e) {
|
||||
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.SELLING_DETAILS_REPORT.getDesc(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.INTERNAL_SERVER_ERROR);
|
||||
} finally {
|
||||
importTaskDO.setStatus(ImportStatusEnum.success.getCode());
|
||||
importTaskDO.setFileUrl(url);
|
||||
importTaskMapper.update(eid, importTaskDO);
|
||||
}
|
||||
}
|
||||
|
||||
private String toString(Object o) {
|
||||
if (o == null) {
|
||||
return "";
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.cool.store.mapper.PointInfoMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
import com.cool.store.response.FranchiseReportResponse;
|
||||
import com.cool.store.response.ShopReportResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.easyExcel.EasyExcelUtil;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
@@ -161,5 +162,28 @@ public class ExportServiceImpl implements ExportService {
|
||||
return (long) franchiseReport.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long exportZxjpOpenShopReportPage(FranchiseReportRequest request, LoginUserInfo user) {
|
||||
request.setPageSize(CommonConstants.INT_MAX_VALUE);
|
||||
request.setPageNum(CommonConstants.ONE);
|
||||
PageInfo<ShopReportResponse> pageInfo = franchiseReportService.zxjpOpenShopReportPage(request);
|
||||
List<ShopReportResponse> list = pageInfo.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
log.error("导出数据为空");
|
||||
return 0L;
|
||||
}
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
|
||||
importTaskDO.setFileName(FileTypeEnum.SELLING_DETAILS_REPORT.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
importTaskDO.setIsImport(Boolean.FALSE);
|
||||
importTaskDO.setFileType(FileTypeEnum.SELLING_DETAILS_REPORT.getFileType());
|
||||
importTaskDO.setCreateUserId(user.getUserId());
|
||||
importTaskDO.setCreateTime(new Date().getTime());
|
||||
importTaskDO.setCreateName(user.getName());
|
||||
importTaskMapper.insert(eid, importTaskDO);
|
||||
exportRealizeService.exportZxjpOpenShopReportPage(list, importTaskDO,request);
|
||||
return (long) list.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.BigRegionDAO;
|
||||
import com.cool.store.dao.FranchiseFeeDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.FranchiseReportDTO;
|
||||
import com.cool.store.entity.BigRegionDO;
|
||||
import com.cool.store.entity.FranchiseFeeDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.FranchiseBrandEnum;
|
||||
import com.cool.store.enums.JoinModeEnum;
|
||||
import com.cool.store.enums.StoreTypeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.FranchiseFeeMapper;
|
||||
import com.cool.store.request.FranchiseReportRequest;
|
||||
import com.cool.store.response.FranchiseReportResponse;
|
||||
import com.cool.store.response.ShopReportResponse;
|
||||
import com.cool.store.service.FranchiseReportService;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import groovy.util.logging.Log4j;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -39,12 +41,16 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class FranchiseReportServiceImpl implements FranchiseReportService {
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
private BigRegionDAO bigRegionDAO;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
private FranchiseFeeMapper franchiseFeeMapper;
|
||||
@Resource
|
||||
private RegionDao regionDao;
|
||||
|
||||
@Override
|
||||
public List<FranchiseReportResponse> zxjpOpenShopReport(FranchiseReportRequest request) {
|
||||
@@ -147,8 +153,8 @@ public class FranchiseReportServiceImpl implements FranchiseReportService {
|
||||
List<FranchiseReportDTO> yesterdayShopFranchiseReportList = shopInfoDAO.getShopFranchiseReportList(yesterdayRequest);
|
||||
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
Map<Long, List<FranchiseReportDTO>> yesterdayMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(yesterdayShopFranchiseReportList)){
|
||||
yesterdayMap = yesterdayShopFranchiseReportList.stream().collect(Collectors.groupingBy(FranchiseReportDTO::getRegionId));
|
||||
if (CollectionUtils.isNotEmpty(yesterdayShopFranchiseReportList)) {
|
||||
yesterdayMap = yesterdayShopFranchiseReportList.stream().collect(Collectors.groupingBy(FranchiseReportDTO::getRegionId));
|
||||
}
|
||||
//查集团维度
|
||||
if (CollectionUtils.isEmpty(request.getJoinGroupName()) && CollectionUtils.isEmpty(request.getRegionIds())) {
|
||||
@@ -190,6 +196,86 @@ public class FranchiseReportServiceImpl implements FranchiseReportService {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<ShopReportResponse> zxjpOpenShopReportPage(FranchiseReportRequest request) {
|
||||
if (StringUtils.isBlank(request.getBuildStartTime()) || StringUtils.isBlank(request.getBuildEndTime())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TIME_NULL_FALSE);
|
||||
}
|
||||
//集团查大区
|
||||
List<Long> regionIdByGroupName = bigRegionDAO.getRegionIdByGroupName(request.getJoinGroupName());
|
||||
if (CollectionUtils.isNotEmpty(regionIdByGroupName)) {
|
||||
if (CollectionUtils.isEmpty(request.getRegionIds())) {
|
||||
request.setRegionIds(regionIdByGroupName);
|
||||
} else {
|
||||
request.getRegionIds().retainAll(regionIdByGroupName);
|
||||
if (CollectionUtils.isEmpty(request.getRegionIds())) {
|
||||
throw new ServiceException(ErrorCodeEnum.REGION_INTERSECTION_IS_NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<FranchiseReportDTO> shopFranchiseReportList = shopInfoDAO.getShopFranchiseReportList(request);
|
||||
if (CollectionUtils.isEmpty(shopFranchiseReportList)) {
|
||||
log.info("查询门店数据为空");
|
||||
return null;
|
||||
}
|
||||
PageInfo franchiseReportDTOPageInfo = new PageInfo<>(shopFranchiseReportList);
|
||||
List<Long> shopIds = shopFranchiseReportList.stream().map(FranchiseReportDTO::getShopId).collect(Collectors.toList());
|
||||
Set<Long> regionSet = shopFranchiseReportList.stream().map(FranchiseReportDTO::getRegionId).collect(Collectors.toSet());
|
||||
Set<String> investmentManagerUsers = shopFranchiseReportList.stream().map(FranchiseReportDTO::getInvestmentManager).collect(Collectors.toSet());
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(investmentManagerUsers));
|
||||
//加盟费账单
|
||||
List<FranchiseFeeDO> franchiseFeeList = franchiseFeeMapper.getFranchiseFeeByShopIds(shopIds);
|
||||
Map<Long, FranchiseFeeDO> franchiseFeeMap = franchiseFeeList.stream().collect(Collectors.toMap(FranchiseFeeDO::getShopId, franchiseFeeDO -> franchiseFeeDO));
|
||||
List<BigRegionDO> bigRegionDOList = bigRegionDAO.getByRegionIdList(new ArrayList<>(regionSet));
|
||||
Map<Long, BigRegionDO> bigRegionDOMap = bigRegionDOList.stream().collect(Collectors.toMap(BigRegionDO::getRegionId, bigRegionDO -> bigRegionDO));
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(new ArrayList<>(regionSet));
|
||||
List<ShopReportResponse> list = new ArrayList<>();
|
||||
for (FranchiseReportDTO shopFranchiseReportDTO : shopFranchiseReportList) {
|
||||
BigRegionDO bigRegionDO = bigRegionDOMap.getOrDefault(shopFranchiseReportDTO.getRegionId(), new BigRegionDO());
|
||||
String regionName = regionNameMap.getOrDefault(shopFranchiseReportDTO.getRegionId(), "");
|
||||
ShopReportResponse response = new ShopReportResponse();
|
||||
response.setRegionId(shopFranchiseReportDTO.getRegionId());
|
||||
response.setRegionName(regionName);
|
||||
String groupName = bigRegionDO.getGroupName();
|
||||
if (StringUtils.isBlank(groupName)) {
|
||||
response.setJoinGroupName("-");
|
||||
} else {
|
||||
response.setJoinGroupName(groupName);
|
||||
}
|
||||
response.setBuildTime(shopFranchiseReportDTO.getActualCompleteTime());
|
||||
response.setShopCode(shopFranchiseReportDTO.getShopCode());
|
||||
response.setShopName(shopFranchiseReportDTO.getShopName());
|
||||
response.setStoreType(StoreTypeEnum.getMessage(shopFranchiseReportDTO.getStoreType()));
|
||||
response.setJoinMode(JoinModeEnum.getByCode(shopFranchiseReportDTO.getJoinMode()));
|
||||
response.setFranchiseBrand(FranchiseBrandEnum.getDescByCode(shopFranchiseReportDTO.getFranchiseBrand()));
|
||||
response.setInvestmentManagerName(userNameMap.getOrDefault(shopFranchiseReportDTO.getInvestmentManager(), ""));
|
||||
FranchiseFeeDO franchiseFeeDO = franchiseFeeMap.get(shopFranchiseReportDTO.getShopId());
|
||||
if (franchiseFeeDO != null) {
|
||||
response.setFranchiseFee(response.getFranchiseFee().add(new BigDecimal(franchiseFeeDO.getYearFranchiseFee())));
|
||||
response.setLoanMargin(response.getLoanMargin().add(new BigDecimal(franchiseFeeDO.getLoanMargin())));
|
||||
response.setFirstYearManagementFee(response.getFirstYearManagementFee().add(new BigDecimal(franchiseFeeDO.getFirstYearManageFee())));
|
||||
response.setFirstYearBrandingFee(response.getFirstYearBrandingFee().add(new BigDecimal(franchiseFeeDO.getFirstYearFee())));
|
||||
response.setPerformanceBond(response.getPerformanceBond().add(new BigDecimal(franchiseFeeDO.getPerformanceBond())));
|
||||
response.setManagementBrandingDesignFeeTotal(response.getManagementBrandingDesignFeeTotal()
|
||||
.add(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()))
|
||||
.add(new BigDecimal(franchiseFeeDO.getFirstYearFee()))
|
||||
.add(new BigDecimal(franchiseFeeDO.getPerformanceBond())));
|
||||
response.setTotal(response.getTotal()
|
||||
.add(response.getManagementBrandingDesignFeeTotal())
|
||||
.add(response.getLoanMargin())
|
||||
.add(response.getFranchiseFee()));
|
||||
}
|
||||
list.add(response);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
log.info("数据为空");
|
||||
return null;
|
||||
}
|
||||
franchiseReportDTOPageInfo.setList(list);
|
||||
return franchiseReportDTOPageInfo;
|
||||
}
|
||||
|
||||
public static void sortByName(List<FranchiseReportResponse> list) {
|
||||
list.sort(Comparator.comparingInt(f -> extractNumberFromName(f.getJoinGroupName())));
|
||||
}
|
||||
|
||||
@@ -215,18 +215,20 @@ public class LinePayServiceImpl implements LinePayService {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
LinePayDO linePayDO = LinePaySubmitRequest.convertFranchiseFee(request);
|
||||
linePayDO.setPartnerId(lineInfo.getPartnerId());
|
||||
linePayDO.setCreateUserId(userId);
|
||||
linePayDO.setCreateTime(new Date());
|
||||
if (linePayDO.getId() != null) {
|
||||
LinePayDO linePayById = linePayDAO.getById(linePayDO.getId());
|
||||
if (linePayById == null) {
|
||||
log.info("linePayById is null");
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_ERROR);
|
||||
} else {
|
||||
linePayDO.setUpdateTime(new Date());
|
||||
linePayDO.setUpdateUserId(userId);
|
||||
linePayDAO.updateLinePay(linePayDO);
|
||||
}
|
||||
linePayDO.setPaymentReceiptCode(linePayById.getPaymentReceiptCode());
|
||||
} else {
|
||||
linePayDO.setCreateUserId(userId);
|
||||
linePayDO.setCreateTime(new Date());
|
||||
linePayDO.setPaymentReceiptCode(getPaymentReceiptCode());
|
||||
Long payId = linePayDAO.addLinePay(linePayDO);
|
||||
linePayDO.setId(payId);
|
||||
|
||||
@@ -58,8 +58,14 @@ public class ExportController {
|
||||
}
|
||||
|
||||
@PostMapping("/zxjpOpenShopReport")
|
||||
@ApiOperation("正新鸡排开店")
|
||||
@ApiOperation("正新鸡排开店导出")
|
||||
public ResponseResult zxjpOpenShopReport(@RequestBody FranchiseReportRequest request) {
|
||||
return ResponseResult.success(exportService.exportZxjpOpenShopReport(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@PostMapping("/zxjpOpenShopReportPage")
|
||||
@ApiOperation("正新鸡排开店明细报表导出")
|
||||
public ResponseResult zxjpOpenShopReportPage(@RequestBody FranchiseReportRequest request) {
|
||||
return ResponseResult.success(exportService.exportZxjpOpenShopReportPage(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.request.FranchiseReportRequest;
|
||||
import com.cool.store.response.FranchiseReportResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.ShopReportResponse;
|
||||
import com.cool.store.service.FranchiseReportService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -32,4 +34,10 @@ public class PCFranchiseReportController {
|
||||
public ResponseResult< List<FranchiseReportResponse>> getList(@RequestBody FranchiseReportRequest request) {
|
||||
return ResponseResult.success( franchiseReportService.zxjpOpenShopReport(request));
|
||||
}
|
||||
|
||||
@RequestMapping("/getZxjpOpenShopReportPage")
|
||||
@ApiOperation("正新鸡排开店明细")
|
||||
public ResponseResult<PageInfo<ShopReportResponse>> ZxjpOpenShopReportPage(@RequestBody FranchiseReportRequest request) {
|
||||
return ResponseResult.success( franchiseReportService.zxjpOpenShopReportPage(request));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user