Merge branch 'cc20240703_prefried' into 'master'
Cc20240703 prefried See merge request hangzhou/java/custom_zxjp!127
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementDTO;
|
||||
import com.cool.store.entity.ImportTaskDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
@@ -31,4 +32,5 @@ public interface ExportRealizeService {
|
||||
void exportZxjpOpenShopReport(List<FranchiseReportResponse> list, ImportTaskDO importTaskDO, FranchiseReportRequest request);
|
||||
|
||||
void exportZxjpOpenShopReportPage(List<ShopReportResponse> list, ImportTaskDO importTaskDO, FranchiseReportRequest request);
|
||||
void exportPreFryQualificationApply(List<ApplyManagementDTO> list, ImportTaskDO importTaskDO);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementQueryDTO;
|
||||
import com.cool.store.enums.FileTypeEnum;
|
||||
import com.cool.store.request.*;
|
||||
|
||||
@@ -15,14 +16,32 @@ public interface ExportService {
|
||||
|
||||
Long branchShopList(BranchShopRequest request,LoginUserInfo user);
|
||||
|
||||
//进度管理页面通用导出入口
|
||||
//财务导出 //加盟开店申请 //进度确认
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/7/3
|
||||
* @description://进度管理页面通用导出入口
|
||||
* //财务导出 //加盟开店申请 //进度确认
|
||||
*/
|
||||
Long exportProgressBase(BranchShopRequest request, LoginUserInfo user, FileTypeEnum fileTypeEnum);
|
||||
|
||||
//正新鸡排加盟报表导出
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/7/3
|
||||
* @description: //正新鸡排加盟报表导出
|
||||
*/
|
||||
Long exportZxjpOpenShopReport(FranchiseReportRequest request, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/7/3
|
||||
* @description:
|
||||
//正新鸡排门店维度加盟导出
|
||||
*/
|
||||
Long exportZxjpOpenShopReportPage(FranchiseReportRequest request, LoginUserInfo user);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/7/3
|
||||
* @description:预炸资质申请管理
|
||||
*/
|
||||
Long exportPreFryQualificationApply(ApplyManagementQueryDTO request, LoginUserInfo user);
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.*;
|
||||
@@ -699,6 +700,39 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void exportPreFryQualificationApply(List<ApplyManagementDTO> list, ImportTaskDO importTaskDO) {
|
||||
String url = "";
|
||||
try {
|
||||
for (ApplyManagementDTO dto : list){
|
||||
dto.setApplyTypeName(PreFryApplyTypeEnum.getDescriptionByCode(dto.getApplyType()));
|
||||
dto.setCreateTimeStr(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START,dto.getCreateTime()));
|
||||
switch (dto.getAuditStatus()){
|
||||
case 0:
|
||||
dto.setAuditStatusName("审批中");
|
||||
break;
|
||||
case 1:
|
||||
dto.setAuditStatusName("审核通过");
|
||||
break;
|
||||
case 2:
|
||||
dto.setAuditStatusName("审核不通过");
|
||||
break;
|
||||
}
|
||||
}
|
||||
url = easyExcelUtil.exportExcel(ApplyManagementDTO.class, list, null,
|
||||
FileTypeEnum.PRE_FRY_QUALIFICATION_APPLY_EXPORT.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()),
|
||||
FileTypeEnum.PRE_FRY_QUALIFICATION_APPLY_EXPORT.getDesc() + DateUtils.parseDateToStr(SPECIAL_DATE_START_1, new Date()));
|
||||
} catch (Throwable e) {
|
||||
log.error("fileUpload upload err, originFileName={}", FileTypeEnum.PRE_FRY_QUALIFICATION_APPLY_EXPORT.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 "";
|
||||
|
||||
@@ -6,9 +6,12 @@ import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.PreFryQualificationApplyDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementDTO;
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementQueryDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.FileTypeEnum;
|
||||
@@ -75,6 +78,8 @@ public class ExportServiceImpl implements ExportService {
|
||||
private ShopService shopService;
|
||||
@Resource
|
||||
private FranchiseReportService franchiseReportService;
|
||||
@Resource
|
||||
private PreFryQualificationApplyDAO preFryQualificationApplyDAO;
|
||||
|
||||
|
||||
|
||||
@@ -185,5 +190,25 @@ public class ExportServiceImpl implements ExportService {
|
||||
return (long) list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long exportPreFryQualificationApply(ApplyManagementQueryDTO request, LoginUserInfo user) {
|
||||
List<ApplyManagementDTO> list = preFryQualificationApplyDAO.selectApplyManagementList(request);
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
log.error("导出数据为空");
|
||||
return 0L;
|
||||
}
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
|
||||
importTaskDO.setFileName(FileTypeEnum.PRE_FRY_QUALIFICATION_APPLY_EXPORT.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
importTaskDO.setIsImport(Boolean.FALSE);
|
||||
importTaskDO.setFileType(FileTypeEnum.PRE_FRY_QUALIFICATION_APPLY_EXPORT.getFileType());
|
||||
importTaskDO.setCreateUserId(user.getUserId());
|
||||
importTaskDO.setCreateTime(new Date().getTime());
|
||||
importTaskDO.setCreateName(user.getName());
|
||||
importTaskMapper.insert(eid, importTaskDO);
|
||||
exportRealizeService.exportPreFryQualificationApply(list, importTaskDO);
|
||||
return (long) list.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,17 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.PreFryApprovalRecordsDAO;
|
||||
import com.cool.store.dao.PreFryQualificationApplyDAO;
|
||||
import com.cool.store.dao.RegionDao;
|
||||
import com.cool.store.dto.pre.fry.*;
|
||||
import com.cool.store.entity.PreFryApprovalRecordsDO;
|
||||
import com.cool.store.entity.PreFryQualificationApplyDO;
|
||||
import com.cool.store.enums.AuditOperationTypeEnum;
|
||||
import com.cool.store.enums.AuditStatusEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.PreFryApplyTypeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.service.PreFryQualificationApplyService;
|
||||
import com.cool.store.userholder.CurrentUser;
|
||||
@@ -17,16 +20,15 @@ import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -40,6 +42,10 @@ public class PreFryQualificationApplyServiceImpl implements PreFryQualificationA
|
||||
private PreFryQualificationApplyDAO preFryQualificationApplyDAO;
|
||||
@Resource
|
||||
private PreFryApprovalRecordsDAO preFryApprovalRecordsDAO;
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
private RegionDao regionDao;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -125,6 +131,16 @@ public class PreFryQualificationApplyServiceImpl implements PreFryQualificationA
|
||||
public PageInfo<ApplyManagementDTO> queryApplyManagementList(ApplyManagementQueryDTO query) {
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
List<ApplyManagementDTO> applyManagementDTOS = preFryQualificationApplyDAO.selectApplyManagementList(query);
|
||||
// if (CollectionUtils.isNotEmpty(applyManagementDTOS)){
|
||||
// Set<String> userIds = applyManagementDTOS.stream().map(ApplyManagementDTO::getInvestmentManagerId).collect(Collectors.toSet());
|
||||
// Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(userIds));
|
||||
// Set<Long> regionIds = applyManagementDTOS.stream().map(ApplyManagementDTO::getRegionId).collect(Collectors.toSet());
|
||||
// Map<Long, String> regionNameMap = regionDao.getRegionNameMap(new ArrayList<>(regionIds));
|
||||
// for (ApplyManagementDTO applyManagementDTO:applyManagementDTOS){
|
||||
// applyManagementDTO.setInvestmentManagerName(userNameMap.getOrDefault(applyManagementDTO.getInvestmentManagerId(), ""));
|
||||
// applyManagementDTO.setRegionName(regionNameMap.getOrDefault(applyManagementDTO.getRegionId(), ""));
|
||||
// }
|
||||
// }
|
||||
return new PageInfo<>(applyManagementDTOS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user