Explorar el Código

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

mengy hace 3 años
padre
commit
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
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
4
 import com.chinaitop.depot.business.mapper.AuditRecordsMapper;
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
 import com.chinaitop.depot.business.model.AuditRecords;
7
 import com.chinaitop.depot.business.model.AuditRecords;
6
 import com.chinaitop.depot.business.model.AuditRecordsExample;
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
 import com.chinaitop.depot.business.service.AuditRecordsService;
11
 import com.chinaitop.depot.business.service.AuditRecordsService;
8
 import org.apache.commons.lang.ObjectUtils;
12
 import org.apache.commons.lang.ObjectUtils;
9
 import org.springframework.stereotype.Service;
13
 import org.springframework.stereotype.Service;
@@ -23,6 +27,12 @@ public class AuditRecordsServiceImpl implements AuditRecordsService {
23
 	@Resource
27
 	@Resource
24
 	private AuditRecordsMapper auditRecordsMapper;
28
 	private AuditRecordsMapper auditRecordsMapper;
25
 
29
 
30
+	@Resource
31
+	private ReportMonthlyMapper reportMonthlyMapper;
32
+
33
+	@Resource
34
+	private ReportWeeklyMapper reportWeeklyMapper;
35
+
26
 	@Override
36
 	@Override
27
 	public List<AuditRecords> queryByExample(AuditRecordsExample example) {
37
 	public List<AuditRecords> queryByExample(AuditRecordsExample example) {
28
 		// TODO Auto-generated method stub
38
 		// TODO Auto-generated method stub
@@ -62,6 +72,24 @@ public class AuditRecordsServiceImpl implements AuditRecordsService {
62
 	@Override
72
 	@Override
63
 	public Integer save(AuditRecords audit) {
73
 	public Integer save(AuditRecords audit) {
64
 		audit.setbType(audit.getReportType());
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
 		return auditRecordsMapper.insert(audit);
93
 		return auditRecordsMapper.insert(audit);
66
 	}
94
 	}
67
 
95