diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index c55f5782..f116154c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -1653,23 +1653,23 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { //String url = MaterialConstants.TEST_CREATE_OUT_URL; String data = AutomaticHttpHelper.sendHttpPostPushCost(url, body); if (StringUtils.isEmpty(data)) { + System.err.println("立体仓出库单创建失败"); throw new RuntimeException("立体仓出库单创建失败"); } JSONObject object = JSONObject.parseObject(data); String code = object.getString("code"); if (!"0".equals(code)) { + System.err.println("立体仓出库单创建失败"); throw new RuntimeException("立体仓出库单创建失败"); } } } } - return AjaxResult.success("发布成功"); - } catch (DataAccessException e) { + } catch (Exception e) { // 抛出异常、回滚数据 throw new RuntimeException("发布失败:" + e.getMessage()); - } catch (Exception e) { - return AjaxResult.error("发布失败"); } + return AjaxResult.success("发布成功"); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java index 4ccdbdbb..fc9cb8fc 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java @@ -1141,7 +1141,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { monthMaxOrder = value; } } catch (NumberFormatException e) { - throw new ServiceException("保存失败,请联系管理员"); + throw new RuntimeException("保存失败,请联系管理员"); } } } @@ -1158,7 +1158,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { // 根据parentId及typeId更新lease_apply_details表的发布数量 result = mapper.updatePublish(leaseApplyDetailsList.get(i)); if (result == 0) { - throw new ServiceException("发布失败,请联系管理员"); + throw new RuntimeException("发布失败,请联系管理员"); } leaseApplyDetailsList.get(i).setUnitId(leaseApplyInfo.getUnitId()); leaseApplyDetailsList.get(i).setProjectId(leaseApplyInfo.getProjectId()); @@ -1173,18 +1173,18 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { leaseApplyDetailsList.get(i).setCompanyId(leaseApplyInfo.getCompanyId()); result = mapper.addPublish(leaseApplyDetailsList.get(i)); if (result == 0) { - throw new ServiceException("发布失败,请联系管理员"); + throw new RuntimeException("发布失败,请联系管理员"); } - AutomaticOutPutDto automaticOutPutDto = new AutomaticOutPutDto(); - automaticOutPutDto.setMaterialName(leaseApplyDetailsList.get(i).getMaTypeName()); - automaticOutPutDto.setUnitCode(leaseApplyDetailsList.get(i).getUnitName()); - automaticOutPutDto.setOutQty(leaseApplyDetailsList.get(i).getNum()); - automaticOutPutDto.setLineNum(i + 1); - automaticOutPutDto.setTypeId(leaseApplyDetailsList.get(i).getNewTypeId()); - automaticOutPutDto.setSpecification(leaseApplyDetailsList.get(i).getTypeName()); // 根据newTypeId查询是否属于立体库 - Type type = mapper.isRs(leaseApplyDetailsList.get(i).getNewTypeId()); + Type type = mapper.isRs(leaseApplyDetailsList.get(i).getNewTypeId()); if (type != null && type.getIsRs() == 1) { + AutomaticOutPutDto automaticOutPutDto = new AutomaticOutPutDto(); + automaticOutPutDto.setMaterialName(leaseApplyDetailsList.get(i).getMaTypeName()); + automaticOutPutDto.setUnitCode(leaseApplyDetailsList.get(i).getUnitName()); + automaticOutPutDto.setOutQty(leaseApplyDetailsList.get(i).getNum()); + automaticOutPutDto.setLineNum(i + 1); + automaticOutPutDto.setTypeId(leaseApplyDetailsList.get(i).getNewTypeId()); + automaticOutPutDto.setSpecification(leaseApplyDetailsList.get(i).getTypeName()); list.add(automaticOutPutDto); } } @@ -1205,7 +1205,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { tmTask.setTaskStatus(3); result = tmTaskMapper.updateTmTask(tmTask); if (result == 0) { - throw new ServiceException("发布失败,请联系管理员"); + throw new RuntimeException("发布失败,请联系管理员"); } } if (!CollectionUtils.isEmpty(list)) { @@ -1232,11 +1232,11 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { throw new RuntimeException("立体仓出库单创建失败"); } } - return AjaxResult.success("发布成功"); } catch (Exception e) { log.error(e.getMessage()); - return AjaxResult.error("发布失败,请联系管理员"); + throw new RuntimeException("发布失败,请联系管理员!"); } + return AjaxResult.success("发布成功"); }