|
@@ -372,8 +372,14 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
|
//利润表
|
|
|
Map map1 = getProfit(year);
|
|
|
|
|
|
+ Map lastRemainNetMap = new HashMap();
|
|
|
+ if (!year.equals("2024")){
|
|
|
+ Map map8 = getProfit(NumberUtil.sub(year,"1").toString());
|
|
|
+ lastRemainNetMap = (Map) map8.get("mainData");
|
|
|
+ }
|
|
|
+
|
|
|
//资产负债表
|
|
|
- Map map2 = getLiabilities(year,(Map) map1.get("mainData"));
|
|
|
+ Map map2 = getLiabilities(year,(Map) map1.get("mainData"),lastRemainNetMap);
|
|
|
|
|
|
//应收账款表
|
|
|
Map map3 = getReceivable(year);
|
|
@@ -671,16 +677,16 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
|
|
|
|
@Override
|
|
|
public void exportLiabilitiesDetails(HttpServletResponse response, String year) {
|
|
|
- Map liabilities = getLiabilities(year,null);
|
|
|
+ Map liabilities = getLiabilities(year,null,null);
|
|
|
List<Accounts> dataList = (List<Accounts>) liabilities.get("dataList");
|
|
|
Map mainData = (Map) liabilities.get("mainData");
|
|
|
|
|
|
UtilExcel.exportMapAndListByTemplate(response,mainData,dataList, Accounts.class, "应付账款表", "Template_liabilities.xlsx");
|
|
|
}
|
|
|
|
|
|
- private Map getLiabilities(String year,Map remainNetMap) {
|
|
|
+ private Map getLiabilities(String year,Map remainNetMap,Map lastRemainNetMap) {
|
|
|
// 1.获取宜搭数据
|
|
|
- List<Accounts> dataList=getLiabilitiesData(year,remainNetMap);
|
|
|
+ List<Accounts> dataList=getLiabilitiesData(year,remainNetMap,lastRemainNetMap);
|
|
|
// 2.计算主数据
|
|
|
Map mainData=new HashMap();
|
|
|
mainData.put("year",year);
|
|
@@ -692,7 +698,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- private List<Accounts> getLiabilitiesData(String year,Map remainNetMap) {
|
|
|
+ private List<Accounts> getLiabilitiesData(String year,Map remainNetMap,Map lastRemainNetMap) {
|
|
|
List<Accounts> dataList = new ArrayList<>();
|
|
|
|
|
|
String dateParam = getYearParam(year);
|
|
@@ -1023,8 +1029,15 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
|
|
|
|
//未分配利润
|
|
|
Accounts accounts15 = new Accounts();
|
|
|
- accounts15.setInitialAmt("4567803.2");
|
|
|
- String monthAmt15 = "4567803.2";
|
|
|
+
|
|
|
+ //计算初始值
|
|
|
+ String initialAmt = "4567803.2";
|
|
|
+ if (Objects.nonNull(lastRemainNetMap) && !lastRemainNetMap.keySet().isEmpty()){
|
|
|
+ initialAmt = NumberUtil.add(initialAmt, String.valueOf(lastRemainNetMap.get("remainNetTotal"))).toString();
|
|
|
+ }
|
|
|
+ accounts15.setInitialAmt(initialAmt);
|
|
|
+
|
|
|
+ String monthAmt15 = initialAmt;
|
|
|
if (Objects.nonNull(remainNetMap)){
|
|
|
for (int i = 1; i < month1; i++) {
|
|
|
monthAmt15 = NumberUtil.add(monthAmt15, String.valueOf(remainNetMap.get("remainNet" + i))).toString();
|