!103 feat(fixcontact): 新增台账状态统计接口
Merge pull request !103 from wsm/style/fix_contact_list_style
This commit is contained in:
+30
@@ -60,6 +60,36 @@ public class FixedContact20260730Controller extends JeecgController<FixedContact
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@Operation(summary = "定点联系单-状态统计")
|
||||
@GetMapping(value = "/statusStats")
|
||||
public Result<Map<String, Integer>> statusStats(FixedContact20260730 fixedContact20260730, HttpServletRequest req) {
|
||||
QueryWrapper<FixedContact20260730> queryWrapper = QueryGenerator.initQueryWrapper(fixedContact20260730, req.getParameterMap());
|
||||
List<FixedContact20260730> list = fixedContact20260730Service.list(queryWrapper);
|
||||
int notStarted = 0, inProgress = 0, overdue = 0, completed = 0;
|
||||
java.time.LocalDate today = java.time.LocalDate.now();
|
||||
for (FixedContact20260730 item : list) {
|
||||
BpmStatus bpmStatus = BpmStatus.fromCode(item.getBpmStatus());
|
||||
if (bpmStatus == BpmStatus.NOT_START) {
|
||||
notStarted++;
|
||||
} else if (bpmStatus == BpmStatus.SUPERVISING) {
|
||||
inProgress++;
|
||||
// 流程截止时间取联系时间,督办中且已过联系时间的记为逾期
|
||||
if (item.getContactTime() != null
|
||||
&& item.getContactTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate().isBefore(today)) {
|
||||
overdue++;
|
||||
}
|
||||
} else if (bpmStatus == BpmStatus.FINISH) {
|
||||
completed++;
|
||||
}
|
||||
}
|
||||
Map<String, Integer> result = new java.util.LinkedHashMap<>();
|
||||
result.put("notStarted", notStarted);
|
||||
result.put("inProgress", inProgress);
|
||||
result.put("overdue", overdue);
|
||||
result.put("completed", completed);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
@AutoLog(value = "定点联系单-添加")
|
||||
@Operation(summary = "定点联系单-添加")
|
||||
@RequiresPermissions("bg.fixcontact:fixed_contact_20260730:add")
|
||||
|
||||
Reference in New Issue
Block a user