Merge branch 'cc20240703_prefried' into 'master'
Cc20240703 prefried See merge request hangzhou/java/custom_zxjp!127
This commit is contained in:
@@ -26,6 +26,7 @@ public enum FileTypeEnum {
|
||||
IMPORT_FITMENT_SHOP_STAGE("importFitmentShopStage", "导入装修阶段完成数据"),
|
||||
IMPORT_FITMENT_SHOP_STAGE_DATA_ERROR_LIST("OaOldShopStageDataErrorList", "导入装修阶段完成数据错误列表 "),
|
||||
SELLING_DETAILS_REPORT("sellingDetailsReport", "开店明细报表"),
|
||||
PRE_FRY_QUALIFICATION_APPLY_EXPORT("preFryQualificationApplyExport", "预炸品资质申请导出"),
|
||||
;
|
||||
private String fileType;
|
||||
private String desc;
|
||||
|
||||
@@ -11,7 +11,8 @@ public enum JoinModeEnum {
|
||||
FRANCHISE_COMPANIES(2,"加盟公司加盟店"),
|
||||
OWN_STORE(3,"加盟公司自有店"),
|
||||
STRONG_FRANCHISE(4,"强加盟"),
|
||||
DIRECT_SALES_TO_JOINING(5,"老店转加盟")
|
||||
DIRECT_SALES_TO_JOINING(5,"老店转加盟"),
|
||||
AFFILIATES(6,"联营店")
|
||||
;
|
||||
private int code;
|
||||
private String desc;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.cool.store.dto.pre.fry;
|
||||
|
||||
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;
|
||||
|
||||
@@ -12,25 +15,71 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
public class ApplyManagementDTO {
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty(value = "门店编号",order = 3)
|
||||
@ApiModelProperty("门店Code")
|
||||
@ColumnWidth(30)
|
||||
private String storeCode;
|
||||
|
||||
@ExcelProperty(value = "门店名称",order = 2)
|
||||
@ApiModelProperty("门店名称")
|
||||
@ColumnWidth(30)
|
||||
private String storeName;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty(value = "申请单号",order = 1)
|
||||
@ApiModelProperty("申请单号")
|
||||
private String applyCode;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("申请类型:1-有冷藏展示柜,2-有常温展示柜,3-无展示柜 ")
|
||||
private Integer applyType;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty(value = "申请类型",order =4)
|
||||
private String applyTypeName;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("申请人ID")
|
||||
private String createUserId;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty(value = "申请人",order = 5)
|
||||
@ApiModelProperty("申请人名称")
|
||||
private String createUserName;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty(value = "申请人手机号",order =6)
|
||||
@ApiModelProperty("申请人手机号")
|
||||
private String createUserMobile;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty(value = "申请时间",order = 7)
|
||||
private String createTimeStr;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("申请时间")
|
||||
private Date createTime;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty(value = "审核状态",order =8)
|
||||
private String auditStatusName;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("审核状态:0-审批中,1-审核通过,2-审核不通过")
|
||||
private Integer auditStatus;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("所属大区")
|
||||
private String regionName;
|
||||
@ExcelIgnore
|
||||
private Long regionId;
|
||||
@ExcelIgnore
|
||||
private String investmentManagerId;
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("督导")
|
||||
private String investmentManagerName;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.common.PageBasicInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ApplyManagementQueryDTO extends PageBasicInfo {
|
||||
@@ -25,4 +26,8 @@ public class ApplyManagementQueryDTO extends PageBasicInfo {
|
||||
private Date createTimeEnd;
|
||||
@ApiModelProperty("申请编号")
|
||||
private String applyCode;
|
||||
@ApiModelProperty("所属大区")
|
||||
private List<Long> regionIds;
|
||||
@ApiModelProperty("所属督导")
|
||||
private String investmentManagerId;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ public class AddBranchShopRequest {
|
||||
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(5)
|
||||
@ApiModelProperty(" 加盟模式//'1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店',4-强加盟")
|
||||
private Integer joinMode;
|
||||
@NotBlank
|
||||
|
||||
@@ -22,7 +22,7 @@ public class AddLineRequest {
|
||||
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(5)
|
||||
|
||||
//'1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店',
|
||||
private Integer joinMode;
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ public class BranchShopDetailRequest {
|
||||
private Long regionId;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
@Max(5)
|
||||
@ApiModelProperty("加盟模式 1-社会加盟模式/加盟部加盟店 2-强加盟模式/加盟公司加盟店 3-加盟公司自有店 4- 强加盟")
|
||||
private Integer joinMode;
|
||||
@NotBlank
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementQueryDTO;
|
||||
import com.cool.store.enums.FileTypeEnum;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
@@ -68,4 +69,10 @@ public class ExportController {
|
||||
public ResponseResult zxjpOpenShopReportPage(@RequestBody FranchiseReportRequest request) {
|
||||
return ResponseResult.success(exportService.exportZxjpOpenShopReportPage(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@PostMapping("/preFryQualificationApply")
|
||||
@ApiOperation("预炸品资质申请导出")
|
||||
public ResponseResult preFryQualificationApply(@RequestBody ApplyManagementQueryDTO request) {
|
||||
return ResponseResult.success(exportService.exportPreFryQualificationApply(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user