|
@@ -6,8 +6,10 @@ import com.liang.common.base.BaseController;
|
6
|
6
|
import com.liang.common.base.BaseResult;
|
7
|
7
|
import com.liang.entity.PrjPayplan;
|
8
|
8
|
import com.liang.entity.PrjProject;
|
|
9
|
+import com.liang.entity.StaPayapproval;
|
9
|
10
|
import com.liang.service.PrjPayplanService;
|
10
|
11
|
import com.liang.service.PrjPayplannameService;
|
|
12
|
+import com.liang.service.StaPayapprovalService;
|
11
|
13
|
import org.springframework.data.domain.Page;
|
12
|
14
|
import org.springframework.data.domain.PageRequest;
|
13
|
15
|
import org.springframework.http.ResponseEntity;
|
|
@@ -39,6 +41,8 @@ public class PrjPayplanController extends BaseController {
|
39
|
41
|
@Resource
|
40
|
42
|
private PrjPayplannameService prjPayplannameService;
|
41
|
43
|
|
|
44
|
+ @Resource
|
|
45
|
+ private StaPayapprovalService staPayapprovalService;
|
42
|
46
|
/**
|
43
|
47
|
* 分页查询
|
44
|
48
|
*
|
|
@@ -197,12 +201,42 @@ public class PrjPayplanController extends BaseController {
|
197
|
201
|
contractList.forEach(item -> {
|
198
|
202
|
idList.add(item.getId());
|
199
|
203
|
});
|
|
204
|
+ List<PrjPayplan> ero = new ArrayList<>();
|
|
205
|
+ if (idList.size() > 1) {
|
|
206
|
+ for (int i = 0; i < idList.size(); i++) {
|
|
207
|
+ List<StaPayapproval> list = staPayapprovalService.getFkjh(idList.get(i));
|
|
208
|
+ if (list.size() == 0) {
|
|
209
|
+ continue;
|
|
210
|
+ } else {
|
|
211
|
+ // 查询出当前付款计划详细信息
|
|
212
|
+ PrjPayplan prjPayplan = prjPayplanService.queryById(idList.get(i));
|
|
213
|
+ ero.add(prjPayplan);
|
|
214
|
+ idList.remove(idList.get(i));
|
|
215
|
+ }
|
|
216
|
+ }
|
|
217
|
+ int num = prjPayplanService.batchDelete(idList);
|
|
218
|
+ if (num > 0) {
|
|
219
|
+ if (ero.size() == 0) {
|
|
220
|
+ return BaseResult.success("批量删除成功!");
|
|
221
|
+ } else {
|
|
222
|
+ return BaseResult.success("批量部分删除成功!");
|
|
223
|
+ }
|
|
224
|
+ } else {
|
|
225
|
+ return BaseResult.failure("批量删除失败!");
|
|
226
|
+ }
|
|
227
|
+ }else {
|
|
228
|
+ List<StaPayapproval> list = staPayapprovalService.getFkjh(idList.get(0));
|
|
229
|
+ if (list.size() == 0){
|
|
230
|
+ int num = prjPayplanService.batchDelete(idList);
|
|
231
|
+ if (num > 0) {
|
|
232
|
+ return BaseResult.success("删除成功!");
|
|
233
|
+ }else {
|
|
234
|
+ return BaseResult.failure(1,"删除失败!");
|
|
235
|
+ }
|
|
236
|
+ }else {
|
|
237
|
+ return BaseResult.failure(1,"删除失败,该比付款计划已绑定付款申请,不能删除!");
|
|
238
|
+ }
|
200
|
239
|
|
201
|
|
- int num = prjPayplanService.batchDelete(idList);
|
202
|
|
- if (num > 0) {
|
203
|
|
- return BaseResult.success("批量删除成功!");
|
204
|
|
- } else {
|
205
|
|
- return BaseResult.failure("批量删除失败!");
|
206
|
240
|
}
|
207
|
241
|
}
|
208
|
242
|
}
|