Merge branch 'refs/heads/dev_js_20260407'

This commit is contained in:
king
2026-04-09 16:20:07 +08:00
3 changed files with 12 additions and 12 deletions

View File

@@ -36,17 +36,19 @@ public class BusinessRealRecordPlugin implements AroundAdvicePlugin {
//新增方法默认状态字段
params.put("order_state",ByglConstant.GD_STATE_DKS);
String useyear = lideeYunJiUtils.getMap2Str(params, "useyear");
String revenueYearplan = lideeYunJiUtils.getMap2Str(params, "revenue_yearplan");
String revenueYearrate = lideeYunJiUtils.getMap2Str(params, "revenue_yearrate");
String profitYearplan = lideeYunJiUtils.getMap2Str(params, "profit_yearplan");
String profitYearrate = lideeYunJiUtils.getMap2Str(params, "profit_yearrate");
String revenueYearplan = lideeYunJiUtils.getMap2Str(params, "revenue_yearplan"); //销售收入
String profitYearplan = lideeYunJiUtils.getMap2Str(params, "profit_yearplan"); //净利润
String grossProfitYearplan = lideeYunJiUtils.getMap2Str(params, "gross_profit_yearplan"); //销售毛利
String grossProfitMarginYearplan = lideeYunJiUtils.getMap2Str(params, "gross_profit_margin_yearplan"); //销售毛利率
List<Map<String, Object>> record = businessRealRecordMapper.getLastMonth(lideeYunJiBaseConstant.DS_ERP_BI_DATA,useyear);
if (CollUtil.isEmpty(record)) {
throw new RuntimeException("请选择正确的年,当前年月没有指标");
}
String last_month = (String) record.get(0).get("last_month");
businessRealRecordMapper.updateByRecord(lideeYunJiBaseConstant.DS_ERP_BI_DATA, useyear, last_month, "1", revenueYearplan, revenueYearrate);
businessRealRecordMapper.updateByRecord(lideeYunJiBaseConstant.DS_ERP_BI_DATA, useyear, last_month, "4", profitYearplan, profitYearrate);
businessRealRecordMapper.updateByRecord(lideeYunJiBaseConstant.DS_ERP_BI_DATA, useyear, last_month, "1", revenueYearplan);
businessRealRecordMapper.updateByRecord(lideeYunJiBaseConstant.DS_ERP_BI_DATA, useyear, last_month, "4", profitYearplan);
businessRealRecordMapper.updateByRecord(lideeYunJiBaseConstant.DS_ERP_BI_DATA, useyear, last_month, "2", grossProfitYearplan);
businessRealRecordMapper.updateByRecord(lideeYunJiBaseConstant.DS_ERP_BI_DATA, useyear, last_month, "3", grossProfitMarginYearplan);
}
@Override

View File

@@ -19,5 +19,5 @@ public interface BusinessRealRecordMapper {
@DS(value = "#dataSourceType")
List<Map<String,Object>> getLastMonth(@Param("dataSourceType") String dataSourceType, String year);
@DS(value = "#dataSourceType")
int updateByRecord(@Param("dataSourceType") String dataSourceType, String year, String month, String itemid, String yearplan, String yearrate);
int updateByRecord(@Param("dataSourceType") String dataSourceType, String year, String month, String itemid, String yearplan);
}

View File

@@ -12,7 +12,6 @@
USEMONTH AS last_month,
ITEMID,
YEAR_PLAN,
YEAR_RATE,
ROW_NUMBER() OVER (PARTITION BY USEYEAR, ITEMID ORDER BY USEYEAR DESC, CAST(USEMONTH AS UNSIGNED) DESC) AS rn
FROM
GR_BI_FS_BUSINESS_REAL_RATE
@@ -36,10 +35,9 @@
</select>
<insert id="updateByRecord">
INSERT INTO gr_bi_fs_business_real_rate (YEAR_PLAN, YEAR_RATE, USEYEAR,USEMONTH,ITEMID)
VALUES (#{yearplan}, #{yearrate}, #{year}, #{month}, #{itemid})
INSERT INTO gr_bi_fs_business_real_rate (YEAR_PLAN, USEYEAR,USEMONTH,ITEMID)
VALUES (#{yearplan}, #{year}, #{month}, #{itemid})
ON DUPLICATE KEY UPDATE
YEAR_PLAN = #{yearplan},
YEAR_RATE = #{yearrate}
YEAR_PLAN = #{yearplan}
</insert>
</mapper>