Showing
8 changed files
with
36 additions
and
2 deletions
| @@ -1942,6 +1942,7 @@ CREATE TABLE `procurement_plan` | @@ -1942,6 +1942,7 @@ CREATE TABLE `procurement_plan` | ||
| 1942 | `supply_manager_name` VARCHAR(50) DEFAULT NULL COMMENT '供应部主管', | 1942 | `supply_manager_name` VARCHAR(50) DEFAULT NULL COMMENT '供应部主管', |
| 1943 | `management_dept_name` VARCHAR(50) DEFAULT NULL COMMENT '供应管理科主管', | 1943 | `management_dept_name` VARCHAR(50) DEFAULT NULL COMMENT '供应管理科主管', |
| 1944 | `purchase_dept_name` VARCHAR(50) DEFAULT NULL COMMENT '采购处主管', | 1944 | `purchase_dept_name` VARCHAR(50) DEFAULT NULL COMMENT '采购处主管', |
| 1945 | + `approval_pass_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '审核通过时间', | ||
| 1945 | `create_by_id` varchar(32) DEFAULT NULL COMMENT '创建人ID', | 1946 | `create_by_id` varchar(32) DEFAULT NULL COMMENT '创建人ID', |
| 1946 | `create_by` varchar(64) DEFAULT NULL COMMENT '创建人', | 1947 | `create_by` varchar(64) DEFAULT NULL COMMENT '创建人', |
| 1947 | `update_by_id` varchar(32) DEFAULT NULL COMMENT '更新人ID', | 1948 | `update_by_id` varchar(32) DEFAULT NULL COMMENT '更新人ID', |
| @@ -1958,7 +1959,8 @@ CREATE TABLE `procurement_plan` | @@ -1958,7 +1959,8 @@ CREATE TABLE `procurement_plan` | ||
| 1958 | KEY `idx_pp_process_status` (`process_status`), | 1959 | KEY `idx_pp_process_status` (`process_status`), |
| 1959 | KEY `idx_pp_process_node` (`process_node`), | 1960 | KEY `idx_pp_process_node` (`process_node`), |
| 1960 | KEY `idx_pp_workshop_id` (`workshop_id`), | 1961 | KEY `idx_pp_workshop_id` (`workshop_id`), |
| 1961 | - KEY `idx_pp_salesman_quotation_id` (`salesman_quotation_id`) | 1962 | + KEY `idx_pp_salesman_quotation_id` (`salesman_quotation_id`), |
| 1963 | + KEY `idx_pp_approval_pass_time` (`approval_pass_time`) | ||
| 1962 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='采购计划主表'; | 1964 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='采购计划主表'; |
| 1963 | 1965 | ||
| 1964 | CREATE TABLE `procurement_plan_line` | 1966 | CREATE TABLE `procurement_plan_line` |
| @@ -430,6 +430,13 @@ public class GetProcurementPlanBo extends BaseBo<ProcurementPlan> { | @@ -430,6 +430,13 @@ public class GetProcurementPlanBo extends BaseBo<ProcurementPlan> { | ||
| 430 | private String purchaseDeptName; | 430 | private String purchaseDeptName; |
| 431 | 431 | ||
| 432 | /** | 432 | /** |
| 433 | + * 审核通过时间(精确到时分秒) | ||
| 434 | + */ | ||
| 435 | + @ApiModelProperty("审核通过时间") | ||
| 436 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 437 | + private LocalDateTime approvalPassTime; | ||
| 438 | + | ||
| 439 | + /** | ||
| 433 | * 创建人ID | 440 | * 创建人ID |
| 434 | */ | 441 | */ |
| 435 | @ApiModelProperty("创建人ID") | 442 | @ApiModelProperty("创建人ID") |
| @@ -355,6 +355,11 @@ public class ProcurementPlan extends BaseEntity implements BaseDto { | @@ -355,6 +355,11 @@ public class ProcurementPlan extends BaseEntity implements BaseDto { | ||
| 355 | private String purchaseDeptName; | 355 | private String purchaseDeptName; |
| 356 | 356 | ||
| 357 | /** | 357 | /** |
| 358 | + * 审核通过时间(精确到时分秒,流程 APPROVE_PASS / FINISH 时写入) | ||
| 359 | + */ | ||
| 360 | + private LocalDateTime approvalPassTime; | ||
| 361 | + | ||
| 362 | + /** | ||
| 358 | * 是否展示审核按钮(非持久化字段) | 363 | * 是否展示审核按钮(非持久化字段) |
| 359 | */ | 364 | */ |
| 360 | @TableField(exist = false) | 365 | @TableField(exist = false) |
| @@ -46,6 +46,7 @@ import com.lframework.xingyun.sc.procurement.vo.change.UpdateProcurementPlanChan | @@ -46,6 +46,7 @@ import com.lframework.xingyun.sc.procurement.vo.change.UpdateProcurementPlanChan | ||
| 46 | import com.lframework.xingyun.sc.procurement.vo.plan.CreateProcurementPlanVo; | 46 | import com.lframework.xingyun.sc.procurement.vo.plan.CreateProcurementPlanVo; |
| 47 | import com.lframework.xingyun.sc.procurement.vo.plan.ProcurementPlanLineVo; | 47 | import com.lframework.xingyun.sc.procurement.vo.plan.ProcurementPlanLineVo; |
| 48 | import java.math.BigDecimal; | 48 | import java.math.BigDecimal; |
| 49 | +import java.time.LocalDateTime; | ||
| 49 | import java.util.*; | 50 | import java.util.*; |
| 50 | import java.util.stream.Collectors; | 51 | import java.util.stream.Collectors; |
| 51 | import javax.annotation.Resource; | 52 | import javax.annotation.Resource; |
| @@ -491,6 +492,7 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -491,6 +492,7 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 491 | // 变更完成状态 | 492 | // 变更完成状态 |
| 492 | updatedMain.setChangeStatus("CHANGED"); | 493 | updatedMain.setChangeStatus("CHANGED"); |
| 493 | updatedMain.setProcessNode(null); | 494 | updatedMain.setProcessNode(null); |
| 495 | + updatedMain.setApprovalPassTime(LocalDateTime.now()); | ||
| 494 | procurementPlanService.update(Wrappers.lambdaUpdate(ProcurementPlan.class) | 496 | procurementPlanService.update(Wrappers.lambdaUpdate(ProcurementPlan.class) |
| 495 | .setEntity(updatedMain) | 497 | .setEntity(updatedMain) |
| 496 | .eq(ProcurementPlan::getId, planId)); | 498 | .eq(ProcurementPlan::getId, planId)); |
| @@ -580,6 +582,7 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -580,6 +582,7 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 580 | subVo.setManagementDeptName(procurementPlanChange.getManagementDeptName()); | 582 | subVo.setManagementDeptName(procurementPlanChange.getManagementDeptName()); |
| 581 | subVo.setSupplyManagerName(procurementPlanChange.getSupplyManagerName()); | 583 | subVo.setSupplyManagerName(procurementPlanChange.getSupplyManagerName()); |
| 582 | subVo.setMarketingManagerName(procurementPlanChange.getMarketingManagerName()); | 584 | subVo.setMarketingManagerName(procurementPlanChange.getMarketingManagerName()); |
| 585 | + subVo.setApprovalPassTime(LocalDateTime.now()); | ||
| 583 | 586 | ||
| 584 | List<ProcurementPlanLineVo> subLineVos = new ArrayList<>(); | 587 | List<ProcurementPlanLineVo> subLineVos = new ArrayList<>(); |
| 585 | for (ProcurementPlanChangeLine cl : wLines) { | 588 | for (ProcurementPlanChangeLine cl : wLines) { |
| @@ -610,6 +613,7 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -610,6 +613,7 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 610 | .set(ProcurementPlan::getManagementDeptName, procurementPlanChange.getManagementDeptName()) | 613 | .set(ProcurementPlan::getManagementDeptName, procurementPlanChange.getManagementDeptName()) |
| 611 | .set(ProcurementPlan::getSupplyManagerName, procurementPlanChange.getSupplyManagerName()) | 614 | .set(ProcurementPlan::getSupplyManagerName, procurementPlanChange.getSupplyManagerName()) |
| 612 | .set(ProcurementPlan::getMarketingManagerName, procurementPlanChange.getMarketingManagerName()) | 615 | .set(ProcurementPlan::getMarketingManagerName, procurementPlanChange.getMarketingManagerName()) |
| 616 | + .set(ProcurementPlan::getApprovalPassTime, LocalDateTime.now()) | ||
| 613 | .eq(ProcurementPlan::getId, planId)); | 617 | .eq(ProcurementPlan::getId, planId)); |
| 614 | 618 | ||
| 615 | //todo 废弃原合同;生成新合同 | 619 | //todo 废弃原合同;生成新合同 |
| @@ -49,6 +49,7 @@ import com.lframework.xingyun.sc.procurement.vo.plan.QueryProcurementPlanVo; | @@ -49,6 +49,7 @@ import com.lframework.xingyun.sc.procurement.vo.plan.QueryProcurementPlanVo; | ||
| 49 | import com.lframework.xingyun.sc.procurement.vo.plan.UpdateProcurementPlanVo; | 49 | import com.lframework.xingyun.sc.procurement.vo.plan.UpdateProcurementPlanVo; |
| 50 | import java.math.BigDecimal; | 50 | import java.math.BigDecimal; |
| 51 | import java.time.LocalDate; | 51 | import java.time.LocalDate; |
| 52 | +import java.time.LocalDateTime; | ||
| 52 | import java.time.format.DateTimeFormatter; | 53 | import java.time.format.DateTimeFormatter; |
| 53 | import java.util.*; | 54 | import java.util.*; |
| 54 | import java.util.stream.Collectors; | 55 | import java.util.stream.Collectors; |
| @@ -490,6 +491,7 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -490,6 +491,7 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 490 | .set(ProcurementPlan::getApprovalStatus, approvalStatus) | 491 | .set(ProcurementPlan::getApprovalStatus, approvalStatus) |
| 491 | .set(ProcurementPlan::getProcessStatus, approvalStatus.equals("PASS") ? "COMPLETED" : "REFUSE") | 492 | .set(ProcurementPlan::getProcessStatus, approvalStatus.equals("PASS") ? "COMPLETED" : "REFUSE") |
| 492 | .set(ProcurementPlan::getProcessNode, approvalStatus.equals("PASS") ? null : "GYGLKZG") | 493 | .set(ProcurementPlan::getProcessNode, approvalStatus.equals("PASS") ? null : "GYGLKZG") |
| 494 | + .set(approvalStatus.equals("PASS"), ProcurementPlan::getApprovalPassTime, LocalDateTime.now()) | ||
| 493 | .set(approvalStatus.equals("REFUSE"), ProcurementPlan::getPurchaseDeptName, null) | 495 | .set(approvalStatus.equals("REFUSE"), ProcurementPlan::getPurchaseDeptName, null) |
| 494 | .set(approvalStatus.equals("REFUSE"), ProcurementPlan::getManagementDeptName, null) | 496 | .set(approvalStatus.equals("REFUSE"), ProcurementPlan::getManagementDeptName, null) |
| 495 | .set(approvalStatus.equals("REFUSE"), ProcurementPlan::getSupplyManagerName, null) | 497 | .set(approvalStatus.equals("REFUSE"), ProcurementPlan::getSupplyManagerName, null) |
| @@ -513,9 +515,10 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -513,9 +515,10 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 513 | 515 | ||
| 514 | // 如果未通过的数量为0,说明所有子计划都已审核通过 | 516 | // 如果未通过的数量为0,说明所有子计划都已审核通过 |
| 515 | if (unApprovedCount == 0) { | 517 | if (unApprovedCount == 0) { |
| 516 | - // 更新主计划的流程状态为 COMPLETED | 518 | + // 更新主计划的流程状态为 COMPLETED,同时写入审核通过时间(防止主计划自身未触发到PASS回调) |
| 517 | Wrapper<ProcurementPlan> parentWrapper = Wrappers.lambdaUpdate(ProcurementPlan.class) | 519 | Wrapper<ProcurementPlan> parentWrapper = Wrappers.lambdaUpdate(ProcurementPlan.class) |
| 518 | .set(ProcurementPlan::getProcessStatus, "COMPLETED") | 520 | .set(ProcurementPlan::getProcessStatus, "COMPLETED") |
| 521 | + .set(ProcurementPlan::getApprovalPassTime, LocalDateTime.now()) | ||
| 519 | .eq(ProcurementPlan::getId, parentId); | 522 | .eq(ProcurementPlan::getId, parentId); |
| 520 | getBaseMapper().update(parentWrapper); | 523 | getBaseMapper().update(parentWrapper); |
| 521 | } | 524 | } |
| @@ -44,6 +44,8 @@ import com.lframework.xingyun.sc.procurement.vo.replenish.CreateProcurementPlanR | @@ -44,6 +44,8 @@ import com.lframework.xingyun.sc.procurement.vo.replenish.CreateProcurementPlanR | ||
| 44 | import com.lframework.xingyun.sc.procurement.vo.replenish.QueryProcurementPlanReplenishVo; | 44 | import com.lframework.xingyun.sc.procurement.vo.replenish.QueryProcurementPlanReplenishVo; |
| 45 | import com.lframework.xingyun.sc.procurement.vo.replenish.UpdateProcurementPlanReplenishLineVo; | 45 | import com.lframework.xingyun.sc.procurement.vo.replenish.UpdateProcurementPlanReplenishLineVo; |
| 46 | import com.lframework.xingyun.sc.procurement.vo.replenish.UpdateProcurementPlanReplenishVo; | 46 | import com.lframework.xingyun.sc.procurement.vo.replenish.UpdateProcurementPlanReplenishVo; |
| 47 | + | ||
| 48 | +import java.time.LocalDateTime; | ||
| 47 | import java.util.*; | 49 | import java.util.*; |
| 48 | import java.util.stream.Collectors; | 50 | import java.util.stream.Collectors; |
| 49 | import javax.annotation.Resource; | 51 | import javax.annotation.Resource; |
| @@ -417,6 +419,7 @@ public class ProcurementPlanReplenishServiceImpl | @@ -417,6 +419,7 @@ public class ProcurementPlanReplenishServiceImpl | ||
| 417 | archivedMain.setManagementDeptName(procurementPlanReplenish.getManagementDeptName()); | 419 | archivedMain.setManagementDeptName(procurementPlanReplenish.getManagementDeptName()); |
| 418 | archivedMain.setSupplyManagerName(procurementPlanReplenish.getSupplyManagerName()); | 420 | archivedMain.setSupplyManagerName(procurementPlanReplenish.getSupplyManagerName()); |
| 419 | archivedMain.setMarketingManagerName(procurementPlanReplenish.getMarketingManagerName()); | 421 | archivedMain.setMarketingManagerName(procurementPlanReplenish.getMarketingManagerName()); |
| 422 | + archivedMain.setApprovalPassTime(LocalDateTime.now()); | ||
| 420 | procurementPlanService.save(archivedMain); | 423 | procurementPlanService.save(archivedMain); |
| 421 | 424 | ||
| 422 | //生成买断操作申请单 | 425 | //生成买断操作申请单 |
| @@ -490,6 +493,7 @@ public class ProcurementPlanReplenishServiceImpl | @@ -490,6 +493,7 @@ public class ProcurementPlanReplenishServiceImpl | ||
| 490 | subVo.setMarketingManagerName(procurementPlanReplenish.getMarketingManagerName()); | 493 | subVo.setMarketingManagerName(procurementPlanReplenish.getMarketingManagerName()); |
| 491 | // 子计划的分厂就是当前组的明细分厂(同组内 workshopId 一样),直接赋值 | 494 | // 子计划的分厂就是当前组的明细分厂(同组内 workshopId 一样),直接赋值 |
| 492 | subVo.setWorkshopId(CollectionUtil.isNotEmpty(factoryLines) ? factoryLines.get(0).getWorkshopId() : null); | 495 | subVo.setWorkshopId(CollectionUtil.isNotEmpty(factoryLines) ? factoryLines.get(0).getWorkshopId() : null); |
| 496 | + subVo.setApprovalPassTime(LocalDateTime.now()); | ||
| 493 | 497 | ||
| 494 | // 子明细:只保留当前分厂,workshopId 保持原明细的,其它字段按原明细 copy | 498 | // 子明细:只保留当前分厂,workshopId 保持原明细的,其它字段按原明细 copy |
| 495 | List<ProcurementPlanLineVo> subLineVoList = new ArrayList<>(); | 499 | List<ProcurementPlanLineVo> subLineVoList = new ArrayList<>(); |
| 1 | package com.lframework.xingyun.sc.procurement.vo.plan; | 1 | package com.lframework.xingyun.sc.procurement.vo.plan; |
| 2 | 2 | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import com.lframework.starter.common.constants.StringPool; | ||
| 3 | import com.lframework.starter.common.exceptions.impl.InputErrorException; | 5 | import com.lframework.starter.common.exceptions.impl.InputErrorException; |
| 4 | import com.lframework.starter.common.utils.StringUtil; | 6 | import com.lframework.starter.common.utils.StringUtil; |
| 5 | import com.lframework.starter.web.core.vo.BaseVo; | 7 | import com.lframework.starter.web.core.vo.BaseVo; |
| @@ -7,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; | @@ -7,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; | ||
| 7 | import java.io.Serializable; | 9 | import java.io.Serializable; |
| 8 | import java.math.BigDecimal; | 10 | import java.math.BigDecimal; |
| 9 | import java.time.LocalDate; | 11 | import java.time.LocalDate; |
| 12 | +import java.time.LocalDateTime; | ||
| 10 | import java.util.List; | 13 | import java.util.List; |
| 11 | import javax.validation.Valid; | 14 | import javax.validation.Valid; |
| 12 | import javax.validation.constraints.NotBlank; | 15 | import javax.validation.constraints.NotBlank; |
| @@ -363,6 +366,10 @@ public class CreateProcurementPlanVo implements BaseVo, Serializable { | @@ -363,6 +366,10 @@ public class CreateProcurementPlanVo implements BaseVo, Serializable { | ||
| 363 | @ApiModelProperty("采购处主管") | 366 | @ApiModelProperty("采购处主管") |
| 364 | private String purchaseDeptName; | 367 | private String purchaseDeptName; |
| 365 | 368 | ||
| 369 | + @ApiModelProperty("审核通过时间") | ||
| 370 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | ||
| 371 | + private LocalDateTime approvalPassTime; | ||
| 372 | + | ||
| 366 | /** | 373 | /** |
| 367 | * 明细信息 | 374 | * 明细信息 |
| 368 | */ | 375 | */ |
| @@ -69,6 +69,7 @@ | @@ -69,6 +69,7 @@ | ||
| 69 | <result column="supply_manager_name" property="supplyManagerName"/> | 69 | <result column="supply_manager_name" property="supplyManagerName"/> |
| 70 | <result column="management_dept_name" property="managementDeptName"/> | 70 | <result column="management_dept_name" property="managementDeptName"/> |
| 71 | <result column="purchase_dept_name" property="purchaseDeptName"/> | 71 | <result column="purchase_dept_name" property="purchaseDeptName"/> |
| 72 | + <result column="approval_pass_time" property="approvalPassTime"/> | ||
| 72 | <result column="create_by_id" property="createById"/> | 73 | <result column="create_by_id" property="createById"/> |
| 73 | <result column="create_by" property="createBy"/> | 74 | <result column="create_by" property="createBy"/> |
| 74 | <result column="update_by_id" property="updateById"/> | 75 | <result column="update_by_id" property="updateById"/> |
| @@ -145,6 +146,7 @@ | @@ -145,6 +146,7 @@ | ||
| 145 | pp.supply_manager_name, | 146 | pp.supply_manager_name, |
| 146 | pp.management_dept_name, | 147 | pp.management_dept_name, |
| 147 | pp.purchase_dept_name, | 148 | pp.purchase_dept_name, |
| 149 | + pp.approval_pass_time, | ||
| 148 | pp.create_by_id, | 150 | pp.create_by_id, |
| 149 | pp.create_by, | 151 | pp.create_by, |
| 150 | pp.update_by_id, | 152 | pp.update_by_id, |