浏览代码

月度账单有参

zxf 1 天之前
父节点
当前提交
f0dfd72f5d

+ 1 - 0
jd-logistics-modules/jd-logistics-job/src/main/java/com/ruoyi/job/task/FinancialMonthSummaryTask.java

@@ -36,6 +36,7 @@ public class FinancialMonthSummaryTask {
         String formattedDate = lastMonth.format(formatter);
         Map param= new HashMap();
         param.put("monthCode",formattedDate);
+        param.put("deptId","");
         remoteMonthSummaryService.creatMontSummary(param);
     }
 

+ 6 - 2
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/RptFinancialMonthSummaryServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.datascope.annotation.DataScope;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -115,9 +116,12 @@ public class RptFinancialMonthSummaryServiceImpl implements IRptFinancialMonthSu
         // 格式化上个月日期为字符串
         String formattedDate = lastMonth.format(formatter);
         //按照传值条件查询统计账单情况
-        param.put("monthCode",param.get("monthCode")!=null?param.get("monthCode").toString():formattedDate);
-        param.put("deptId",param.get("deptId")!=null?param.get("deptId"):null);
+        param.put("monthCode",StringUtils.isNotBlank(param.get("monthCode").toString())?param.get("monthCode").toString():formattedDate);
+        param.put("deptId", StringUtils.isNotBlank(param.get("deptId").toString())?param.get("deptId").toString():null);
         List<Map<String,Object>> monthSummaryList=rptFinancialMonthSummaryMapper.selectMonthSummaryList(param);
+        if(monthSummaryList.size()==0){
+            return 0;
+        }
         return rptFinancialMonthSummaryMapper.insertBachRptFinancialMonthSummary(monthSummaryList);
     }