wuzhen update

This commit is contained in:
wuzhen committed 2025-08-01 08:35:47 +08:00
1 parent e4e4679da9
commit c8fb6fa032
43 files changed
+7760 -819

No files matched your search

@@ -151,7 +151,7 @@ public class CwProjectApplicationController extends BaseController {
log.info("项目名称: {}", bo.getProjectName());
log.info("绩效指标数据: {}", bo.getPerformanceIndicators());
log.info("绩效指标数量: {}", bo.getPerformanceIndicators() != null ? bo.getPerformanceIndicators().size() : 0);
Boolean result = projectApplicationService.saveDraft(bo);
if (result && bo.getId() != null) {
// 保存成功后,返回完整的申报信息
@@ -220,17 +220,20 @@ public class CwProjectApplicationController extends BaseController {
public R<java.util.Map<String, Object>> statistics(@RequestParam(required = false) Integer year) {
java.util.Map<String, Object> result = new java.util.HashMap<>();
// 申报数量统计
// 申报数量统计 - 使用字符串状态值
result.put("totalCount", projectApplicationService.countApplications(year, null));
result.put("draftCount", projectApplicationService.countApplications(year, "1"));
result.put("submitCount", projectApplicationService.countApplications(year, "2"));
result.put("approvingCount", projectApplicationService.countApplications(year, "3"));
result.put("approvedCount", projectApplicationService.countApplications(year, "4"));
result.put("rejectedCount", projectApplicationService.countApplications(year, "5"));
result.put("draftCount", projectApplicationService.countApplications(year, "draft"));
result.put("submitCount", projectApplicationService.countApplications(year, "submitted"));
// 审批中包含已提交和正在审批的申报
Long submittedCount = projectApplicationService.countApplications(year, "submitted");
Long approvingCount = projectApplicationService.countApplications(year, "approving");
result.put("approvingCount", submittedCount + approvingCount);
result.put("approvedCount", projectApplicationService.countApplications(year, "approved"));
result.put("rejectedCount", projectApplicationService.countApplications(year, "rejected"));
// 金额统计
// 金额统计 - 使用字符串状态值
result.put("totalAmount", projectApplicationService.sumApplicationAmount(year, null));
result.put("approvedAmount", projectApplicationService.sumApplicationAmount(year, "4"));
result.put("approvedAmount", projectApplicationService.sumApplicationAmount(year, "approved"));
// 部门统计
result.put("deptStatistics", projectApplicationService.statisticsByDept(year));
@@ -292,7 +292,16 @@ public class CwApprovalRecordServiceImpl implements ICwApprovalRecordService {
records.add(leaderRecord);
// 批量插入审批记录
return baseMapper.batchInsert(records) > 0;
boolean insertResult = baseMapper.batchInsert(records) > 0;
if (insertResult) {
// 审批流程创建成功后,更新申报状态为审批中
boolean updateResult = projectApplicationService.updateApprovalStatus(applicationId, "approving");
log.info("审批流程创建成功,申报状态已更新为审批中:applicationId={}, updateResult={}", applicationId, updateResult);
return updateResult;
}
return insertResult;
} catch (Exception e) {
log.error("创建审批流程失败:applicationId={}, error={}", applicationId, e.getMessage(), e);
@@ -51,7 +51,7 @@
</resultMap>
<sql id="selectCwProjectApplicationVo">
select
select
a.id, a.application_no, a.project_name, a.principal, a.contact_phone,
a.start_date, a.end_date, a.target_sme, a.target_micro_sme, a.import_equipment,
a.application_reason, a.construction_content, a.total_performance_goal, a.current_year_goal,
@@ -123,13 +123,15 @@
</select>
<select id="statisticsByDept" resultType="java.util.Map">
select
select
d.dept_name,
a.department_id,
count(*) as application_count,
COALESCE(sum(a.total_investment), 0) as total_amount,
count(case when a.approval_status = '4' then 1 end) as approved_count,
COALESCE(sum(case when a.approval_status = '4' then a.total_investment else 0 end), 0) as approved_amount
count(case when a.approval_status = 'approved' then 1 end) as approved_count,
COALESCE(sum(case when a.approval_status = 'approved' then a.total_investment else 0 end), 0) as approved_amount,
count(case when a.approval_status in ('submitted', 'approving') then 1 end) as approving_count,
count(case when a.approval_status = 'rejected' then 1 end) as rejected_count
from cw_project_application a
left join sys_dept d on a.department_id = d.dept_id
where a.deleted = 0
@@ -138,13 +140,15 @@
order by total_amount desc
</select>
<select id="statisticsByMonth" resultType="java.util.Map">
select
<select id="statisticsByMonth" resultType="java.util.Map">
select
DATE_FORMAT(submit_time, '%Y-%m') as month,
count(*) as application_count,
COALESCE(sum(total_investment), 0) as total_amount,
count(case when approval_status = '4' then 1 end) as approved_count,
COALESCE(sum(case when approval_status = '4' then total_investment else 0 end), 0) as approved_amount
count(case when approval_status = 'approved' then 1 end) as approved_count,
COALESCE(sum(case when approval_status = 'approved' then total_investment else 0 end), 0) as approved_amount,
count(case when approval_status in ('submitted', 'approving') then 1 end) as approving_count,
count(case when approval_status = 'rejected' then 1 end) as rejected_count
from cw_project_application
where deleted = 0 and submit_time is not null
<if test="year != null"> and year = #{year}</if>
@@ -155,11 +159,11 @@
<select id="selectPendingApprovals" resultMap="CwProjectApplicationResult">
<include refid="selectCwProjectApplicationVo"/>
inner join cw_approval_record r on a.id = r.application_id
where a.deleted = 0
where a.deleted = 0
and r.deleted = 0
and r.approver_id = #{approverId}
and r.node_status = 'waiting'
order by a.submit_time asc
</select>
</mapper>
</mapper>