|
@@ -182,6 +182,45 @@ public class FundIncomeInfoController {
|
|
|
return msgResult;
|
|
return msgResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "批量保存")
|
|
|
|
|
+ @PostMapping("batchSave")
|
|
|
|
|
+ public MessageResult<FundIncomeInfo> batchSave(@RequestBody List<FundIncomeInfo> list, @RequestAttribute String subject) {
|
|
|
|
|
+ MessageResult<FundIncomeInfo> msgResult = new MessageResult<>();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ int affectCount = 0;
|
|
|
|
|
+
|
|
|
|
|
+ for (FundIncomeInfo fundIncomeInfo:list) {
|
|
|
|
|
+ fundIncomeInfo.setUpdateBy(subject);
|
|
|
|
|
+ fundIncomeInfo.setUpdateTime(new Date());
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(fundIncomeInfo.getEndDateStr())) {
|
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ fundIncomeInfo.setEndDate(sdf.parse(fundIncomeInfo.getEndDateStr()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ affectCount += fundIncomeInfoService.update(fundIncomeInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (affectCount > 0) {
|
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
|
+ msgResult.setMessage("数据库更新失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
|
|
+
|
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return msgResult;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@ApiOperation(value = "删除用户")
|
|
@ApiOperation(value = "删除用户")
|
|
|
@PostMapping("delete/{id}")
|
|
@PostMapping("delete/{id}")
|
|
|
public MessageResult<FundIncomeInfo> delete(@PathVariable("id") String id, @RequestAttribute String subject) {
|
|
public MessageResult<FundIncomeInfo> delete(@PathVariable("id") String id, @RequestAttribute String subject) {
|
|
@@ -278,7 +317,7 @@ public class FundIncomeInfoController {
|
|
|
@ApiOperation(value = "列表")
|
|
@ApiOperation(value = "列表")
|
|
|
@RequestMapping(value = "pageList", method = RequestMethod.POST)
|
|
@RequestMapping(value = "pageList", method = RequestMethod.POST)
|
|
|
public MessageResult<Object> pageList(
|
|
public MessageResult<Object> pageList(
|
|
|
- String yearMonth, String name,
|
|
|
|
|
|
|
+ String yearMonth, String name,String templateId,
|
|
|
@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
|
@RequestParam(value = "pageSize", defaultValue = "20000") int pageSize,
|
|
@RequestParam(value = "pageSize", defaultValue = "20000") int pageSize,
|
|
|
@RequestParam(value = "exportFlag", defaultValue = "false") Boolean exportFlag,
|
|
@RequestParam(value = "exportFlag", defaultValue = "false") Boolean exportFlag,
|
|
@@ -314,6 +353,10 @@ public class FundIncomeInfoController {
|
|
|
searchParams.put("name", "%" + name + "%");
|
|
searchParams.put("name", "%" + name + "%");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(templateId)) {
|
|
|
|
|
+ searchParams.put("templateId", templateId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
Page<FundIncomeInfo> page = fundIncomeInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
|
|
Page<FundIncomeInfo> page = fundIncomeInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
|
|
|
|
|
|
|
@@ -333,7 +376,7 @@ public class FundIncomeInfoController {
|
|
|
if (fundIncomeInfo.getIsSum() != null) {
|
|
if (fundIncomeInfo.getIsSum() != null) {
|
|
|
if (fundIncomeInfo.getIsSum()) {
|
|
if (fundIncomeInfo.getIsSum()) {
|
|
|
String serialNumber = fundIncomeInfo.getSerialNumber();
|
|
String serialNumber = fundIncomeInfo.getSerialNumber();
|
|
|
- BigDecimal sumBudget = fundIncomeInfoService.sumBudgetRevenue(serialNumber + ".%", startDate, endDate);
|
|
|
|
|
|
|
+ BigDecimal sumBudget = fundIncomeInfoService.sumBudgetRevenue(serialNumber + ".%", startDate, endDate, templateId);
|
|
|
budgetRevenue = sumBudget;
|
|
budgetRevenue = sumBudget;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -352,7 +395,7 @@ public class FundIncomeInfoController {
|
|
|
String year = "";
|
|
String year = "";
|
|
|
|
|
|
|
|
if (fundIncomeInfo.getYear() != null) {
|
|
if (fundIncomeInfo.getYear() != null) {
|
|
|
- year = sdf3.format(fundIncomeInfo.getYear());
|
|
|
|
|
|
|
+ year = sdf.format(fundIncomeInfo.getYear());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (fundIncomeInfo.getCreateTime() != null) {
|
|
if (fundIncomeInfo.getCreateTime() != null) {
|
|
@@ -430,12 +473,12 @@ public class FundIncomeInfoController {
|
|
|
map.put("bak", fundIncomeInfo.getBak());
|
|
map.put("bak", fundIncomeInfo.getBak());
|
|
|
map.put("year", year);
|
|
map.put("year", year);
|
|
|
|
|
|
|
|
- BigDecimal total = fundIncomeInfoService.sumBySerialNumber(fundIncomeInfo.getSerialNumber(), curMonth);
|
|
|
|
|
|
|
+ BigDecimal total = fundIncomeInfoService.sumBySerialNumber(fundIncomeInfo.getSerialNumber(), curMonth, templateId);
|
|
|
|
|
|
|
|
map.put("total", total);
|
|
map.put("total", total);
|
|
|
|
|
|
|
|
BigDecimal accumulatedArrears = fundIncomeInfo.getBudgetRevenue();
|
|
BigDecimal accumulatedArrears = fundIncomeInfo.getBudgetRevenue();
|
|
|
- if (total != null) {
|
|
|
|
|
|
|
+ if (total != null && accumulatedArrears != null) {
|
|
|
accumulatedArrears = accumulatedArrears.subtract(total);
|
|
accumulatedArrears = accumulatedArrears.subtract(total);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -479,7 +522,7 @@ public class FundIncomeInfoController {
|
|
|
Row rowTitle = sheet.createRow(0);
|
|
Row rowTitle = sheet.createRow(0);
|
|
|
|
|
|
|
|
String[] titles = new String[]{"序号", "项目名称", "预算收入", "账户名称", "本月到账资金", "实际总收入", "累计欠费",
|
|
String[] titles = new String[]{"序号", "项目名称", "预算收入", "账户名称", "本月到账资金", "实际总收入", "累计欠费",
|
|
|
- "收入时间区间", "收入类型", "终止日", "收入实现部门", "会计主体名称", "备注", "所属年份"};
|
|
|
|
|
|
|
+ "收入时间区间", "收入类型", "终止日", "收入实现部门", "会计主体名称", "备注", "所属年月"};
|
|
|
|
|
|
|
|
for (int i = 0; i < titles.length; i++) {
|
|
for (int i = 0; i < titles.length; i++) {
|
|
|
Cell cell = rowTitle.createCell(i);
|
|
Cell cell = rowTitle.createCell(i);
|
|
@@ -506,7 +549,7 @@ public class FundIncomeInfoController {
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("incomeDepartment"), ""));
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("incomeDepartment"), ""));
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("accountingName"), ""));
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("accountingName"), ""));
|
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("bak"), ""));
|
|
row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("bak"), ""));
|
|
|
- row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("year"), ""));
|
|
|
|
|
|
|
+ row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("yearMonthStr"), ""));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream output = new ByteArrayOutputStream();
|