Просмотр исходного кода

审批驳回时修改月报表周报表上报状态

mengy лет назад: 3
Родитель
Сommit
219b4ff374

+ 28 - 0
src/main/java/com/chinaitop/depot/business/service/impl/AuditRecordsServiceImpl.java

@@ -2,8 +2,12 @@ package com.chinaitop.depot.business.service.impl;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4 4
 import com.chinaitop.depot.business.mapper.AuditRecordsMapper;
5
+import com.chinaitop.depot.business.mapper.ReportMonthlyMapper;
6
+import com.chinaitop.depot.business.mapper.ReportWeeklyMapper;
5 7
 import com.chinaitop.depot.business.model.AuditRecords;
6 8
 import com.chinaitop.depot.business.model.AuditRecordsExample;
9
+import com.chinaitop.depot.business.model.ReportMonthly;
10
+import com.chinaitop.depot.business.model.ReportWeekly;
7 11
 import com.chinaitop.depot.business.service.AuditRecordsService;
8 12
 import org.apache.commons.lang.ObjectUtils;
9 13
 import org.springframework.stereotype.Service;
@@ -23,6 +27,12 @@ public class AuditRecordsServiceImpl implements AuditRecordsService {
23 27
 	@Resource
24 28
 	private AuditRecordsMapper auditRecordsMapper;
25 29
 
30
+	@Resource
31
+	private ReportMonthlyMapper reportMonthlyMapper;
32
+
33
+	@Resource
34
+	private ReportWeeklyMapper reportWeeklyMapper;
35
+
26 36
 	@Override
27 37
 	public List<AuditRecords> queryByExample(AuditRecordsExample example) {
28 38
 		// TODO Auto-generated method stub
@@ -62,6 +72,24 @@ public class AuditRecordsServiceImpl implements AuditRecordsService {
62 72
 	@Override
63 73
 	public Integer save(AuditRecords audit) {
64 74
 		audit.setbType(audit.getReportType());
75
+		//审批结果是驳回的时候修改月报表周报表上报状态
76
+		//bType 报表类型 0:周报表 、1:月报表
77
+		if (audit.getShResult().equals("审批驳回")) {
78
+			if (audit.getReportType() == 0) {
79
+				//修改周报表上报状态
80
+				ReportWeekly week = new ReportWeekly();
81
+				week.setId(Integer.valueOf(audit.getBid()));
82
+				week.setStatus(String.valueOf("0"));
83
+				reportWeeklyMapper.updateByPrimaryKeySelective(week);
84
+			}else {
85
+				//修改月报表上报状态
86
+				ReportMonthly mon = new ReportMonthly();
87
+				mon.setId(Integer.valueOf(audit.getBid()));
88
+				mon.setStatus("0");
89
+				reportMonthlyMapper.updateByPrimaryKeySelective(mon);
90
+			}
91
+			return auditRecordsMapper.insert(audit);
92
+		}
65 93
 		return auditRecordsMapper.insert(audit);
66 94
 	}
67 95