|
@@ -194,14 +194,22 @@ public class TaH5DemandController extends BaseController {
|
194
|
194
|
ResponseBean responseBean = new ResponseBean();
|
195
|
195
|
List<Integer> demandIds = new ArrayList<>();
|
196
|
196
|
try {
|
|
197
|
+ int successNum = 0;
|
|
198
|
+ int failNum = 0;
|
197
|
199
|
for (TaH5Demand info : taH5Demand.getTaH5Demands()){
|
198
|
|
- demandIds.add(info.getDemandId());
|
|
200
|
+ TaH5Demand h5Demand = iTaH5DemandService.getById(info.getDemandId());
|
|
201
|
+ if (CommConstant.DEMAND_STATUS_INVALID.equals(h5Demand.getDemandStatus()) || CommConstant.DEMAND_STATUS_SUBMIT.equals(h5Demand.getDemandStatus())){
|
|
202
|
+ h5Demand.setDemandStatus(CommConstant.STATUS_DELETE);
|
|
203
|
+ iTaH5DemandService.updateById(h5Demand);
|
|
204
|
+ successNum++;
|
|
205
|
+ }else{
|
|
206
|
+ failNum++;
|
|
207
|
+ }
|
199
|
208
|
}
|
200
|
|
- TaH5Demand h5Demand = new TaH5Demand();
|
201
|
|
- h5Demand.setDemandStatus(CommConstant.STATUS_DELETE);
|
202
|
|
- QueryWrapper<TaH5Demand> taH5DemandQueryWrapper = new QueryWrapper<>();
|
203
|
|
- taH5DemandQueryWrapper.in("demand_id", demandIds);
|
204
|
|
- iTaH5DemandService.update(h5Demand, taH5DemandQueryWrapper);
|
|
209
|
+ Map<String,Object> map = new HashMap<>();
|
|
210
|
+ map.put("successNum",successNum);
|
|
211
|
+ map.put("failNum",failNum);
|
|
212
|
+ responseBean.addSuccess(map);
|
205
|
213
|
}catch (Exception e){
|
206
|
214
|
e.printStackTrace();
|
207
|
215
|
logger.error("taH5DemandDelete -=- {}",e.toString());
|
|
@@ -226,6 +234,7 @@ public class TaH5DemandController extends BaseController {
|
226
|
234
|
return responseBean;
|
227
|
235
|
}
|
228
|
236
|
taH5Demand.setDemandId(id);
|
|
237
|
+ taH5Demand.setUpdateDate(LocalDateTime.now());
|
229
|
238
|
if (iTaH5DemandService.updateById(taH5Demand)){
|
230
|
239
|
responseBean.addSuccess(taH5Demand);
|
231
|
240
|
}else {
|