|
@@ -12,10 +12,15 @@ import org.springframework.stereotype.Service;
|
12
|
12
|
import org.springframework.data.domain.Page;
|
13
|
13
|
import org.springframework.data.domain.PageImpl;
|
14
|
14
|
import org.springframework.data.domain.PageRequest;
|
|
15
|
+import org.springframework.transaction.annotation.Transactional;
|
|
16
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
17
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
18
|
+import org.springframework.web.bind.annotation.RestController;
|
15
|
19
|
|
16
|
20
|
import javax.annotation.Resource;
|
17
|
21
|
import java.util.List;
|
18
|
22
|
import java.util.Map;
|
|
23
|
+import java.util.stream.Collectors;
|
19
|
24
|
|
20
|
25
|
/**
|
21
|
26
|
* 年度预算(PrjAnnualbudget)表服务实现类
|
|
@@ -24,6 +29,7 @@ import java.util.Map;
|
24
|
29
|
* @since 2023-05-17 08:56:50
|
25
|
30
|
*/
|
26
|
31
|
@Service("prjAnnualbudgetService")
|
|
32
|
+@RestController
|
27
|
33
|
public class PrjAnnualbudgetServiceImpl implements PrjAnnualbudgetService {
|
28
|
34
|
@Resource
|
29
|
35
|
private PrjAnnualbudgetDao prjAnnualbudgetDao;
|
|
@@ -150,9 +156,24 @@ public class PrjAnnualbudgetServiceImpl implements PrjAnnualbudgetService {
|
150
|
156
|
prjAnnualbudgetDao.updateSJYZXSum(rws);
|
151
|
157
|
}
|
152
|
158
|
}
|
|
159
|
+ @GetMapping("/updateSJYZXAndXTJSYZX/{rwsId}/{nysId}")
|
|
160
|
+ @Transactional(rollbackFor = Exception.class)
|
|
161
|
+ public void updateSJYZXAndXTJSYZX(@PathVariable("rwsId")Integer rwsId, @PathVariable("nysId")Integer nysId) {
|
|
162
|
+ List<PrjAnnualbudget> prjAnnualbudgets = prjAnnualbudgetDao.listByRws(rwsId);
|
|
163
|
+ //第一年的年度预算不需要更新
|
|
164
|
+ if (!Collections.isEmpty(prjAnnualbudgets) && !prjAnnualbudgets.get(0).getId().equals(nysId)) {
|
|
165
|
+ PrjAnnualbudget annualbudget = prjAnnualbudgets.stream().filter(item -> item.getId().equals(nysId)).collect(Collectors.toList()).get(0);
|
|
166
|
+ //更新 系统计算已执行
|
|
167
|
+ prjAnnualbudgetDao.updateXTJSYZXByNysId(rwsId,annualbudget.getNf(),annualbudget.getId());
|
|
168
|
+ //更新 历史年度预算的实际已执行
|
|
169
|
+ prjAnnualbudgetDao.updateSJYZXByNysId(rwsId,annualbudget.getNf(),annualbudget.getId());
|
|
170
|
+ //更新已执行总计
|
|
171
|
+ prjAnnualbudgetDao.updateSJYZXSumByNysId(rwsId,annualbudget.getNf(),annualbudget.getId());
|
|
172
|
+ }
|
|
173
|
+ }
|
153
|
174
|
|
154
|
175
|
@Override
|
155
|
176
|
public PrjAnnualbudget queryByRws1(Integer rws, Integer nf) {
|
156
|
|
- return prjAnnualbudgetDao.queryByRws1(rws,nf);
|
|
177
|
+ return prjAnnualbudgetDao.queryByRws1(rws, nf);
|
157
|
178
|
}
|
158
|
179
|
}
|