✨ 完善毛利分析筛选与导出日志
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.bms.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
/** 毛利报表导出日志。 */
|
||||
@Data
|
||||
public class PrcProfitReportExport implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long exportId;
|
||||
/** PRODUCT 产品维度,ORDER 订单维度。 */
|
||||
private String dimension;
|
||||
private String fileName;
|
||||
/** 服务器下载目录下的相对文件名,不返回给前端。 */
|
||||
@JsonIgnore
|
||||
private String storageKey;
|
||||
private Integer rowCount;
|
||||
/** PROCESSING 生成中,SUCCESS 成功,FAILED 失败。 */
|
||||
private String exportStatus;
|
||||
private String exportBy;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date exportTime;
|
||||
private String remark;
|
||||
}
|
||||
+3
-1
@@ -50,10 +50,12 @@ public class PrcProfitReportOrderRow implements Serializable
|
||||
private BigDecimal salesGrossProfit;
|
||||
@Excel(name = "销售毛利率(%)", scale = 4, width = 18)
|
||||
private BigDecimal salesGrossMarginRate;
|
||||
/* 提成字段及 Excel 导出列暂停使用。
|
||||
@Excel(name = "提成比例(%)", scale = 4, width = 16)
|
||||
private BigDecimal commissionRate;
|
||||
@Excel(name = "提成金额", scale = 4, width = 16)
|
||||
private BigDecimal commissionAmount;
|
||||
@Excel(name = "应收状态", width = 14)
|
||||
*/
|
||||
@Excel(name = "应收状态", readConverterExp = "UNBILLED=未出账,PARTIAL=部分出账,BILLED=已出账", width = 14)
|
||||
private String arBillStatus;
|
||||
}
|
||||
|
||||
+2
@@ -37,10 +37,12 @@ public class PrcProfitReportProductRow implements Serializable
|
||||
private BigDecimal salesGrossProfit;
|
||||
@Excel(name = "销售毛利率(%)", scale = 4, width = 18)
|
||||
private BigDecimal salesGrossMarginRate;
|
||||
/* 提成字段及 Excel 导出列暂停使用。
|
||||
@Excel(name = "提成金额", scale = 4, width = 16)
|
||||
private BigDecimal commissionAmount;
|
||||
@Excel(name = "未计算提成订单数", width = 20)
|
||||
private Long commissionMissingOrderCount;
|
||||
*/
|
||||
@Excel(name = "产品价或价格缺失订单数", width = 22)
|
||||
private Long incompleteOrderCount;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,10 @@ public class PrcProfitReportQuery extends BaseEntity
|
||||
private String productCode;
|
||||
private String countryCode;
|
||||
private String currency;
|
||||
/** 订单维度应收状态筛选:UNBILLED、PARTIAL、BILLED。 */
|
||||
private String arBillStatus;
|
||||
/** 是否按产品维度分组值下钻订单明细,允许分组字段为空。 */
|
||||
private Boolean productDrilldown;
|
||||
/** 订单明细弹窗的筛选类型:ALL、COMMISSION_MISSING、INCOMPLETE。 */
|
||||
/** 订单明细弹窗的筛选类型:ALL、INCOMPLETE;COMMISSION_MISSING 暂停使用。 */
|
||||
private String detailType;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ public class PrcProfitReportSummary implements Serializable
|
||||
private BigDecimal salesAmount;
|
||||
private BigDecimal salesGrossProfit;
|
||||
private BigDecimal salesGrossMarginRate;
|
||||
/* 提成汇总指标暂停使用。
|
||||
private BigDecimal commissionAmount;
|
||||
private Long commissionMissingOrderCount;
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.bms.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.price.domain.PrcProfitReportExport;
|
||||
import com.bms.price.domain.vo.PrcProfitReportOrderRow;
|
||||
import com.bms.price.domain.vo.PrcProfitReportProductRow;
|
||||
import com.bms.price.domain.vo.PrcProfitReportQuery;
|
||||
@@ -14,4 +16,15 @@ public interface PrcProfitReportMapper
|
||||
List<PrcProfitReportProductRow> selectProductRows(PrcProfitReportQuery query);
|
||||
|
||||
List<PrcProfitReportSummary> selectSummary(PrcProfitReportQuery query);
|
||||
|
||||
int insertExport(PrcProfitReportExport export);
|
||||
|
||||
int markExportSuccess(PrcProfitReportExport export);
|
||||
|
||||
int markExportFailed(@Param("exportId") Long exportId, @Param("remark") String remark);
|
||||
|
||||
List<PrcProfitReportExport> selectExportsByUser(String exportBy);
|
||||
|
||||
PrcProfitReportExport selectExportByIdAndUser(@Param("exportId") Long exportId,
|
||||
@Param("exportBy") String exportBy);
|
||||
}
|
||||
|
||||
+14
-1
@@ -1,7 +1,8 @@
|
||||
package com.bms.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.price.domain.PrcProfitCommissionRate;
|
||||
// 提成功能暂停使用:import com.bms.price.domain.PrcProfitCommissionRate;
|
||||
import com.bms.price.domain.PrcProfitReportExport;
|
||||
import com.bms.price.domain.vo.PrcProfitReportOrderRow;
|
||||
import com.bms.price.domain.vo.PrcProfitReportProductRow;
|
||||
import com.bms.price.domain.vo.PrcProfitReportQuery;
|
||||
@@ -16,9 +17,21 @@ public interface IPrcProfitReportService
|
||||
|
||||
List<PrcProfitReportSummary> selectSummary(PrcProfitReportQuery query);
|
||||
|
||||
int createExport(PrcProfitReportExport export);
|
||||
|
||||
int completeExport(PrcProfitReportExport export);
|
||||
|
||||
int failExport(Long exportId, String remark);
|
||||
|
||||
List<PrcProfitReportExport> selectExports(String exportBy);
|
||||
|
||||
PrcProfitReportExport selectExport(Long exportId, String exportBy);
|
||||
|
||||
/* 提成比例维护暂停使用。
|
||||
List<PrcProfitCommissionRate> selectCommissionRates();
|
||||
|
||||
void saveCommissionRate(PrcProfitCommissionRate rate);
|
||||
|
||||
int deleteCommissionRate(Long rateId);
|
||||
*/
|
||||
}
|
||||
|
||||
+44
-5
@@ -3,15 +3,16 @@ package com.bms.price.service.impl;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
// 提成功能暂停使用:import java.math.BigDecimal;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
// 提成功能暂停使用:import org.springframework.transaction.annotation.Transactional;
|
||||
import com.bms.common.annotation.DataScope;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.common.utils.SecurityUtils;
|
||||
import com.bms.price.domain.PrcProfitCommissionRate;
|
||||
import com.bms.price.mapper.PrcProfitCommissionRateMapper;
|
||||
// 提成功能暂停使用:import com.bms.common.utils.SecurityUtils;
|
||||
// 提成功能暂停使用:import com.bms.price.domain.PrcProfitCommissionRate;
|
||||
// 提成功能暂停使用:import com.bms.price.mapper.PrcProfitCommissionRateMapper;
|
||||
import com.bms.price.domain.PrcProfitReportExport;
|
||||
import com.bms.price.domain.vo.PrcProfitReportOrderRow;
|
||||
import com.bms.price.domain.vo.PrcProfitReportProductRow;
|
||||
import com.bms.price.domain.vo.PrcProfitReportQuery;
|
||||
@@ -28,8 +29,10 @@ public class PrcProfitReportServiceImpl implements IPrcProfitReportService
|
||||
@Autowired
|
||||
private PrcProfitReportMapper profitReportMapper;
|
||||
|
||||
/* 提成配置依赖暂停使用。
|
||||
@Autowired
|
||||
private PrcProfitCommissionRateMapper commissionRateMapper;
|
||||
*/
|
||||
|
||||
@Override
|
||||
@DataScope(deptAlias = "su", deptField = "dept_id", userAlias = "su", userField = "user_id", permission = "report:profit:list")
|
||||
@@ -55,6 +58,36 @@ public class PrcProfitReportServiceImpl implements IPrcProfitReportService
|
||||
return profitReportMapper.selectSummary(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int createExport(PrcProfitReportExport export)
|
||||
{
|
||||
return profitReportMapper.insertExport(export);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int completeExport(PrcProfitReportExport export)
|
||||
{
|
||||
return profitReportMapper.markExportSuccess(export);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int failExport(Long exportId, String remark)
|
||||
{
|
||||
return profitReportMapper.markExportFailed(exportId, remark);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcProfitReportExport> selectExports(String exportBy)
|
||||
{
|
||||
return profitReportMapper.selectExportsByUser(exportBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrcProfitReportExport selectExport(Long exportId, String exportBy)
|
||||
{
|
||||
return profitReportMapper.selectExportByIdAndUser(exportId, exportBy);
|
||||
}
|
||||
|
||||
/** 将报表的多行输入拆分为去重后的查询条件,支持换行、空格、逗号和分号分隔。 */
|
||||
private void normalizeMultiValueFilters(PrcProfitReportQuery query)
|
||||
{
|
||||
@@ -62,6 +95,10 @@ public class PrcProfitReportServiceImpl implements IPrcProfitReportService
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ("COMMISSION_MISSING".equals(query.getDetailType()))
|
||||
{
|
||||
throw new ServiceException("提成功能已暂停使用");
|
||||
}
|
||||
query.setOrderNos(splitFilterValues(query.getOrderNo(), "订单号"));
|
||||
query.setCustomerCodes(splitFilterValues(query.getCustomerCode(), "客户代码"));
|
||||
query.setCustomerNames(splitFilterValues(query.getCustomerName(), "客户名称"));
|
||||
@@ -88,6 +125,7 @@ public class PrcProfitReportServiceImpl implements IPrcProfitReportService
|
||||
return new ArrayList<>(values);
|
||||
}
|
||||
|
||||
/* 提成比例查询、保存、删除暂停使用,保留原逻辑便于恢复。
|
||||
@Override
|
||||
public List<PrcProfitCommissionRate> selectCommissionRates()
|
||||
{
|
||||
@@ -136,4 +174,5 @@ public class PrcProfitReportServiceImpl implements IPrcProfitReportService
|
||||
}
|
||||
return commissionRateMapper.deleteById(rateId);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user