| | |
| | | String count=reportingWorkMapper.getPatchConditionMp(reportingWorkId); |
| | | return count; |
| | | } |
| | | @Transactional(rollbackFor = Exception.class , noRollbackFor = Error.class) |
| | | @Transactional(rollbackFor = Exception.class , noRollbackFor = ServiceException.class) |
| | | public Boolean mesReportingWorkSv(Map<String,Object> reportingWorkMap) { |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | |
| | | ); |
| | | //判断是否大于当前数量并且抛出异常 |
| | | if (processNum < (reportingWorkDetail.getBreakageQuantity() + reportingWorkDetail.getCompletedQuantity())) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | throw new ServiceException(Constants.Code_600, "上工序已完工数量小于本工序报工数量,请检查"); |
| | | return false; |
| | | } |
| | | |
| | | |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e +"\n"+Arrays.toString(e.getStackTrace())); |
| | | sysError.setError(e +Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("saveOrder"); |
| | | sysErrorService.insert(sysError); |
| | | //throw new ServiceException(Constants.Code_500, "数据请求异常,请检查"); |
| | | throw new Error(); |
| | | throw new ServiceException(Constants.Code_500, "数据请求异常,请检查"); |
| | | |
| | | } |
| | | } |