| | |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=true; |
| | | try { |
| | | if (obj.getTask_type()==2){ |
| | | if (!(mapper.del(obj)>0)) { |
| | | bl=false; |
| | | } |
| | | if (!(mapper.delsqlC(obj)>0)) { |
| | | bl=false; |
| | | } |
| | | bl = mapper.del(obj) > 0; |
| | | if (bl) bl = mapper.delsqlC(obj) > 0; //check |
| | | }else{ |
| | | if (!(mapper.del(obj)>0)) { |
| | | bl=false; |
| | | bl = mapper.del(obj) > 0; |
| | | if (bl) bl = mapper.delsqlT(obj) > 0; //test |
| | | } |
| | | if (!(mapper.delsqlT(obj)>0)) { |
| | | bl=false; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | model.setMsg("删除作业失败!"); |
| | | return model; |
| | | } |
| | | if(bl){ |
| | | dataSourceTransactionManager.commit(transactionStatus); |
| | | model.setCode(1); |
| | | model.setMsg("删除作业成功!"); |
| | | } |
| | | else{ |
| | | } else { |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | model.setMsg("删除作业失败!"); |
| | | } |