diff --git a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java index 5cc28ba87..66b3723b8 100644 --- a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java +++ b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java @@ -125,11 +125,8 @@ public class IoPurChangeService { PurPlanEntity purPlanEntity = new PurPlanEntity(); List purPlanDetailEntityList = new ArrayList<>(); if (purApplyEntity.getStatus() == 3) { - basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction("CPSG"); - if (basicBusTypeChangeEntity != null && StrUtil.isNotEmpty(basicBusTypeChangeEntity.getTargetBusAction()) && basicBusTypeChangeEntity.isEnable() == true) { - purPlanEntity.setBillNo(gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.JH_ORDER, "yyyyMMdd"))); purPlanEntity.setBillDate(purApplyEntity.getBillDate()); purPlanEntity.setStatus(basicBusTypeChangeEntity.getBusAuditStatus()); @@ -139,9 +136,11 @@ public class IoPurChangeService { purPlanEntity.setInvCode(purApplyEntity.getInvCode()); purPlanEntity.setDeptCode(purApplyEntity.getDeptCode()); purPlanEntity.setCreateUser(purApplyEntity.getAuditUser()); - purPlanEntity.setCreateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime())); + //purPlanEntity.setCreateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime())); + purPlanEntity.setCreateTime(purApplyEntity.getCreateTime()); purPlanEntity.setUpdateUser(purApplyEntity.getAuditUser()); - purPlanEntity.setUpdateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime())); + //purPlanEntity.setUpdateTime(DateUtil.timeProcess(purApplyEntity.getCreateTime(), basicBusTypeChangeEntity.getBusBeforeTime())); + purPlanEntity.setUpdateTime(purApplyEntity.getUpdateTime()); if (purPlanEntity.getStatus() == 3) { purPlanEntity.setAuditUser(""); purPlanEntity.setAuditTime(new Date()); @@ -160,10 +159,7 @@ public class IoPurChangeService { return d; }).collect(Collectors.toList()); purPlanDetailService.insertPurPlanDetailEntity(purPlanDetailEntityList); - purPlanChange(purPlanEntity); - - //更新申购表信息插入计划单号 PurApplyEntity purApplyEntity1 = new PurApplyEntity(); purApplyEntity1.setId(purApplyEntity.getId()); @@ -171,10 +167,9 @@ public class IoPurChangeService { purApplyEntity1.setGeneratePlan(true); purApplyService.update(purApplyEntity1); } - - if (basicBusTypeChangeEntity != null && StrUtil.isNotEmpty(basicBusTypeChangeEntity.getTargetBusAction()) && basicBusTypeChangeEntity.isEnable() == true) { purApplyGen(purApplyEntity); + System.out.println("6666666666666666666999999999999999"); } } } @@ -340,15 +335,39 @@ public class IoPurChangeService { ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); ioOrderDetailBizEntity.setBindRlFk(Long.valueOf(obj.getProductId())); ioOrderDetailBizEntity.setCount(obj.getCount()); - ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); - ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); - ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc()); - ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh()); - ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc()); - ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory()); - ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname()); - ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh()); - if (basicProductsEntity.getPrice() != null) { + if (basicProductsEntity != null && basicProductsEntity.getUuid() != null) { + ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); + } +// ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); +// ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); + if (basicProductsEntity != null && basicProductsEntity.getNameCode() != null) { + ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); + } + if (basicProductsEntity != null && basicProductsEntity.getCpmctymc() != null) { + ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc()); + } + + + + if (basicProductsEntity != null && basicProductsEntity.getZczbhhzbapzbh() != null) { + ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh()); + } + if (basicProductsEntity != null && basicProductsEntity.getYlqxzcrbarmc() != null) { + ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc()); + } + if (basicProductsEntity != null && basicProductsEntity.getManufactory() != null) { + ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory()); + } + if (basicProductsEntity != null && basicProductsEntity.getMeasname() != null) { + ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname()); + } + if (basicProductsEntity != null && basicProductsEntity.getGgxh() != null) { + ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh()); + } +// if (basicProductsEntity.getPrice() != null) { +// ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); +// } + if (basicProductsEntity.getPrice() != null&& basicProductsEntity.getPrice() != null) { ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); } ioOrderDetailBizEntity.setSupId(obj.getSupId()); diff --git a/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java b/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java index 7b5d49678..517dfbdf2 100644 --- a/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java +++ b/src/main/java/com/glxp/api/controller/purchase/PurApplyController.java @@ -162,9 +162,8 @@ public class PurApplyController { purApplyEntity.setAuditTime(new Date()); purApplyEntity.setAuditUser(userId + ""); purApplyService.update(purApplyEntity); - + //System.out.println("666666666666666666++"+purApplyRequest.getStatus()); if (purApplyRequest.getStatus() == 3) { - // generateDocument(purApplyEntity); purChangeService.purApplyChange(purApplyEntity); } diff --git a/src/main/java/com/glxp/api/util/DateUtil.java b/src/main/java/com/glxp/api/util/DateUtil.java index 252b66bd6..d0122a17b 100644 --- a/src/main/java/com/glxp/api/util/DateUtil.java +++ b/src/main/java/com/glxp/api/util/DateUtil.java @@ -684,6 +684,19 @@ public class DateUtil extends DateUtils { } public static Date timeProcess(Date date, Integer timeCount) { + if (date == null || timeCount == null) { + String errorMessage = "日期和时间数量不能为空"; + System.out.println(errorMessage); + throw new IllegalArgumentException(errorMessage); + } + + if (timeCount < 0) { + String errorMessage = "时间数量不能为负数"; + System.out.println(errorMessage); + throw new IllegalArgumentException(errorMessage); + } + + Calendar rightNow = Calendar.getInstance(); rightNow.setTime(date); rightNow.add(Calendar.HOUR, timeCount);